http://stackoverflow.com/q/25066757
has answer: http://stackoverflow.com/a/25068014
has answer: http://stackoverflow.com/a/25069072
has comment: http://stackoverflow.com/comment/38997200
type: Question
has answer: http://stackoverflow.com/a/25067163
tagged with: templating
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38996874
upvote count: 2
has comment: http://stackoverflow.com/comment/38997249
answer count: 3
tagged with: ractivejs
has title: RactiveJS iterator with on-click behavior
favorite count: 0
possible better answer: http://stackoverflow.com/a/25067163
has body: I am attempting to fire a function that is part of the data object I'm passing to RactiveJS when populating a template. I've tried a few other libraries, but I can't find what I'm looking for. Here is the description of what I'm doing, and I'm hopeful that someone can suggest a library for doing what I'm trying to do. A service is feeding my application a JSON Object that looks something like this var data = { "users": { "Aaron": { "age": "31", "level": "legit", "talk": function(){ console.log("Howdy! I'm " + this.level); } }, "Pete": { "age": "30", "level": "godlike", "talk": function(){ console.log("Howdy! I'm " + this.level); } } } }; My template appears to be correct As instructed by the Documentation var usersTemplate = "&lt;ul&gt;&lt;li&gt;&lt;a href='#' on-click='talk'&gt;{{name}} says:&lt;/li&gt;{{/users}}&lt;/ul&gt;"; Then I build a new Ractive instance var people = new Ractive({ el: "#userlist", template: usersTemplate , data: data }); Trouble is, clicking on each user won't actually do anything because RactiveJS doesn't seem to work like that. It handles events like this. people.on({ talk: function(evt){ evt.original.preventDefault(); console.log("I clicked on the template"); } }); What I'm trying to do is trigger the action function inside of the data object that I passed in without the controller knowing what the name of the method is. Specifying it in the template, and in the data object should be enough. Ractive gives enough information that I can traverse the data object, but this isn't good enough. people.on({ talk: function( evt ) { evt.original.preventDefault(); var pointer = json_output; var path = evt.keypath.split("."); for( var i = 0; i &lt; path.length; i++){ console.log(i); pointer = pointer[path[i]]; } if(pointer.hasOwnProperty("action") &amp;&amp; typeof(pointer.action) === "function") { pointer.action(evt); } } }); JSBin Example Is RactiveJS not the right library for the job? Thank you ahead of time for helping me in my sea…
tagged with: frontend
accepted answer: http://stackoverflow.com/a/25069072
type: AnsweredQuestion
score: 2
downvote count: 0

http://stackoverflow.com/a/24937278
accepted answer of: http://stackoverflow.com/q/24936433
type: Answer
score: 2
downvote count: 0
upvote count: 2
has body: You can try below code: $(".button").click(function(){ if($(this).hasClass("selected")){ $(this).siblings(".more_facts").slideUp(500); $(this).removeClass("selected"); $(this).text("More Information"); } else { $(".pillar_blocks").find(".selected").siblings(".more_facts").slideUp(500); $(".pillar_blocks").find(".selected").text("More Information"); $(".pillar_blocks").find(".selected").removeClass("selected"); $(this).addClass("selected"); $(this).siblings(".more_facts").slideDown(500); $(this).text("Less Information"); } }); Check out this Fiddle..
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24936433

javascript
tags question: http://stackoverflow.com/q/24924464
tags question: http://stackoverflow.com/q/25042208
tags question: http://stackoverflow.com/q/25021881
tags question: http://stackoverflow.com/q/24982280
tags question: http://stackoverflow.com/q/25014121
tags question: http://stackoverflow.com/q/25024423
tags question: http://stackoverflow.com/q/24979131
tags question: http://stackoverflow.com/q/25007130
tags question: http://stackoverflow.com/q/25050690
tags question: http://stackoverflow.com/q/24999452
tags question: http://stackoverflow.com/q/24975514
tags question: http://stackoverflow.com/q/24910252
tags question: http://stackoverflow.com/q/24955862
tags question: http://stackoverflow.com/q/24990017
tags question: http://stackoverflow.com/q/25067474
tags question: http://stackoverflow.com/q/24922427
tags question: http://stackoverflow.com/q/24928135
tags question: http://stackoverflow.com/q/25049536
tags question: http://stackoverflow.com/q/24926159
tags question: http://stackoverflow.com/q/25000688
tags question: http://stackoverflow.com/q/24980369
tags question: http://stackoverflow.com/q/24954130
tags question: http://stackoverflow.com/q/25043826
tags question: http://stackoverflow.com/q/24944985
tags question: http://stackoverflow.com/q/24950494
tags question: http://stackoverflow.com/q/24910420
tags question: http://stackoverflow.com/q/25044124
tags question: http://stackoverflow.com/q/24954664
tags question: http://stackoverflow.com/q/24968352
tags question: http://stackoverflow.com/q/25034120
tags question: http://stackoverflow.com/q/24932428
tags question: http://stackoverflow.com/q/25009142
tags question: http://stackoverflow.com/q/24936011
tags question: http://stackoverflow.com/q/24963580
tags question: http://stackoverflow.com/q/24945839
tags question: http://stackoverflow.com/q/24968921
tags question: http://stackoverflow.com/q/24984081
tags question: http://stackoverflow.com/q/25003592
tags question: http://stackoverflow.com/q/24987280
tags question: http://stackoverflow.com/q/24974029
tags question: http://stackoverflow.com/q/24939347
tags question: http://stackoverflow.com/q/24944413
tags question: http://stackoverflow.com/q/24917282
tags question: http://stackoverflow.com/q/24988758
tags question: http://stackoverflow.com/q/25065321
tags question: http://stackoverflow.com/q/24941799
tags question: http://stackoverflow.com/q/24937295
tags question: http://stackoverflow.com/q/24909862
tags question: http://stackoverflow.com/q/24942313
tags question: http://stackoverflow.com/q/24956997
tags question: http://stackoverflow.com/q/24937800
tags question: http://stackoverflow.com/q/24936414
tags question: http://stackoverflow.com/q/25003533
tags question: http://stackoverflow.com/q/25033813
tags question: http://stackoverflow.com/q/24999499
tags question: http://stackoverflow.com/q/24930628
tags question: http://stackoverflow.com/q/24951608
tags question: http://stackoverflow.com/q/24976226
tags question: http://stackoverflow.com/q/25044428
tags question: http://stackoverflow.com/q/25016259
tags question: http://stackoverflow.com/q/24960334
tags question: http://stackoverflow.com/q/25036333
tags question: http://stackoverflow.com/q/25020057
tags question: http://stackoverflow.com/q/25010032
tags question: http://stackoverflow.com/q/25051759
tags question: http://stackoverflow.com/q/24991062
tags question: http://stackoverflow.com/q/25058726
tags question: http://stackoverflow.com/q/24961061
tags question: http://stackoverflow.com/q/24927285
tags question: http://stackoverflow.com/q/24956973
tags question: http://stackoverflow.com/q/24985826
tags question: http://stackoverflow.com/q/24923898
tags question: http://stackoverflow.com/q/24959123
tags question: http://stackoverflow.com/q/24967941
tags question: http://stackoverflow.com/q/25012029
tags question: http://stackoverflow.com/q/24978423
tags question: http://stackoverflow.com/q/24984642
tags question: http://stackoverflow.com/q/24927868
tags question: http://stackoverflow.com/q/25066943
tags question: http://stackoverflow.com/q/24991005

http://stackoverflow.com/comment/38716287
type: Comment
comment on: http://stackoverflow.com/q/24917567
has text: One of the scripts loaded by your site adds a `min-height:845px` style to the slider section. I'm not sure which one it is. Compare [this fiddle](http://jsfiddle.net/Dydb3/) to [its update](http://jsfiddle.net/Dydb3/1/). The only difference between these two is that I removed a bunch of external resource links.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38701696
score: 0
type: Comment
type: QuestionComment
has text: @RobJacobs already tried that, it prints the initial value but doesn't update.
comment on: http://stackoverflow.com/q/24910341

http://stackoverflow.com/comment/38759501
comment on: http://stackoverflow.com/a/24934915
type: AnswerComment
has text: Thank you so much I was going in circles trying to understand this, and I see that with this whole DOM , there could potentially be a work around. Where I have the javascript pull a txt file with javascript code and have it placed like a script into a pre-emptied html page.
score: 0
type: Comment

http://stackoverflow.com/a/24929722
type: Answer
score: 2
downvote count: 0
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38738368
has body: I think it should be /.+\..{2,3}$/ where .+ says it should have 1 or more characters \. says there should be a . .{2,3} says there should be 2-3 chars(you can say something like [a-z]{2,3} to allow only alphabets)
accepted answer of: http://stackoverflow.com/q/24929678
answers question: http://stackoverflow.com/q/24929678

http://stackoverflow.com/q/25046756
type: Question
has title: 'null's number value acting differently
upvote count: 1
answer count: 1
tagged with: conditional-operator
has body: Into Ecma-262, it says number value of null is +0. So when I doing these: var a = null; //so now a = 0 var b = 0; var c = 1; alert(a * c); //shows '0' as expected alert(a &lt; c); //shows 'true' as expected alert(a &gt; c); //shows 'false' as expected alert(a === b); //shows 'false' alert(a == b); //shows 'false' - why ? I know from the Ecma-262 javascript treats +0 and -0 same. Then why it is showing false ?
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38959371
downvote count: 0
has answer: http://stackoverflow.com/a/25046806
score: 1
favorite count: 0

http://stackoverflow.com/comment/38884774
score: 0
type: Comment
type: QuestionComment
has text: It has to do with custom framework restrictions. Javascript is put into a separate content block beyond the main body.
comment on: http://stackoverflow.com/q/25007525

http://stackoverflow.com/a/24924101
answers question: http://stackoverflow.com/q/24923950
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24923950
upvote count: 2
has body: Try this php code &lt;?php $test="00010387"; ?&gt; &lt;a href="javascript:browsePricebySKU('&lt;?php echo $test;?&gt;');"&gt;&lt;/a&gt; &lt;script type="text/javascript"&gt; function browsePricebySKU(test){ alert(test); } &lt;/script&gt; Single quotes will not be Escape, It will output $test as a string, not the value of the $test variable;
type: AcceptedAnswer
type: Answer
score: 2

http://stackoverflow.com/q/24964960
possible better answer: http://stackoverflow.com/a/24978199
has body: I have a jqGrid control which includes a dropdownlist field. The items in the list come from a method on the server side using ajax, but I'm not sure how to structure the returned json to make it compatible with the grid. I looked at this question and according to the answers, it seems like the grid expects the following format for dropdowns: [value] : [display text] I'm relatively new to JavaScript and am not sure what type of data this is (I'm assuming it's a key-value pair?) so I don't know how create an array of this type from my json object. This is what I tried: function populateTable(){ $.ajax({ type: "POST", url: "MyHttpHandler.ashx", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", success: function (result) { var jsonObject = jQuery.parseJSON(result.d); var dropdpwnvalues = new[]; for(var i = 0; i&lt; jsonObject.length; i++){ dropdpwnvalues.push({ jsonObject[i].id : jsonObject[i].name }); } // The rest of the function ); } dropdpwnvalues variable is the one that gets bound to the grid. Note that jsonObject does have an id and name on it, but this syntax dropdpwnvalues.push({ jsonObject[i].id : jsonObject[i].name }); is obviously incorrect. Any ideas how I can make the list from this json object?
has answer: http://stackoverflow.com/a/24978199
has title: jqGrid Initialize DropDownList Items
linked to: http://stackoverflow.com/q/19427028
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
has answer: http://stackoverflow.com/a/25045584
tagged with: jqgrid
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38837139
has comment: http://stackoverflow.com/comment/38816022
linked to: http://stackoverflow.com/q/19420373
has comment: http://stackoverflow.com/comment/38837420
tagged with: jquery
tagged with: asp.net
accepted answer: http://stackoverflow.com/a/25045584

http://stackoverflow.com/q/25033647
has body: I have an exapmle where value for watched variable can be set in current stack or can be loaded asynchronously (it is incapsulated code). So, i can not be sure, if the value was changed, when the watch handler called. I have read and understand this API description, but i still don`t know, how to fix my code. PS: I was trying to call $scope.$digest(), but $apply was already in progress.
has comment: http://stackoverflow.com/comment/38934989
tagged with: watch
has answer: http://stackoverflow.com/a/25034677
has comment: http://stackoverflow.com/comment/38933873
has title: Angular. Ambiguous $watch behavior for sync and async code
has comment: http://stackoverflow.com/comment/38934840
tagged with: angularjs-scope
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25034486
tagged with: javascript
score: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38938838

http://stackoverflow.com/q/25054538
has body: I am new to JAVASCRIPT and this forum, well I've read many posts here but this is my first post. I've taken to using arrays as shown below to store the majority of data for a game I'm building; this goes especially for game statistics and coordinates. The example below is one of my smaller arrays. I keep them all in an excel spreadsheet which is particularly handy when I need to adjust some data as they are all concatenated automatically. So then I just copy the chunk of code and paste it in my javascript. This example mainly stores coordinates for the inventory slots and what kind of items they each hold. //ENEMY INV ARAY COORDS function enemyinvcoords(name, x1, y1, x2, y2, item, state){ this.name = name, this.x1 = x1, this.x2 = x2, this.y1 = y1, this.y2 = y2, this.item = item, this.state = state; } //CREATE AND FILL INVCOORDSARRAY var ENinvarr = []; ENinvarr.push(new enemyinvcoords('EI0', 420, 280, 460, 320, 1, false)); ENinvarr.push(new enemyinvcoords('EI1', 465, 280, 505, 320, 2, false)); ENinvarr.push(new enemyinvcoords('EI2', 510, 280, 550, 320, 3, false)); ENinvarr.push(new enemyinvcoords('EI3', 555, 280, 595, 320, 4, false)); ENinvarr.push(new enemyinvcoords('EI4', 600, 280, 640, 320, 5, false)); ENinvarr.push(new enemyinvcoords('EI5', 645, 280, 685, 320, 6, false)); ENinvarr.push(new enemyinvcoords('EI6', 690, 280, 730, 320, 7, false)); Is there anything wrong with this method? so far it's been very handy when populating the screen and editing statistics as it allows me to keep my code short by using for loops that run through the required arrays. Do you have any advice of how I might be able to store these things in a better way? I am in the long run planning to have this game communicate with a server of some kind but for the moment I'm just designing game mechanics and UI interaction. I suspect there will be many rewrites before that ever happens though. I'm probably asking this a bit late though, if this turns out to be a bad way to work then I feel ano…
has answer: http://stackoverflow.com/a/25063297
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/25063297
tagged with: javascript
has comment: http://stackoverflow.com/comment/38973379
has title: storing coords and various game data in arrays JAVASCRIPT
has comment: http://stackoverflow.com/comment/38988805
answer count: 1
tagged with: arrays
downvote count: 0
has comment: http://stackoverflow.com/comment/38973090
favorite count: 0

http://stackoverflow.com/comment/38883059
type: QuestionComment
comment on: http://stackoverflow.com/q/25006813
has text: it's a class i've change the code above sorry! but is till doesn't work
score: 0
type: Comment

http://stackoverflow.com/a/24913527
answers question: http://stackoverflow.com/q/24913341
has comment: http://stackoverflow.com/comment/38709574
has comment: http://stackoverflow.com/comment/38708749
score: 0
has body: I would try to use asynchronous loading with error handling: $.getScript( "ajax/test.js" ) .done(function( script, textStatus ) { console.log( textStatus ); }) .fail(function( jqxhr, settings, exception ) { $( "div.log" ).text( "Triggered ajaxError handler." ); }); http://api.jquery.com/jQuery.getScript/
type: Answer
has comment: http://stackoverflow.com/comment/38712984

http://stackoverflow.com/a/25027913
has body: Check what is returned from your service, it is probably a Persons object containing a list of Person rather than just a list of person. In that case, isArray should be false in your Service javascript.
has comment: http://stackoverflow.com/comment/38923628
has comment: http://stackoverflow.com/comment/38923559
has comment: http://stackoverflow.com/comment/38923400
has comment: http://stackoverflow.com/comment/38923455
answers question: http://stackoverflow.com/q/25027785
score: 0
type: Answer

http://stackoverflow.com/comment/38774867
type: Comment
has text: But I wonder how accepted solution can work for you? [See this demo](http://regex101.com/r/bE5jZ5/4) It doesn't match `/second/` from input data. **Also this regex will work very well with `String#replace` method. I can provide you working code if you want.**
comment on: http://stackoverflow.com/a/24945058
type: AnswerComment
score: 0

http://stackoverflow.com/q/25031277
linked to: http://stackoverflow.com/q/850341
answer count: 1
has title: parseInt() behaves differently
has comment: http://stackoverflow.com/comment/38929147
has comment: http://stackoverflow.com/comment/38929153
has comment: http://stackoverflow.com/comment/38929165
has comment: http://stackoverflow.com/comment/38929101
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38929124
has body: I am using the following condition in javascript to filter my options based on postcode. if (parseInt(postcode, 10) &gt; 99 &amp;&amp; parseInt(postcode, 10) &lt; 10000 &amp;&amp; postcode != '') { // code goes here... } where postcode can be any Australian postcode. It works for all except some random postcodes like 0852/0840/4840. I am not sure whether it works for all postcodes I just checked for random postcodes.
duplicate of: http://stackoverflow.com/q/850341
type: Question
has comment: http://stackoverflow.com/comment/38929164
tagged with: javascript
has answer: http://stackoverflow.com/a/25031490
score: 0

java
tags question: http://stackoverflow.com/q/25041700
tags question: http://stackoverflow.com/q/25021453
tags question: http://stackoverflow.com/q/24921462
tags question: http://stackoverflow.com/q/24966678
tags question: http://stackoverflow.com/q/24962023
tags question: http://stackoverflow.com/q/24946092
tags question: http://stackoverflow.com/q/24955350
tags question: http://stackoverflow.com/q/24927496
tags question: http://stackoverflow.com/q/24950277
tags question: http://stackoverflow.com/q/24932702
tags question: http://stackoverflow.com/q/25020039
tags question: http://stackoverflow.com/q/24968893
tags question: http://stackoverflow.com/q/24953856
tags question: http://stackoverflow.com/q/24984648
tags question: http://stackoverflow.com/q/24986962
tags question: http://stackoverflow.com/q/24960647
tags question: http://stackoverflow.com/q/24932806
tags question: http://stackoverflow.com/q/25049048
tags question: http://stackoverflow.com/q/24954125
tags question: http://stackoverflow.com/q/24998047
tags question: http://stackoverflow.com/q/24927501
tags question: http://stackoverflow.com/q/25059301
tags question: http://stackoverflow.com/q/25054045
tags question: http://stackoverflow.com/q/24933975
tags question: http://stackoverflow.com/q/25019945
tags question: http://stackoverflow.com/q/24961452
tags question: http://stackoverflow.com/q/24937319
tags question: http://stackoverflow.com/q/25027785
tags question: http://stackoverflow.com/q/24978218
tags question: http://stackoverflow.com/q/25041851
tags question: http://stackoverflow.com/q/25045854
tags question: http://stackoverflow.com/q/25022357
tags question: http://stackoverflow.com/q/24997990
tags question: http://stackoverflow.com/q/24946911
tags question: http://stackoverflow.com/q/24945216
tags question: http://stackoverflow.com/q/25057704
tags question: http://stackoverflow.com/q/25017117
tags question: http://stackoverflow.com/q/24952131
tags question: http://stackoverflow.com/q/24933866
tags question: http://stackoverflow.com/q/24988020
tags question: http://stackoverflow.com/q/24925358
tags question: http://stackoverflow.com/q/24949506
tags question: http://stackoverflow.com/q/25042247
tags question: http://stackoverflow.com/q/25006652
tags question: http://stackoverflow.com/q/24936873
tags question: http://stackoverflow.com/q/24937209
tags question: http://stackoverflow.com/q/24965194
tag name: java
tags question: http://stackoverflow.com/q/24942101
tags question: http://stackoverflow.com/q/24962863
tags question: http://stackoverflow.com/q/24991859
tags question: http://stackoverflow.com/q/25021155
tags question: http://stackoverflow.com/q/24970931
tags question: http://stackoverflow.com/q/24986282
tags question: http://stackoverflow.com/q/25055449
tags question: http://stackoverflow.com/q/25035172
tags question: http://stackoverflow.com/q/24957104
tags question: http://stackoverflow.com/q/25030600
tags question: http://stackoverflow.com/q/24972559
tags question: http://stackoverflow.com/q/25041814
tags question: http://stackoverflow.com/q/24972066
tags question: http://stackoverflow.com/q/25055878
type: Tag
tags question: http://stackoverflow.com/q/24964609
tags question: http://stackoverflow.com/q/25008841
tags question: http://stackoverflow.com/q/25003557
tags question: http://stackoverflow.com/q/24926684
tags question: http://stackoverflow.com/q/24911008
tags question: http://stackoverflow.com/q/24971788
tags question: http://stackoverflow.com/q/25005999
tags question: http://stackoverflow.com/q/24954516
tags question: http://stackoverflow.com/q/24963696
tags question: http://stackoverflow.com/q/24977781

http://stackoverflow.com/comment/38750446
comment on: http://stackoverflow.com/q/24936280
has text: post your html dom structure
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24921560
has body: I am reading many files that contain a mixture of objects. I have one root stream that streams objects like: // root stream {"action": "action_type_a", "id": "1234"} {"action": "action_type_b", id: "24566"} {"action": "action_type_b", id: "0808098"} {"action": "action_type_b", id: "8098098"} {"action": "action_type_a", "id": "098098"} {"action": "action_type_b", id: "08098"} I pipe the root stream into 2 separate grep filtered streams one filtering for action_type_a that we'll call A and looks like: // stream A {"action": "action_type_a", "id": "1234"} {"action": "action_type_a", "id": "098098"} and one filtering for action_type_b B that looks like: // stream B {"action": "action_type_b", id: "24566"} {"action": "action_type_b", id: "0808098"} {"action": "action_type_b", id: "8098098"} {"action": "action_type_b", id: "08098"} I also have a seperate map of ids // id map { "1234" : "098098", ""098098" : "8098098" } so ids on A objects can match up with ids on B objects I want to process stream A compare each objects id to the map and then process B to see if there is a corresponding object in stream B I"m not sure how to handle this without draining stream B before processing every object in A. My first thought was to clone B for each entry in A. Is that possible? my current attempt is to use event-streams es.map on stream A and inside of the map function i'm attempting to read B and compare it with A and a I read B I also write to record back to B. This however is giving me the : (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. error because I am re-defining the listeners for B within the map of A
has comment: http://stackoverflow.com/comment/38767326
score: 1
has comment: http://stackoverflow.com/comment/38747825
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38731428
type: UnansweredQuestion
tagged with: node.js-stream
has title: Node.js How to compare two streams?
has comment: http://stackoverflow.com/comment/38773848
tagged with: node.js
has comment: http://stackoverflow.com/comment/38729042
has comment: http://stackoverflow.com/comment/38767464
answer count: 0
tagged with: stream
upvote count: 1
has comment: http://stackoverflow.com/comment/38767428
type: Question
has comment: http://stackoverflow.com/comment/38734507

http://stackoverflow.com/q/24970416
has answer: http://stackoverflow.com/a/25061747
has answer: http://stackoverflow.com/a/25045139
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 7
has comment: http://stackoverflow.com/comment/38876000
has answer: http://stackoverflow.com/a/25057304
linked to: http://stackoverflow.com/q/2440377
linked to: http://stackoverflow.com/q/115426
upvote count: 7
has comment: http://stackoverflow.com/comment/38891430
has body: I would like to detect if two rotated divs are colliding. I know how to do it if they're not rotated, but I don't know how to do it when they actually are. I have tried some collision plugins such as jQuery Collision (http://sourceforge.net/projects/jquerycollision/), but they have not worked when the div is rotated. I have made the rotation of the divs using CSS's transform property.
type: Question
accepted answer: http://stackoverflow.com/a/25061747
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38814587
linked to: http://stackoverflow.com/q/10962379
has title: Detect if two rotated divs collide using JQuery
tagged with: rotation
has comment: http://stackoverflow.com/comment/38921933
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/25045139
answer count: 3

http://stackoverflow.com/q/24988644
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38849178
linked to: http://stackoverflow.com/q/1476573
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24988985
has comment: http://stackoverflow.com/comment/38849874
score: 1
upvote count: 1
has body: &lt;script type="text/javascript"&gt; $(function() { $("#progressbar").progressbar({ value: 35 }); }); &lt;/script&gt; &lt;div id="progressbar"&gt; &lt;/div&gt; code taken from : jQuery UI: How to change the color of a ProgressBar? To make the question clearer : I want the progress bar to have segments and they should be be green from 0% - 59%, yellow from 60% - 89%, and red from 90% - %100%.
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24988985
has comment: http://stackoverflow.com/comment/38849167
has title: jQuery UI: How to make a multi colored ProgressBar? Segments colored differently

http://stackoverflow.com/q/25037635
type: Question
answer count: 2
tagged with: javascript
upvote count: 1
has body: I need to check a string where at the end the to symbols are mandatory, first is '@' and the second is given with the t variable. I have got this: var t = 0; var p = /^[a-z0-9A-Z_-]*@$/ + t.toString(); p.test("asdf2@0"); and get always 'false' how to add the t String to the RegExp of p variable Now, I have searched a bit and found out that people do use RegExp constructor: var t = 0; var re = new RegExp("^\/\\[a-z0-9A-Z_-]*@" + t.toString() + "\/\\$"); var z = re.test("asdf2@0"); in this case z is always 'false'. what I am doing wrong? Can you please, also explain what \ means exactly and why and where to apply it in the RegExp.
tagged with: regex
tagged with: string
favorite count: 0
possible better answer: http://stackoverflow.com/a/25037738
has title: how do I change the regex to get the desired one?
has answer: http://stackoverflow.com/a/25037738
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25037762
accepted answer: http://stackoverflow.com/a/25037762
has comment: http://stackoverflow.com/comment/38940787

http://stackoverflow.com/comment/38889527
type: AnswerComment
comment on: http://stackoverflow.com/a/25010010
score: 0
type: Comment
has text: I got to it now, thanks for the help, look at my edit

http://stackoverflow.com/comment/38981164
type: AnswerComment
has text: I saw your fiddle but i think you can not have add/remove directly attached to root it should be associated with Line. http://jsfiddle.net/GXd7P/11/
type: Comment
comment on: http://stackoverflow.com/a/25056454
score: 0

http://stackoverflow.com/comment/38968102
score: 0
type: Comment
type: QuestionComment
has text: @Sirko Well, in this case that's probably what he wants. But there are cases where doing stuff like this is useful (though not normally with arrays, unless you need holes in them).
comment on: http://stackoverflow.com/q/25051733

http://stackoverflow.com/q/24955122
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/24955988
tagged with: http://stackoverflow.com/tag/html
score: 2
upvote count: 2
tagged with: twitter-bootstrap
tagged with: calendar
type: AnsweredQuestion
has title: Some features of a Bootstrap calendar do not work
has answer: http://stackoverflow.com/a/24955988
has body: I'm trying to implement this Bootstrap 3 calendar: http://bootstrap-calendar.azurewebsites.net/index-bs3.html (you can of course see its innards by looking at the source) However, there are problems. Firstly, the checkbox to toggle modals do not work. Rather, to enable modals, one has to first click a day in the calendar (to get the black dropdown menu), and then they are enabled. Secondly, the navigational buttons (week, day, month, prev, next, today) do not work at all. No error is caught. Only this warning: Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. Here's the relevant JS and HTML code: &lt;head&gt; &lt;script type="text/javascript" src="{{ STATIC_URL }}js/jquery-1.11.1.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="{{ STATIC_URL }}js/jquery.cookie.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="{{ STATIC_URL }}underscore/underscore.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="{{ STATIC_URL }}bootstrap-calendar/js/calendar.js"&gt;&lt;/script&gt; &lt;/head&gt; And &lt;div class="container"&gt; &lt;div class="page-header"&gt; &lt;div class="pull-right form-inline"&gt; &lt;div class="btn-group"&gt; &lt;button class="btn btn-primary" data-calendar-nav="prev"&gt;&lt;&lt; Prev&lt;/button&gt; &lt;button class="btn" data-calendar-nav="today"&gt;Today&lt;/button&gt; &lt;button class="btn btn-primary" data-calendar-nav="next"&gt;Next &gt;&gt;&lt;/button&gt; &lt;/div&gt; &lt;div class="btn-group"&gt; &lt;button class="btn btn-warning" data-calendar-view="year"&gt;Year&lt;/button&gt; &lt;button class="btn btn-warning active" data-calendar-view="month"&gt;Month&lt;/button&gt; &lt;button class="btn btn-warning" data-calendar-view="week"&gt;Week&lt;/button&gt; &lt;button class="btn btn-warning" data-calendar-view="day"&gt;Day&lt;/button&…

http://stackoverflow.com/comment/38705519
has text: Gordon Thank you I did not see that.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24912452
type: QuestionComment

http://stackoverflow.com/comment/133298951
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25062132
has text: Would like a solution that pulls the timestamp from the file itself rather than server filesystem metadata.
score: 0

http://stackoverflow.com/a/25030151
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38927175
answers question: http://stackoverflow.com/q/25030088
downvote count: 0
has comment: http://stackoverflow.com/comment/38927737
score: 1
has body: Datepicker is not working because #datepicker didn't exist yet. You could make this work by moving ('#datepicker').datepicker() to after the point in the code where it(#datepicker) is created.

http://stackoverflow.com/q/24919590
answer count: 1
has body: I currently have an AJAX call out to a PHP file that works, that is the following: //Load map from database function getMap(){ return $.ajax({ url: "getMap.php", type: "POST", dataType: 'JSON', }); }; getMap().done(function(r) { if (r) { loadedMap(JSON.parse(r.mapArray), JSON.parse(r.mapProperties)); //call loadedMap(r) if loading a map from DB } else { console.log("No data"); } }).fail(function(x) { console.log("error"); }); That works within a single javascript file that successfully passes r.mapArray and r.mapProperties to my main loadedMap function. I'm trying to learn about the IIFE Javascript Module model, and split my work up into separate files. So, I currently have main.js: (function() { // let's get our map var gameMap = mapGen.getMap().done(); console.log(gameMap); })(); and mapGen.js: var mapGen = function() { return { getMap: function() { return $.ajax({ url: "getMap.php", type: "POST", dataType: 'JSON', }); } }; }() If I console.log(gameMap), I see the responseText JSON object with my data. I just can't seem to access it. console.log(gameMap.responseText) is undefined. as is gameMap.responseJSON (though I see both of them in the console).
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24921976
accepted answer: http://stackoverflow.com/a/24921976
type: Question
tagged with: javascript
tagged with: ajax
score: 0
tagged with: iife
has title: AJAX call using IIFE? Can't seem to get .done to work the same as a regular function

http://stackoverflow.com/a/25021901
answers question: http://stackoverflow.com/q/25021806
score: 0
has body: If you want parts of a page to have "different titles" then you have to make multiple pages with different URLs and titles in the meta information. Also remember canonical references to the main page. So you would have one page for the FAQ with the questions and answers. One page for question 1 with the question and answer. Another page for question 2 with question and answer. Stackoverflow is very good at this. Note the URL of this question for example. It has the question in the URL of this page. This makes that question "search engine friendly". I suggest you do the same. You can read on google's webmaster pages about how to set up cononical URLs. Google (and other search engines) like when you do this.
has comment: http://stackoverflow.com/comment/38913723
type: Answer
has comment: http://stackoverflow.com/comment/38912006
has comment: http://stackoverflow.com/comment/38919831

http://stackoverflow.com/comment/38811944
comment on: http://stackoverflow.com/a/24968939
score: 0
type: Comment
has text: please show it how to use it within Echo in PHP.. I have to useit inside Echo and I think I'm messing up with the quotes somewhere..
type: AnswerComment

http://stackoverflow.com/a/24999245
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/42811267
type: Answer
answers question: http://stackoverflow.com/q/24960288
score: 1
has comment: http://stackoverflow.com/comment/42948366
has body: After @Chris T's explanation, it seems that the cleanest solution is to listen for the $stateChangeSuccess event: redirects = inventory: 'inventory.low' $rootScope.$on '$stateChangeSuccess', (e, toState) -&gt; redirect = redirects[toState.name] $state.go redirect if redirect Where redirects will contain any route redirects that may occur. Thanks all!

http://stackoverflow.com/comment/49127149
has text: Hi .. I am facing a similar problem... but when the checkbox is initially selected, unchecking the selected checkbox doesn't update the ng-model value. It only gets fired once the box has been checked and further on. Would be of great help if there a way to capture the initial checkbox deselect.
type: Comment
comment on: http://stackoverflow.com/a/24963595
score: 0
type: AnswerComment

http://stackoverflow.com/q/25015947
type: Question
has body: I create elements (some are SVG Tags, some are simple HTML) with ng-repeat. On changes of the data model - an object that is reset on arrival of new data - there are always elements left behind as detached DOM elements. They are held like this: The Elements are part of data_user which seems to be part of jquery. This problem occurs at several places on change of data. It seems that watchers are the problem, since they are keeping reference to their expression. The elements are created e.g. like this: .directive('svgGraphic', ['$compile', function ($compile) { return { restrict: 'E', replace: false, link: function (scope, element, attrs) { var svgData = scope.model.getAttribute("svgGraphic"); var svgDomElement = $(svgData.svg); scope.layers = svgData.layers; svgDomElement.append('&lt;svg-layer ng-repeat="layer in layers"&gt;&lt;/svg-layer&gt;'); element.append($compile(svgDomElement)(scope)); scope.$on("$destroy", function() { scope.$$watchers = null; scope.$$listeners = null; }) } }; }]) A workaround is to manually delete watchers and listeners as you can see above - what is no good solution I think! When new data from the server arrives, it is set like this: $scope.model = model; $scope.$digest(); Is it a problem to just replace the model data? Is there any idea how it can happen that angular does not remove listeners on old elements? Angular should delete all the watchers when ng-repeat receives new data and rebuilds all elements.
has comment: http://stackoverflow.com/comment/38909744
has answer: http://stackoverflow.com/a/28723692
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/51891073
tagged with: angularjs
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/38927418
has comment: http://stackoverflow.com/comment/38936135
has title: Memory Leak: Remaining elements in cache and data_user in AngularJs
score: 7
upvote count: 7

http://stackoverflow.com/comment/38817112
comment on: http://stackoverflow.com/q/24971617
type: Comment
type: QuestionComment
has text: God, it worked! Just change this: `var str = ' Whatever #591118 ';`
score: 0

http://stackoverflow.com/comment/38753099
has text: This is also very close to what im looking for. I just need it to be something else than a prompt window. Maybe a dialog box
comment on: http://stackoverflow.com/a/24937680
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38827381
type: AnswerComment
has text: @Whymarrh whoops, it's a helper function. Code included in the edit.
score: 0
comment on: http://stackoverflow.com/a/24977155
type: Comment

http://stackoverflow.com/comment/39121166
type: Comment
has text: backgroundColorAlpha ! got it. should have gone through the whole docs, thanks for pointing this out
comment on: http://stackoverflow.com/a/25132079
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38961610
comment on: http://stackoverflow.com/a/25046569
score: 0
has text: The 1st transition wasn't working. After some tests I noticed that only the last one is applied, so instead of the 2 transitions I apply 1 transition to all the elements (transition: all .5s ease-out;).
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/39001445
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25068216
has text: with html 5 mode off, all the angular routes have a # in them e.g. `/#/whatever`. With html 5 mode on, it removes the # from all the routes e.g. `/whatever`. so your href values need to reflect that.
type: Comment

http://stackoverflow.com/q/25049953
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38965031
has title: TemplateUrl not working in Angular
has comment: http://stackoverflow.com/comment/38968066
has comment: http://stackoverflow.com/comment/38965030
answer count: 0
type: Question
tagged with: angularjs-directive
tagged with: javascript
score: 0
has body: I'm experimenting with Angular, and I just don't understand why my directive won't work on my computer. When I use 'template' in my directive, I get the result I want, but when I do the 'templateUrl' it just won't work. I even copied the code from this plunker: http://plnkr.co/edit/uCodR53Mdj5VDCN1ul9r?p=preview These are my files, all under the same folder with no sub folders --index.html-- Example - example-example81-production directive goes here: angular loaded if 3: {{1+2}} --my-customer.html-- Name: {{customer.name}} Address: {{customer.address}} --script.js-- angular.module('docsRestrictDirective', []) .controller('Controller', ['$scope', function($scope) { $scope.customer = { name: 'Naomi', address: '1600 Amphitheatre' }; }]) .directive('myCustomer', function() { return { restrict: 'E', templateUrl: 'my-customer.html' }; }); Help! This is driving me crazy :'(

http://stackoverflow.com/q/25031494
has body: How can I disable inline editing mode while I click on any row in jqGrid.? onSelectRow: function(id) { $("#toolbar").setColProp('mt_desc',{editable:false}); }, I got this one solution. but I think it's not feasible to add for every column name and add them into function. Whenever I click on edit button in actions, at that time Inline mode should be enable otherwise It must be disable. How can I do this? Can anybody please help me ?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25485840
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/25485840
type: AnsweredQuestion
has title: Disable inline editing for full grid in jqGrid
tagged with: jqgrid
type: Question

http://stackoverflow.com/q/24960242
score: 0
has comment: http://stackoverflow.com/comment/38798480
answer count: 2
has comment: http://stackoverflow.com/comment/38797935
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38796635
possible better answer: http://stackoverflow.com/a/24960620
has answer: http://stackoverflow.com/a/24960620
has answer: http://stackoverflow.com/a/24963169
has comment: http://stackoverflow.com/comment/38801198
has comment: http://stackoverflow.com/comment/38798050
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38796140
has comment: http://stackoverflow.com/comment/38796277
has body: I have a simple select dropdown I would like to populate from json data. When I hardcoded the json data as embedded javascript, it works, but when I try to use JQuery's getJSON callback to retrieve the data, it does not populate the select. I've checked that the web url works and returns proper json result, I believe I'm not calling it in the right order or something. I've tried searching and many give examples which I tried, e.g. assigning the json result to a global variable. HTML below: &lt;select data-bind="options: options, optionsText: 'name', optionsValue: 'name'"&gt;&lt;/select&gt; JS (which works with embedded jsondata) below: var jsdata = [{"id":1,"name":"Fruits","products":[{"id":1,"name":"Banana","price":0.99,"catid":1},{"id":2,"name":"Apple","price":0.49,"catid":1},{"id":3,"name":"Orange","price":0.69,"catid":1}]},{"id":2,"name":"Beverage","products":[{"id":4,"name":"Coca Cola","price":1.99,"catid":2},{"id":5,"name":"Dr. Pepper","price":1.89,"catid":2},{"id":6,"name":"Sprite","price":1.79,"catid":2},{"id":7,"name":"Mountain Dew","price":1.69,"catid":2},{"id":8,"name":"7-Up","price":1.59,"catid":2}]}, {"id":3,"name":"test","products":[]}]; var ViewModel = function (js) { var self = this; self.json = js; self.options = ko.toJS(js); } var vm = new ViewModel(jsdata); ko.applyBindings(vm); The jsfiddler is @ http://jsfiddle.net/psteele/7vcqX/# Tried using getJSON instead but didn't work: $.getJSON("url-to-data", null, function(data) { var ViewModel = function (js) { var self = this; self.json = js; self.options = ko.toJS(js); } var vm = new ViewModel(data); ko.applyBindings(vm); }); Also tried: var globaljson; $.getJSON("url-to-data", null, function(data) { globaljson = data; }); var ViewModel = function (js) { var self = this; self.json = js; self.options = ko.toJS(js); } var vm = new ViewModel(globaljson); ko.applyBindings(vm);
type: Question
has comment: http://stackoverflow.com/comment/38796910
accepted answer: http://stackoverflow.com/a/24963169
tagged with: http://stackoverflow.com/tag/json
tagged with: knockout.js
has title: JQuery Knockout - Assign json data to select options

http://stackoverflow.com/a/24961470
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/24961056
downvote count: 0
type: AcceptedAnswer
has body: The issue comes from sinon.js with jQuery 2.1 : https://github.com/cjohansen/Sinon.JS/issues/510 jQuery 2.1 makes synchronous ajax request like this : var req = new XMLHttpRequest(); req.open('POST', '/some/test', false); req.setRequestHeader('Content-Type', 'application/json'); req.onload = function() { console.log('success'); }; req.onerror = function() { console.log('error'); }; req.send(JSON.stringify({ test : 'test' })); The problem is Sinon doesn't trigger the onload or the onerror callback for a synchronous request. The issue is in the method setResponseBody of FakeXMLHttpRequest. You can find this code : if (this.async) { this.readyStateChange(FakeXMLHttpRequest.DONE); } else { this.readyState = FakeXMLHttpRequest.DONE; } In recent browsers, XmlHttpRequest trigger the callbacks even for a synchronous request. So this code should be modified in this : if (!this.async) { this.readyState = FakeXMLHttpRequest.DONE; } this.readyStateChange(FakeXMLHttpRequest.DONE); If you patch sinon.js like that, everything works.
score: 4
accepted answer of: http://stackoverflow.com/q/24961056

http://stackoverflow.com/comment/38898239
type: Comment
comment on: http://stackoverflow.com/q/25014817
score: 0
has text: @Rituraj ratan I understand it, but trying to find right solution
type: QuestionComment

http://stackoverflow.com/q/25060308
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: fancybox
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25060934
upvote count: 1
tagged with: php
type: AnsweredQuestion
has title: fancy box problems with dynamic gallery being opened from single hyper link for each gallery
score: 1
accepted answer: http://stackoverflow.com/a/25060934
type: Question
has body: I've setup a fancybox gallery on my page. I have a requirement such that there are thumbnails of image of particular category, but when someone taps that thumbnail they should be show with images in that category in fancy box. So for that what I'm doing is on page load i've populated javascript array for various categories with values of their sub images in their associated variable. My code is : Inside my body element I have various links as : Click Now this tags are set in such a way that each one of them will have same class only their id's will vary. When any one of the is clicked I am fetching the id by this.id But when I do so it gives me error like this in error console : GET http://localhost/myproject/cat1 404 (Not Found) but instead of using cat_gallery_id as the first attribute passed to fancybox function if I pass the same variable statically like $.fancybox(cat1, { the fancybox works perfectly fine. I am sure I am doing something wrong with basic assignment of value after getting from this.id Any help will be appreciated. Thanks in advance.
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38810295
has text: check to put console.log() before this line. $('.works-content .gallery').append($(this));
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24967974
type: QuestionComment

http://stackoverflow.com/comment/38956147
comment on: http://stackoverflow.com/a/25045283
has text: What about functions? Does it do it by reference?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24981253
tagged with: google-api
tagged with: oauth-2.0
tagged with: php
answer count: 1
has answer: http://stackoverflow.com/a/24991610
has body: I find it confusing that when i first tried the google api in a php environment, it required me to use a "client secret" key which i got via the api console. In the Javascript api examples is no such key needed, and I understand that if it would be there, the code would no longer be secret. Is there any reason why google still requires the key in php code? Are there differents between the JS and PHP api, are there things that can only be done in PHP?
type: AnsweredQuestion
has title: Why does the Google API for PHP requires a Client Secret while the one for Javascript does not?
accepted answer: http://stackoverflow.com/a/24991610
tagged with: javascript
type: Question
tagged with: oauth2client
score: 0

http://stackoverflow.com/comment/38889775
has text: @LavenderBlue Scripts are parsed when a script tag is met. If there's not `src` attribute within a script tag, parser assumes to find the text for the script between tags. If there is an `src` attribute, the script will be loaded, and the content between tags are ignored. Also, scripts are immutable, you can't change the content of an once-parsed script. If you want to load a script with a delay, you have to create a new script tag and set its `src`.
type: QuestionComment
comment on: http://stackoverflow.com/q/25005940
score: 0
type: Comment

http://stackoverflow.com/comment/38800260
score: 0
type: Comment
type: QuestionComment
has text: @Sebas Edited above with div function.
comment on: http://stackoverflow.com/q/24962333

http://stackoverflow.com/a/24918694
answers question: http://stackoverflow.com/q/24918526
type: Answer
score: 0
has body: Just add something to track the last resize event values: var windowSize = (function () { var lastWidth = 0, lastHeight = 0; window.addEventListener('resize', function (data) { // do something with last values ... console.log(lastWidth); console.log(lastHeight); ... lastWidth = window.innerWidth; lastHeight = window.innerHeight; }); return { width: lastWidth, height: lastHeight }; })(); Now, you can use the windowSize object outside the closure to find what the current window size is, and internally within the closure you can act upon the previous size of the window before updating lastWidth and lastHeight. Hope this helps!

http://stackoverflow.com/comment/38861969
has text: Thank you, I fixed it. Just changed vw to 60 and 60 :)
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24994953

http://stackoverflow.com/comment/38999003
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25068126
has text: $('div') gets all divs? or do you mean you want all divs where it doesn't have an id
type: Comment

http://stackoverflow.com/a/25050265
score: 0
type: Answer
has body: Your viewPort function doesn't return a value. It is essentially a no-op. It declares two local variables, but those variables are not accessible by the rest of the script. To return a value, use a single return statement at the end of the function body. You probably want to delete the height calculation since you're not using it, and return the result of the width calculation ("return w;"). Then you should rename the function to something appropriate like "getViewportWidth". Additionally, when you call this function, you attempt to access a property called "width" on its return value. This will result in an error, causing your page to malfunction. Once your function is simply returning the viewport width, you can remove this property references so that you're just comparing the returned value with 600 ("getViewportWidth() >= 600").
answers question: http://stackoverflow.com/q/25050196

http://stackoverflow.com/a/25059296
has body: Given the following JSON var json = { "welcomeList": ["Thanks for coming", "Please select from the following list", "dwadwadsds"], "endList": ["Press come again", "Press 0"] }; Using this script you can loop through each value of welcomeList and create an input $.each(json.welcomeList, function (_, vv) { $('#p_scents > p:first-child').clone().find('input').val(vv).end().append('Remove').appendTo('#p_scents'); }); FIDDLE: http://jsfiddle.net/Spokey/tZPg4/11004/ Explanation below $.each(json.welcomeList, function (_, vv) { $('#p_scents > p:first-child').clone() // make a duplicate of the first // find the input and change its value, .end() will go back to the selector .find('input').val(vv).end() // append the remove button to the .append('Remove') // append the whole to the .appendTo('#p_scents'); }); EDIT: For a more specific use. I also changed the ID to class. $.each(json.welcomeList, function (_, vv) { $(' Remove ').appendTo('#p_scents'); }); http://jsfiddle.net/Spokey/tZPg4/11006/ To get an alert with all values from the JSON alert(json.welcomeList.join(','));
upvote count: 2
has comment: http://stackoverflow.com/comment/38982007
type: Answer
has comment: http://stackoverflow.com/comment/38982691
has comment: http://stackoverflow.com/comment/38983064
score: 2
has comment: http://stackoverflow.com/comment/38983294
has comment: http://stackoverflow.com/comment/38981862
has comment: http://stackoverflow.com/comment/38982452
has comment: http://stackoverflow.com/comment/38983157
has comment: http://stackoverflow.com/comment/38983142
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25058451
has comment: http://stackoverflow.com/comment/38981989
answers question: http://stackoverflow.com/q/25058451
has comment: http://stackoverflow.com/comment/38983097

http://stackoverflow.com/comment/38901484
comment on: http://stackoverflow.com/a/25013308
type: Comment
has text: You have to implement the code that SETS on your admin domain and then you have to implement the code that GETS on the client's domain. Both should be reading a flat-file, I recommend `$domain.'^^'.$ip.'^^'.$time` in the flat-file, `explode` the '^^' characters (if using PHP) and assign the variables. It should take an experienced programmer about an hour to two hours, longer for less experienced though it reduces the chances of signing in on a non-SSL site and thus helps strengthen your security if implemented and **used** correctly.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39218481
type: AnswerComment
comment on: http://stackoverflow.com/a/25002821
type: Comment
has text: To extend my previous question, it seems as I update the IsNew() property on some of my elements, it does not trigger these statements to re-evaluate. Do you have an explanation for why that may be?
score: 0

http://stackoverflow.com/q/25067974
type: Question
has title: How to deal with JavaScript Error: "e is null" when try to click on browser pop-up in Firefox
tagged with: selenium-webdriver
tagged with: watir-webdriver
has answer: http://stackoverflow.com/a/26125296
upvote count: 7
has answer: http://stackoverflow.com/a/25116169
tagged with: testing
has comment: http://stackoverflow.com/comment/40731359
has comment: http://stackoverflow.com/comment/39032973
has body: When using the alert methods of selenium-webdriver, I encountered the JavaScript Error: "e is null" Code: browser = Watir::Browser.new :firefox browser.alert.ok; sleep 5 Error: Selenium::WebDriver::Error::UnknownError: [JavaScript Error: "e is null" {file: "file:///var/folders/f4/rz3xgqkj22zdyldyzrnyx4v40000gn/T/webdriver-profile20140731-47367-tyngix/extensions/fxdriver@googlecode.com/components/command_processor.js" line: 7716}]' [JavaScript Error: "e is null" {file: "file:///var/folders/f4/rz3xgqkj22zdyldyzrnyx4v40000gn/T/webdriver-profile20140731-47367-tyngix/extensions/fxdriver@googlecode.com/components/command_processor.js" line: 7716}]' when calling method: [nsICommandProcessor::execute] Environment: 'selenium-webdriver', '2.42.0' Firefox 31.0 MAC 10.9 Ruby 2.0 Any advice would be very much appreciated. Thanks!
answer count: 4
has comment: http://stackoverflow.com/comment/40690631
has comment: http://stackoverflow.com/comment/39108579
tagged with: firefox
downvote count: 0
has comment: http://stackoverflow.com/comment/39141153
tagged with: javascript
type: UnansweredQuestion
score: 7
has answer: http://stackoverflow.com/a/27142157
favorite count: 0
has answer: http://stackoverflow.com/a/25068274

http://stackoverflow.com/comment/40831335
has text: well i went for simple method
type: Comment
comment on: http://stackoverflow.com/a/25059110
type: AnswerComment
score: 0

http://stackoverflow.com/a/25066095
has body: $('td').click(function(){ var parent = $(this).closest('tr').attr('id'); });
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25034661
answers question: http://stackoverflow.com/q/25034661

http://stackoverflow.com/q/24971286
has answer: http://stackoverflow.com/a/24971329
score: 0
has title: Alerting lat/lon value on Bing Map programmatically using JavaScript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/24971329
type: AnsweredQuestion
has body: Running javascript: alert(document.getElementById('srchssubTitle').value) at http://www.bing.com/maps/#Y3A9NTIuMDYzNjAyfi0wLjc3Nzg5NCZsdmw9MTUmc3R5PXImZW89MCZxPU1LMyUyMDVKRQ== returns me an unidentified value message, even though I've checked the page source code and found that I referring to the correct id 51.990376,-0.761363. How do I get JavaScript to properly echo this value?
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/24928016
accepted answer of: http://stackoverflow.com/q/24926680
answers question: http://stackoverflow.com/q/24926680
score: 8
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38735536
type: Answer
has body: There are several libraries on github enabling this: https://github.com/web-audio-components/simple-reverb https://github.com/Dinahmoe/tuna What they eventually do, is using the AudioContext api to create a convolver(which is also an option if you dont want to use the libraries). The principle is: 1.)Load the file via Ajax, get the response, and use AudioContext.decodeAudioData saved to a variable. 2.)Create an audio context, and instead connecting it straight to .destination, add a a convolver using the .createConvolver() The audioContext api documentation would help you a lot: https://developer.mozilla.org/en-US/docs/Web/API/AudioContext.createConvolver
upvote count: 8
has comment: http://stackoverflow.com/comment/38741602

http://stackoverflow.com/q/25046386
answer count: 1
accepted answer: http://stackoverflow.com/a/25046513
tagged with: angularjs-directive
tagged with: javascript
tagged with: dom-events
score: 6
has title: Shift click to add value to object without using angular directive
has answer: http://stackoverflow.com/a/25046513
type: AnsweredQuestion
has body: In HTML file: ... Apple Banana Coconut ... Controller: ... $scope.addFruit = function(fruitName) { $scope.fruitObject.name = fruitName; }; $scope.fruitObject = { name: '', } So, if I click the link in the HTML file, it changes fruitObject.name. I want to add the function that if I click the link with shift key, the value will be added to the fruitObject: $scope.fruitObject = { name: ['Apple', 'Banana'] } Can I do this without using a angular directive? And if I can/can't, could you write an example code? JSFiddle: http://jsfiddle.net/6QcEc/
favorite count: 0
upvote count: 8
tagged with: angularjs
type: Question
has comment: http://stackoverflow.com/comment/38958175
downvote count: 2

http://stackoverflow.com/comment/38867389
has text: a bunch of integers for the value, some random text for the context
type: AnswerComment
comment on: http://stackoverflow.com/a/24998267
type: Comment
score: 0

http://stackoverflow.com/comment/38804723
comment on: http://stackoverflow.com/a/24965024
type: AnswerComment
has text: You make a lot of sense. Thanks. But the problem is , I see this in my console and I cannot click it. [see edit in my question] Why? Thanks again
type: Comment
score: 0

http://stackoverflow.com/q/24942435
tagged with: php
has answer: http://stackoverflow.com/a/24943039
has comment: http://stackoverflow.com/comment/38765720
has comment: http://stackoverflow.com/comment/38802323
downvote count: 3
has comment: http://stackoverflow.com/comment/38764822
type: Question
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38762706
linked to: http://stackoverflow.com/q/24961559
has body: There is this case. I have many files(data) in the server. I use Ajax and php for Client browser to get the data from the server. When a person opens a website and accesses a file from the server, at the same time, if another person(user) open this website, I want to find a way to detect that file is open, if so, I can load a different file or just block this user. How can I do this, any suggestion is appreciated, thanks for your time! Ajax get the file load: function (url) { var _this = this; $.ajax({ type: "GET", url: url, dataType: "text", success: function (json) { if (typeof json == 'string' || json instanceof String) { json = JSON.parse(json); _this.parse(json); } } }); },
has title: Ajax Php get file from server, how to detect the file is open
tagged with: javascript
tagged with: jquery
tagged with: ajax
has comment: http://stackoverflow.com/comment/38762810
favorite count: 0
has comment: http://stackoverflow.com/comment/38767106
has comment: http://stackoverflow.com/comment/38763864
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/6341196
score: -3

http://stackoverflow.com/comment/38974214
has text: "Does it can access" conveys no meaning according to the rules of the English language. If you are curious whether or not the function can access the aforementioned value, write "can it access ...?".
type: Comment
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/25055086

http://stackoverflow.com/q/24925509
has comment: http://stackoverflow.com/comment/38730563
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38730410
has comment: http://stackoverflow.com/comment/38730541
tagged with: codeigniter
has answer: http://stackoverflow.com/a/24925673
type: Question
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: Uncaught TypeError: undefined is not a function initslider-1.js:1 (anonymous function) AmazingSlider
has body: I have gone through the other posts also. But I didn't get any solution finally I have my own question. I am trying to add Jquery image slider into my project, I am using Codeigniter Platform as I am running this slider stand alone it is working fine. But not in CI it throws error Uncaught TypeError: undefined is not a function initslider-1.js:1 (anonymous function). Anybody will suggest me any help. see following are the js files which I am including. Click here to see the ref.
has answer: http://stackoverflow.com/a/24927348

internet-explorer-9
tag name: internet-explorer-9
tags question: http://stackoverflow.com/q/24910432
tags question: http://stackoverflow.com/q/24928320
tags question: http://stackoverflow.com/q/25047438
type: Tag
tags question: http://stackoverflow.com/q/24948608

http://stackoverflow.com/comment/38817051
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24951256
has text: Also, FYI, `(\w|\d)` is redundant -- `\w` will match digits. I would suggest you test your regex at http://regex101.com/ or https://www.debuggex.com/, which will explain how the regex works and help you understand them better.

http://stackoverflow.com/comment/39000767
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25068994
type: AnswerComment
has text: is that related with name?

http://stackoverflow.com/tag/html
tags question: http://stackoverflow.com/q/24930465
tags question: http://stackoverflow.com/q/24982941
tags question: http://stackoverflow.com/q/24993978
tags question: http://stackoverflow.com/q/24950997
tags question: http://stackoverflow.com/q/24938087
tags question: http://stackoverflow.com/q/25003618
tags question: http://stackoverflow.com/q/24922639
tags question: http://stackoverflow.com/q/24918578
tags question: http://stackoverflow.com/q/25037274
tags question: http://stackoverflow.com/q/24980253
tags question: http://stackoverflow.com/q/25050798
tags question: http://stackoverflow.com/q/25016714
tags question: http://stackoverflow.com/q/25027547
tags question: http://stackoverflow.com/q/24991281
tags question: http://stackoverflow.com/q/24988512
tags question: http://stackoverflow.com/q/25032905
tags question: http://stackoverflow.com/q/24982179
tags question: http://stackoverflow.com/q/25052081
tags question: http://stackoverflow.com/q/24934343
tags question: http://stackoverflow.com/q/24944276
tags question: http://stackoverflow.com/q/25013968
tags question: http://stackoverflow.com/q/24980377
tags question: http://stackoverflow.com/q/25037695
tags question: http://stackoverflow.com/q/24973894
tags question: http://stackoverflow.com/q/24919680
tags question: http://stackoverflow.com/q/25027992
tags question: http://stackoverflow.com/q/25066052
tags question: http://stackoverflow.com/q/24976039
tags question: http://stackoverflow.com/q/24909235
tags question: http://stackoverflow.com/q/25067756
tags question: http://stackoverflow.com/q/25044754
tags question: http://stackoverflow.com/q/24925853
tags question: http://stackoverflow.com/q/25018812
tags question: http://stackoverflow.com/q/24975475
tags question: http://stackoverflow.com/q/24961196
tags question: http://stackoverflow.com/q/25003472
tags question: http://stackoverflow.com/q/25038562
tags question: http://stackoverflow.com/q/24921403
tags question: http://stackoverflow.com/q/24941748
tags question: http://stackoverflow.com/q/24940267
tags question: http://stackoverflow.com/q/25035296
tags question: http://stackoverflow.com/q/24978505
tags question: http://stackoverflow.com/q/24980888
tags question: http://stackoverflow.com/q/24961668
tags question: http://stackoverflow.com/q/24990764
tags question: http://stackoverflow.com/q/24988939
tags question: http://stackoverflow.com/q/24933912
tags question: http://stackoverflow.com/q/24949271
tags question: http://stackoverflow.com/q/24931867
tags question: http://stackoverflow.com/q/25007928
tags question: http://stackoverflow.com/q/24926028
tags question: http://stackoverflow.com/q/25020016
tags question: http://stackoverflow.com/q/24948581
tags question: http://stackoverflow.com/q/25039607
tags question: http://stackoverflow.com/q/25039256
tags question: http://stackoverflow.com/q/24992685
tags question: http://stackoverflow.com/q/25022302
tags question: http://stackoverflow.com/q/25035281
tags question: http://stackoverflow.com/q/25047088
tags question: http://stackoverflow.com/q/25023170
tags question: http://stackoverflow.com/q/25013408
tags question: http://stackoverflow.com/q/25011615
tags question: http://stackoverflow.com/q/25058992
tags question: http://stackoverflow.com/q/24957315
tags question: http://stackoverflow.com/q/24961114
tags question: http://stackoverflow.com/q/24910340
tags question: http://stackoverflow.com/q/24968481
tags question: http://stackoverflow.com/q/24991737
tags question: http://stackoverflow.com/q/24918488
tags question: http://stackoverflow.com/q/24956200
tags question: http://stackoverflow.com/q/24957434
tags question: http://stackoverflow.com/q/25052379
tags question: http://stackoverflow.com/q/24963024
tags question: http://stackoverflow.com/q/25033611
tags question: http://stackoverflow.com/q/25052584
tags question: http://stackoverflow.com/q/24925109
tags question: http://stackoverflow.com/q/24975390
tags question: http://stackoverflow.com/q/25014980
tags question: http://stackoverflow.com/q/24976982
tags question: http://stackoverflow.com/q/24926738

http://stackoverflow.com/a/25012997
answers question: http://stackoverflow.com/q/25007984
score: 2
downvote count: 0
has body: Right now the Developer Terms of Use forbid monetisation either directly or via adverts for applications that stream audio. The Developer ToS can be found here. Also, the Play Button widget doesn't work on mobile platforms like Blackberry - it requires a desktop machine as it remote controls either the Web Player or Desktop client. Additionally, although not part of your question — your app looks like a direct copy of Spotify's own UI. In general, this isn't a good idea. This isn't a threat per se, but it's close enough to potentially look like an "official" client, which is also forbidden by the ToS.
has comment: http://stackoverflow.com/comment/38900473
type: Answer
upvote count: 2

http://stackoverflow.com/q/25039205
favorite count: 0
has comment: http://stackoverflow.com/comment/38944945
accepted answer: http://stackoverflow.com/a/25040955
has comment: http://stackoverflow.com/comment/38944613
type: AnsweredQuestion
has body: So I am trying to get transit directions from the Google Directions API, storing the steps in an array so I can see which transit lines are being used. I know the service is accepting my API key as it successfully creates the LatLng objects, which wouldn't be happening if my script tag wasn't correct. However in debugging I have determined that the route() function is simply not executing, or the callback function is failing to execute. I will comment in the results of my debugging: startPnt = new google.maps.LatLng(32.741480, -96.853803); endPnt = new google.maps.LatLng(32.921941, -96.735327); var request = { origin: startPnt, destination: endPnt, travelMode: google.maps.TravelMode.TRANSIT, provideRouteAlternatives: false //*typo spotted here, was formerly provideRoutesAlternatives.* }; window.alert(request.origin.lat()); //executed successfully var stepResults = new Array(); window.alert(stepResults.length); //executed successfully var dService = new google.maps.DirectionsService(); dService.route(request, function(results, status){ window.alert("The function inside dService.route() is running"); /*did not execute*/ if(status==google.maps.DirectionsStatus.OK) { window.alert("Success"); /*did not execute */ stepResults = results.routes[0].legs[0].steps; /*in original code, this DOM/JSON typo was preventing the callback function from running. The typo had left out "results"*/ } if(status==google.maps.DirectionsStatus.INVALID_REQUEST) { window.alert("Invalid request."); } if(status==google.maps.DirectionsStatus.OVER_QUERY_LIMIT) { window.alert("Google has stopped accepting queries from this key for today.");//did not execute } if(status==google.maps.DirectionsStatus.UNKNOWN_ERROR) { window.alert("Google servers encountered an unexpected error. Try again momentarily."); //did not execute } else window.alert("Not success."); //did not execute } ); This code did work once, but I ran it again after tweaking the data acquisition and route() had quit working. I can't figur…
score: 0
upvote count: 1
downvote count: 1
type: Question
has title: Why won't directionsService.route() execute in this case?
has comment: http://stackoverflow.com/comment/38944174
has answer: http://stackoverflow.com/a/25040955
tagged with: javascript
has comment: http://stackoverflow.com/comment/38945117
tagged with: directions
has comment: http://stackoverflow.com/comment/38944099
tagged with: google-maps
answer count: 1

http://stackoverflow.com/a/24987849
score: 1
has comment: http://stackoverflow.com/comment/38985852
answers question: http://stackoverflow.com/q/24987737
has comment: http://stackoverflow.com/comment/38985104
has body: find returns a promise, so you need to wait for it to resolve before you can use it. Additionally you should use pushObject so that Ember is aware you've added a new item to the array. export default Ember.Controller.extend({ columns:[[],[],[]], setupColumns: function(){ var eventsPromise = this.store.find('event'), columns = [[],[],[]], count = 0, self = this; eventsPromise.then(function(events){ events.forEach(function(item, index, enumerable){ columns[count].pushObject(item); count++; if (count === 4){ count = 0; } }); self.set('columns', [{column: columns[0]}, {column: columns[1]}, {column: columns[2]}]); }); }.on('init') }); Honestly you should resolve the model before the controller (in the route), it would make this significantly easier.
accepted answer of: http://stackoverflow.com/q/24987737
has comment: http://stackoverflow.com/comment/38902635
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38906842
type: Answer

http://stackoverflow.com/comment/38953017
comment on: http://stackoverflow.com/a/25043662
has text: No change It is working perfectly, but onmouseover, its changing only once. How can onmouseover works multiple times? I mean when ever text arrays changed
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/69420011
score: 0
type: Comment
type: QuestionComment
has text: You can indeed. I created one but there is a problem with the CORS restrictions. http://codepen.io/www139/pen/oLrJAZ?editors=0010
comment on: http://stackoverflow.com/q/25028176

http://stackoverflow.com/q/25041068
tagged with: ajax
accepted answer: http://stackoverflow.com/a/25041140
downvote count: 0
answer count: 1
has title: Rails AJAX delete functionality working but not removing itself until refreshed
favorite count: 0
upvote count: 2
tagged with: ruby-on-rails
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25041140
type: Question
tagged with: javascript
tagged with: jquery
has body: I'm trying to delete using AJAX with :remote => true on my link_to The delete is working fine, getting 200 response, and when page is refreshed item is no longer there. [30/Jul/2014 11:26:57] "DELETE /credit_cards/12198 HTTP/1.1" 200 - 0.2106 I need it to happen dynamically, when button is clicked the column is removed. My views, this is located in app/views/spree/checkout/payment .cc-expiration.two.columns.alpha.omega %span.mobile-heading.em = link_to (image_tag("icons/delete.png")), spree.credit_card_url(card), :remote =&gt; true, :method =&gt; :delete, :confirm =&gt; 'Are you sure?', :class =&gt; 'delete_card' Controller: def destroy @card = Spree::CreditCard.find(params["id"]) @card.destroy respond_to do |format| format.html { redirect_to credit_cards_url } format.json { head :no_content } format.js { render :layout =&gt; false } end end And finally my destroy.js.erb, located in app/views/spree/credit_cards $('.delete_card').bind('ajax:success', function() { $(this).closest('column').fadeOut(); }); Any help would be greatly appreciated, thank you so much!

http://stackoverflow.com/comment/38841583
comment on: http://stackoverflow.com/a/24979193
score: 0
type: AnswerComment
type: Comment
has text: Your suggestion did work, there was one other thing to be done. As the controller is coming via an AJAX call, it had to bind lazily using `$controllerProvider`. Thanks for your help!!!

session
tags question: http://stackoverflow.com/q/25030454
tags question: http://stackoverflow.com/q/24915581
tags question: http://stackoverflow.com/q/25019558
tags question: http://stackoverflow.com/q/24912408
tags question: http://stackoverflow.com/q/24909377
type: Tag
tags question: http://stackoverflow.com/q/24979376
tags question: http://stackoverflow.com/q/24920161
tags question: http://stackoverflow.com/q/25061731
tag name: session
tags question: http://stackoverflow.com/q/24911902
tags question: http://stackoverflow.com/q/25008845

http://stackoverflow.com/a/24911548
has body: Bundling and minification is actually a new feature of ASP.Net 4.5 You can see it by creating a new ASP.Net MVC 4 web application using visual studio and you use the Web Application template, it creates a Bundle Config Class, that probably does what you want: public class BundleConfig { // For more information on Bundling, visit http://go.microsoft.com/fwlink/?LinkId=254725 public static void RegisterBundles(BundleCollection bundles) { bundles.Add(new ScriptBundle("~/bundles/jquery").Include( "~/Scripts/jquery-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include( "~/Scripts/jquery-ui-{version}.js")); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( "~/Scripts/jquery.unobtrusive*", "~/Scripts/jquery.validate*")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. bundles.Add(new ScriptBundle("~/bundles/modernizr").Include( "~/Scripts/modernizr-*")); bundles.Add(new StyleBundle("~/Content/css").Include("~/Content/site.css")); bundles.Add(new StyleBundle("~/Content/themes/base/css").Include( "~/Content/themes/base/jquery.ui.core.css", "~/Content/themes/base/jquery.ui.resizable.css", "~/Content/themes/base/jquery.ui.selectable.css", "..." } } This bundle config class must be called on the Application_Start() method: BundleConfig.RegisterBundles(BundleTable.Bundles);
type: Answer
answers question: http://stackoverflow.com/q/24911155
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/a/24984687
score: 0
has body: You can do this when you assign the json definition to an object like this var data = {"store":{"products":[{"type":"TableSaw","description":"Really cool saw, should buy it ","price": "20.99"}]}}; All you need to do is to test the type of the description and the price elements if they don't exist you make the array products empty like this : if( typeof(data.store.products[0].desctiption) == 'undefined' || typeof(data.store.products[0].price) == 'undefined') data.store.products = [];
answers question: http://stackoverflow.com/q/24984608
has comment: http://stackoverflow.com/comment/38842121
type: Answer

http://stackoverflow.com/comment/38846213
type: Comment
comment on: http://stackoverflow.com/a/24976194
has text: No worries glad you got it up and running.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38884544
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25007507
has text: edit: I will add the code to the main section in a second I am not sure what it is.

http://stackoverflow.com/q/25038637
has answer: http://stackoverflow.com/a/25038921
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/63475988
has body: In my rails 3.2.17 application, i have a delete button: &lt;%= link_to 'Delete', destroy_item_path(@item), method: :delete, data: { confirm: "Do you confirm?"}, id: "a_delete" %&gt; I need to perform some javascript code after the item has been deleted, or better: after the user has confirmed to delete the item. Naively, i added an id to the anchor and I bound an click listener: $("#a_delete").click(function() { //Has the user confirmed or canceled the operation? } ); But how can i know what is the user choice? I've checked the https://github.com/rails/prototype-ujs but I didn't figure out how and even if this can be done.
score: 1
upvote count: 1
tagged with: ruby-on-rails
type: Question
has answer: http://stackoverflow.com/a/25038837
tagged with: javascript
answer count: 3
has title: rails and javascript, know if the user has confirmed a dialog
tagged with: unobtrusive-javascript
downvote count: 0

http://stackoverflow.com/q/25061547
has title: html input displays different text to value that it posts
tagged with: http://stackoverflow.com/tag/html
tagged with: input
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25061699
downvote count: 0
tagged with: codeigniter
accepted answer: http://stackoverflow.com/a/25061610
possible better answer: http://stackoverflow.com/a/25061699
type: Question
score: 14
has answer: http://stackoverflow.com/a/25061610
has body: I am feeling really stupid and not sure if doing something really dumb what... so excuse me in advance. I have the following HTML: &lt;input type="text" value="0" name="pcscubes" id="pcscubes"&gt; I have the below jquery syntax: var cubes=123.2; $("#pcscubes1").val(cubes); var test=$("#pcscubes1").val(); alert(test); When the jquery executes, the input box will display 123.2 and the alert will be 123.2. if you inspect the html object though, the value is still 0? so the display of the input is different from what the real value is. so when I submit this form it posts 0 rather than 123.2 Now I have built a whole web app with this syntax and works perfectly. today it just stops working? I have restarted browser, checked old code that was working, logged off and on and still it does the same. web app obviously has jquery loaded and jquery ui on this form. using codeigniter? any ideas as I am banging my head over something so stupid.... Out of interest I created the below fiddle and it is doing the same? http://jsfiddle.net/49nqU/ why is the value 0 when it is showing 123.2? Thanks as always,
answer count: 2
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 14

browserify
tags question: http://stackoverflow.com/q/24999068
tags question: http://stackoverflow.com/q/24985962
tags question: http://stackoverflow.com/q/24986862
tags question: http://stackoverflow.com/q/25047891
tags question: http://stackoverflow.com/q/24992980
tag name: browserify
tags question: http://stackoverflow.com/q/24999744
type: Tag
tags question: http://stackoverflow.com/q/24971788
tags question: http://stackoverflow.com/q/24979799
tags question: http://stackoverflow.com/q/25016534

http://stackoverflow.com/a/25042136
score: 1
downvote count: 0
type: Answer
has body: Like so: function getArray(callback) { $.ajax({ ..//options success: function(data) { callback(data); } }); } function display(array) { console.log(array); } //call it! getArray(display);
upvote count: 1
answers question: http://stackoverflow.com/q/25042019

http://stackoverflow.com/comment/39350586
score: 0
has text: Hmm, okay, I was hoping for a d3, svg-based solution for my bounty. It would start `chart.selectAll('.bar').each(function(d) { ...` and append SVG elements. Guess I didn't offer a high enough bounty, but thanks anyway @elzi.
type: Comment
comment on: http://stackoverflow.com/a/25212888
type: AnswerComment

http://stackoverflow.com/comment/39395399
has text: I have tested, and worked with your image as well, and the output wasn't the one you have uploaded. Are you sure everything was well implemented to javascript? Could you post your javascript code? Maybe I can see the difference.
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25252446

http://stackoverflow.com/a/25103124
has body: The getKml method is available on all objects that inherit from the abstract KmlFeature. Calling this will give you a string representation of the KML that describes the feature. ie. var p = ge.createPlacemark(''); //create a placemark p.setName('foo'); // set the feature name console.log(p.getKml()); //get the feature kml
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25024504
score: 1

http://stackoverflow.com/a/25067235
score: 1
upvote count: 1
has body: You should add that to the POST URL and not the body: var arr = new Array(1,2,3,4); $.ajax({ type: 'POST', url: baseUrl + "search/simple_filter"+'&amp;count='+'second', data: {arr: arr}, success: function (data) { if (!data) console.log(data); } });
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25067173

http://stackoverflow.com/q/25053452
tagged with: http://stackoverflow.com/tag/html
tagged with: objective-c
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38972445
has title: Change file upload options provided by ios
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38971984
has comment: http://stackoverflow.com/comment/38973242
tagged with: ios
tagged with: javascript
has body: I am using below code to upload file from web view in ios. &lt;input type="file" accept="image/*"&gt; When I tap on this input tag it provides me options as Take Photo Choose existing photo cancel Now, what I want is to add new option in above list as delete/remove like: Take Photo Choose existing photo remove cancel Is this possible to achieve this either via javascript or objective-c?

http://stackoverflow.com/comment/38838107
type: QuestionComment
comment on: http://stackoverflow.com/q/24982897
score: 1
has text: Most likely you have a parse error. Change `dataType` to `text` and confirm the structure of the data being returned first.
type: Comment

http://stackoverflow.com/a/42540450
answers question: http://stackoverflow.com/q/24952433
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/88555002
has body: I was attempting to figure out how to set my first item in the Bootstrap Carousel: http://getbootstrap.com/javascript/#carousel To a class of "active" on page load, like this: &lt;div class="item active"&gt; And solved it by using the ngClass directive: https://docs.angularjs.org/api/ng/directive/ngClass To add an expression that determines whether the index is 0, and then sets the class to "active". Example: &lt;div class="item" ng-class="{{$index}} == 0 ? 'active' : ''" ng-repeat="image in $ctrl.images"&gt; This renders on the page as: &lt;div class="item ng-binding ng-scope active" ng-class="0 == 0 ? 'active' : ''" ng-repeat="image in $ctrl.images"&gt;
downvote count: 0

http://stackoverflow.com/comment/38969167
comment on: http://stackoverflow.com/q/25052369
type: QuestionComment
score: 0
has text: @ArunPJohny:I added from your comment it didn't work.
type: Comment

http://stackoverflow.com/a/24924048
has body: I've taken out the parameter from your sizeTbl method Then I'm getting the src property of the image (note I've given it an ID). Depending on the src we can show/hide the table and change the image property Here's a jsFiddle &lt;script language="JavaScript" type="text/javascript"&gt; &lt;!-- function sizeTbl() { var tbl = document.getElementById('tbl'); var icon = document.getElementById('toggle-table'); if (icon.src === 'down_arrow.png'){ tbl.style.display = 'block'; icon.src = 'up_arrow.png'; } else { tbl.style.display = 'none'; icon.src = 'down_arrow.png'; } } // --&gt; &lt;/script&gt; &lt;br&gt; &lt;a href="javascript:sizeTbl()"&gt;&lt;img src="down_arrow.png" id="toggle-table"&gt;&lt;/a&gt; You've added some extra requirements to your question. You've tagged jQuery and this is the easiest solution for this scenario. Remove the javascript:sizeTbl() from your &lt;anchor&gt; tag. This is known as inline JS and isn't recommended because it means you are mixing your presentation code with your business logic. You make the &lt;anchor&gt; tag act like a normal anchor tag and attach a click event in the document's ready event. function sizeTbl() { var tbl = document.getElementById('tbl'); var icon = document.getElementById('toggle-table'); if (icon.innerText === 'show') { tbl.style.display = 'block'; icon.innerText = 'hide'; } else { tbl.style.display = 'none'; icon.innerText = 'show'; } } $(document).ready(function(){ $('#sizeTbl').on('click', sizeTbl); }); I've created a new jsFiddle that demonstrates this. Notes: You need to be using jQuery for this to work Note that I've given the &lt;anchor&gt; tag an ID. This is so that I can locate it in code If you have any other comments, the etiquette on SO is to ask new questions. The answers get too long and complicated otherwise
type: Answer
has comment: http://stackoverflow.com/comment/38729213
score: 1
has comment: http://stackoverflow.com/comment/38755470
upvote count: 1
has comment: http://stackoverflow.com/comment/38877936
has comment: http://stackoverflow.com/comment/38729087
answers question: http://stackoverflow.com/q/24923912
downvote count: 0

http://stackoverflow.com/comment/38917499
has text: Offcourse its possible, but its not built in
comment on: http://stackoverflow.com/q/25017283
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38936875
type: AnswerComment
has text: Why would you need to remove the validation if your submitting the form as the next page load the validation won't be there.
type: Comment
comment on: http://stackoverflow.com/a/25034453
score: 0

http://stackoverflow.com/q/24993978
answer count: 4
possible better answer: http://stackoverflow.com/a/24994041
has answer: http://stackoverflow.com/a/25012684
has comment: http://stackoverflow.com/comment/38860989
has answer: http://stackoverflow.com/a/24994041
tagged with: javascript
has title: JavaScript - uncheck check box on mouseup
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38858955
tagged with: jquery
has comment: http://stackoverflow.com/comment/38858967
accepted answer: http://stackoverflow.com/a/25012684
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24994307
tagged with: checkbox
has comment: http://stackoverflow.com/comment/38858853
has comment: http://stackoverflow.com/comment/38861192
score: 0
has body: I'm trying to implement a simple 'show password' toggle check box so that whilst the mouse is held down, the plain text password is shown, and once it's let go it reverts back to a password field. I've got the toggle of the input field working, however I'm using a check box to show the toggle state as well, and I can check the box on mousedown however my attempt at then unchecking the box is not quite working. Here's what I've got so far; DEMO var pwi = $('#new_pass'); $('.pw_show').on('mousedown', function () { $('.pw_show input').prop('checked', true); pwi.prop('type', 'text'); }); $('.pw_show').on('mouseup', function () { pwi.prop('type', 'password'); setTimeOut(function() { $('.pw_show input').prop('checked', false); }, 50); }); This almost works, however if the user double clicks quickly then they can break it leaving the checkbox checked. Is there a better way to do this?
has answer: http://stackoverflow.com/a/24994057
has comment: http://stackoverflow.com/comment/38858689

http://stackoverflow.com/comment/38719199
type: QuestionComment
has text: Yeah, I thought so too, but it doesn't. The first is not an array, but I don't know how to dynamically add elements without making it an array.
type: Comment
comment on: http://stackoverflow.com/q/24919307
score: 0

http://stackoverflow.com/comment/38752063
has text: Please post your complete code, the JS or CSS used to hide / show the buttons is missing so we can not properly help.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24937127

http://stackoverflow.com/q/25005222
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25005323
upvote count: 9
has answer: http://stackoverflow.com/a/33328215
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25005239
has answer: http://stackoverflow.com/a/25005260
has comment: http://stackoverflow.com/comment/38880235
possible better answer: http://stackoverflow.com/a/33328215
score: 8
favorite count: 0
has answer: http://stackoverflow.com/a/25005289
answer count: 5
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25005239
has body: I'm trying to make a section of my site fadeIn after 5 seconds using the following: $('#topScroll').delay(5000).fadeIn(400); I can't seem to get it to work. Does this need to be hooked to an event? I see that doing the same with fadeOut works just fine with no event. Scroll I thought perhaps the div needed to be display:none first before it can fade in, but this doesn't seem to make a difference.
has title: Fade Out after .delay() of 5 seconds

jquery
tags question: http://stackoverflow.com/q/24972746
tags question: http://stackoverflow.com/q/24972949
tags question: http://stackoverflow.com/q/24932216
tags question: http://stackoverflow.com/q/24917058
tags question: http://stackoverflow.com/q/25065035
tags question: http://stackoverflow.com/q/25052325
tags question: http://stackoverflow.com/q/24910918
tags question: http://stackoverflow.com/q/24996565
tags question: http://stackoverflow.com/q/24983620
tags question: http://stackoverflow.com/q/24951484
tags question: http://stackoverflow.com/q/24981811
tags question: http://stackoverflow.com/q/24941390
tags question: http://stackoverflow.com/q/25029801
tags question: http://stackoverflow.com/q/24955811
tags question: http://stackoverflow.com/q/25001644
tags question: http://stackoverflow.com/q/24971511
tags question: http://stackoverflow.com/q/24994791
tags question: http://stackoverflow.com/q/24964390
tags question: http://stackoverflow.com/q/25048420
tags question: http://stackoverflow.com/q/25068795
tags question: http://stackoverflow.com/q/25011095
tags question: http://stackoverflow.com/q/25041068
tags question: http://stackoverflow.com/q/24973929
tags question: http://stackoverflow.com/q/25027311
tags question: http://stackoverflow.com/q/24957373
tags question: http://stackoverflow.com/q/24949541
tags question: http://stackoverflow.com/q/24973830
tags question: http://stackoverflow.com/q/24970416
tags question: http://stackoverflow.com/q/24998624
tags question: http://stackoverflow.com/q/25020059
tags question: http://stackoverflow.com/q/24967974
tags question: http://stackoverflow.com/q/25062515
tags question: http://stackoverflow.com/q/25009716
tags question: http://stackoverflow.com/q/25049680
tags question: http://stackoverflow.com/q/24911685
tags question: http://stackoverflow.com/q/24919470
tags question: http://stackoverflow.com/q/25064921
tags question: http://stackoverflow.com/q/25001041
tags question: http://stackoverflow.com/q/24948898
tags question: http://stackoverflow.com/q/24963043
tags question: http://stackoverflow.com/q/24960850
tags question: http://stackoverflow.com/q/24965595
tags question: http://stackoverflow.com/q/24932922
tags question: http://stackoverflow.com/q/25017263
tags question: http://stackoverflow.com/q/24992114
tags question: http://stackoverflow.com/q/24970778
tags question: http://stackoverflow.com/q/24924859
tags question: http://stackoverflow.com/q/24989926
tags question: http://stackoverflow.com/q/24994650
tags question: http://stackoverflow.com/q/24964743
tags question: http://stackoverflow.com/q/25005923
tags question: http://stackoverflow.com/q/25029771
tags question: http://stackoverflow.com/q/24952682
tags question: http://stackoverflow.com/q/25011903
tags question: http://stackoverflow.com/q/24947152
tags question: http://stackoverflow.com/q/25020672
tags question: http://stackoverflow.com/q/24921621
tags question: http://stackoverflow.com/q/24987001
tags question: http://stackoverflow.com/q/24910300
tags question: http://stackoverflow.com/q/24997102
tags question: http://stackoverflow.com/q/24992460
tags question: http://stackoverflow.com/q/24929403
tags question: http://stackoverflow.com/q/24947171
tags question: http://stackoverflow.com/q/24962844
tags question: http://stackoverflow.com/q/24924581
tags question: http://stackoverflow.com/q/24959301
tags question: http://stackoverflow.com/q/25025465
tags question: http://stackoverflow.com/q/24987934
tags question: http://stackoverflow.com/q/24909326
tags question: http://stackoverflow.com/q/25031758
tags question: http://stackoverflow.com/q/24974259
tags question: http://stackoverflow.com/q/25032539
tags question: http://stackoverflow.com/q/24989511
tags question: http://stackoverflow.com/q/25043033
tags question: http://stackoverflow.com/q/24959305
tags question: http://stackoverflow.com/q/25025433
tags question: http://stackoverflow.com/q/24951604
tags question: http://stackoverflow.com/q/24983660
tags question: http://stackoverflow.com/q/24963497
tags question: http://stackoverflow.com/q/25053905

http://stackoverflow.com/comment/38865997
has text: Your partials are in the same folder that index.html ? Because you use a path in your javascript line.
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24997749
type: Comment

http://stackoverflow.com/q/24909819
has answer: http://stackoverflow.com/a/78597767
favorite count: 0
has answer: http://stackoverflow.com/a/39524452
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
score: 2
upvote count: 2
type: Question
has body: When I load my slider with the normal bootrap css fine it works fine: but when I load it with the rtl css file - the photos are changing but the slide animation is not working for some reason I'm using the RTL files from the original bootstrap repo. My slider: סלייד ראשון . לפרטים סלייד שני . סלייד שלישי ואחרון .
has answer: http://stackoverflow.com/a/71198112
tagged with: javascript
has title: Slider is not working with Bootstrap-RTL
has answer: http://stackoverflow.com/a/67661199
has comment: http://stackoverflow.com/comment/38700246
downvote count: 0
has comment: http://stackoverflow.com/comment/38701248
has comment: http://stackoverflow.com/comment/38701285
tagged with: jquery

http://stackoverflow.com/q/25035338
has comment: http://stackoverflow.com/comment/46216316
type: Question
linked to: http://stackoverflow.com/q/11262236
upvote count: 5
has body: How to debug java script code on iPad/iPhone using Google Chrome Browser. How can I do that? I have tried this link. But this work only for safari browser.
score: 5
tagged with: iphone
has comment: http://stackoverflow.com/comment/44670985
downvote count: 0
tagged with: javascript
tagged with: ipad
has title: Debugging Chrome on iPhone/iPad
favorite count: 0
answer count: 0
type: UnansweredQuestion
tagged with: remote-debugging
tagged with: google-chrome

http://stackoverflow.com/q/24976981
tagged with: jquery
tagged with: external
type: UnansweredQuestion
has body: I did a lot of research on the internet, but still cannot find the answer to my problem. I am basically trying the execute two external java-scripts (hosted on external domain) with 5-10 seconds delay after my page has fully loaded. I am already using a delay script to load a google map into a IFRAME, and it works fine, but don't know how to also delay the loading of the two external js files. Please see image on the url below for coding. Any help would be highly appreciated. Thank you.
has title: Loading javascripts from external domain with few seconds delay after page load
type: Question
has answer: http://stackoverflow.com/a/24978587
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24977772
tagged with: delay
tagged with: load

http://stackoverflow.com/comment/38948724
type: Comment
has text: Tried `obj["address"]["phone"]`?
score: 0
comment on: http://stackoverflow.com/q/25041719
type: QuestionComment

http://stackoverflow.com/comment/38818442
has text: I notice that you have two divs, both with the same id "mypanel" -- that might be the cause of your problem
type: Comment
comment on: http://stackoverflow.com/q/24972261
score: 0
type: QuestionComment

http://stackoverflow.com/tag/json
tags question: http://stackoverflow.com/q/24989570
tags question: http://stackoverflow.com/q/24919581
tags question: http://stackoverflow.com/q/24918914
tags question: http://stackoverflow.com/q/25043967
tags question: http://stackoverflow.com/q/24966538
tags question: http://stackoverflow.com/q/24997163
tags question: http://stackoverflow.com/q/24963929
tags question: http://stackoverflow.com/q/25036731
tags question: http://stackoverflow.com/q/24980344
tags question: http://stackoverflow.com/q/25067035
tags question: http://stackoverflow.com/q/24964960
tags question: http://stackoverflow.com/q/24925450
tags question: http://stackoverflow.com/q/24949346
tags question: http://stackoverflow.com/q/25056507
tags question: http://stackoverflow.com/q/25046031
tags question: http://stackoverflow.com/q/24979376
tags question: http://stackoverflow.com/q/24955965
tags question: http://stackoverflow.com/q/25056139
tags question: http://stackoverflow.com/q/25029993
tags question: http://stackoverflow.com/q/24985649
tags question: http://stackoverflow.com/q/24973569
tags question: http://stackoverflow.com/q/24919307
tags question: http://stackoverflow.com/q/25024045
tags question: http://stackoverflow.com/q/24971092
tags question: http://stackoverflow.com/q/25009766
tags question: http://stackoverflow.com/q/24944858
tags question: http://stackoverflow.com/q/25066192
tags question: http://stackoverflow.com/q/24960242
tags question: http://stackoverflow.com/q/24979054
tags question: http://stackoverflow.com/q/24977110
tags question: http://stackoverflow.com/q/25015935
tags question: http://stackoverflow.com/q/24979943
tags question: http://stackoverflow.com/q/24983283
tags question: http://stackoverflow.com/q/25037723
tags question: http://stackoverflow.com/q/24986332
tags question: http://stackoverflow.com/q/24947622
tags question: http://stackoverflow.com/q/25026245
tags question: http://stackoverflow.com/q/24970321
tags question: http://stackoverflow.com/q/25014064
tags question: http://stackoverflow.com/q/24923888
tags question: http://stackoverflow.com/q/25011981
tags question: http://stackoverflow.com/q/24919143
tags question: http://stackoverflow.com/q/24967415
tags question: http://stackoverflow.com/q/25051349
tags question: http://stackoverflow.com/q/24922410
tags question: http://stackoverflow.com/q/25000448
tags question: http://stackoverflow.com/q/24968893
tags question: http://stackoverflow.com/q/25037346
tags question: http://stackoverflow.com/q/25028133
tags question: http://stackoverflow.com/q/24989966
tags question: http://stackoverflow.com/q/25014984
tags question: http://stackoverflow.com/q/25004895
tags question: http://stackoverflow.com/q/24944644
tags question: http://stackoverflow.com/q/24996127
tags question: http://stackoverflow.com/q/24977260
tags question: http://stackoverflow.com/q/25053584
tags question: http://stackoverflow.com/q/24949458
tags question: http://stackoverflow.com/q/24946832
tags question: http://stackoverflow.com/q/24920909
tags question: http://stackoverflow.com/q/24945284
tags question: http://stackoverflow.com/q/24960384
tags question: http://stackoverflow.com/q/25053099
tags question: http://stackoverflow.com/q/25049391
tags question: http://stackoverflow.com/q/24943482
tags question: http://stackoverflow.com/q/24974047
tags question: http://stackoverflow.com/q/25019629
tags question: http://stackoverflow.com/q/24994158
tags question: http://stackoverflow.com/q/24909670
tags question: http://stackoverflow.com/q/25042030
tags question: http://stackoverflow.com/q/25022822
tags question: http://stackoverflow.com/q/25063190
type: Tag
tags question: http://stackoverflow.com/q/24977558
tags question: http://stackoverflow.com/q/25026803
tags question: http://stackoverflow.com/q/24938471
tags question: http://stackoverflow.com/q/25015524
tags question: http://stackoverflow.com/q/24909235
tags question: http://stackoverflow.com/q/24958625
tags question: http://stackoverflow.com/q/24933574
tags question: http://stackoverflow.com/q/24926796

http://stackoverflow.com/comment/38721505
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24920318
has text: @p.s.w.g Well, thanks for your insight :)

http://stackoverflow.com/comment/38901461
score: 0
type: Comment
has text: I need to refresh myScript automaticcaly
comment on: http://stackoverflow.com/a/25016456
type: AnswerComment

http://stackoverflow.com/comment/38730897
type: Comment
type: QuestionComment
has text: http://stackoverflow.com/questions/1972242/auto-reload-of-files-in-node-js
score: 0
comment on: http://stackoverflow.com/q/24925835

http://stackoverflow.com/comment/38972115
comment on: http://stackoverflow.com/q/25054045
score: 0
type: Comment
type: QuestionComment
has text: Multiple jars on classpath ?

http://stackoverflow.com/comment/38947953
has text: Ok, I created the modal using jQuery instead and then inserted it into the page, and now my events are good, so your suggestion helped me fix it. Thanks!
type: AnswerComment
comment on: http://stackoverflow.com/a/25041052
score: 0
type: Comment

http://stackoverflow.com/q/25062168
linked to: http://stackoverflow.com/q/1988514
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/25062613
has comment: http://stackoverflow.com/comment/38987691
linked to: http://stackoverflow.com/q/7125453
accepted answer: http://stackoverflow.com/a/25062472
has comment: http://stackoverflow.com/comment/38987862
has comment: http://stackoverflow.com/comment/38987758
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38988110
tagged with: css
has body: I have a subscribe button, once it is clicked (and subscribed successfully) ; I want my code to show directly unsubscribe. So, I set two different div's for each button, and I thought we could toggle between them. {if !$userquery->is_subscribed($u.userid)} Subscribe {else} Subscribed Unsubscribe {/if} So, basically what I'm looking for is changing the id of the div from subscribe_everything to unsubscribe_everything once the user clicks on subscribe (or the opposite). This is the function being called by onclick: function subscriber(user,type,result_cont) { $.post(page, { mode : type, subscribe_to : user }, function(data) { if(!data) alert("No data"); else { } },'text'); } I have a suspicion that we can need to use the toggle function of jquery (and toggle the id's) but I don't know where to add it and how. I'm looking also for a fast way, I don't want to bore the customer with 10 seconds for the div to toggle.
type: AnsweredQuestion
has title: How to change a button's style?
has answer: http://stackoverflow.com/a/25062472
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25062613
tagged with: javascript

http://stackoverflow.com/q/24912725
has answer: http://stackoverflow.com/a/24912803
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38706073
has title: Can't read values that are outside of function
type: Question
accepted answer: http://stackoverflow.com/a/24912803
has comment: http://stackoverflow.com/comment/38706052
tagged with: javascript
score: 0
has body: I am learning JavaScript and AngularJS. I want to use the values that are outside of function, but I don't know how to access them. Here is my code (AngularJS Controller): var init = function() { $http.get('getSomeValues').then(function (res) { var returnArray = res.data; // Result is array for(var i=0; i &lt; returnArray.length; i++) { // Loop through the array console.log("THIS WORKS FINE: ", returnArray[i].value); // It works $http.get('getOtherValues/' + returnArray[i].value).then(function (res) { console.log("WHAT'S IN IT: ", returnArray[i].value); // Shows 'undefined' error }); } }); }; init(); So basically I want to access the array returnArray, but I can't. Is there any good way to access the values? I assume that '.then(function ..' causes error..
linked to: http://stackoverflow.com/q/111102
answer count: 1
tagged with: angularjs

sqlite
tags question: http://stackoverflow.com/q/25011791
tags question: http://stackoverflow.com/q/24935524
type: Tag
tags question: http://stackoverflow.com/q/25053093
tags question: http://stackoverflow.com/q/25057116
tags question: http://stackoverflow.com/q/25039476
tag name: sqlite

http://stackoverflow.com/a/24946998
type: AcceptedAnswer
type: Answer
has body: Change $name to $name = "test\'s data"; to escape the apostrophe. Or better yet, use $name = addslashes("test's data"); To escape all special characters.
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24946599
answers question: http://stackoverflow.com/q/24946599
has comment: http://stackoverflow.com/comment/38771612
upvote count: 2

http://stackoverflow.com/a/55393178
score: 3
has body: I was able to get the entire Mimetype of the thing being dragged over my page. Mimetype appears to be blank for folders, so maybe you can distinguish it that way. Partial code (extracted from React): function handleDragOver(ev: DragEvent) { ev.preventDefault(); ev.dataTransfer!.dropEffect = 'copy'; console.log(Array.from(ev.dataTransfer.items).map(i =&gt; [i.kind,i.type].join('|')).join(', ')); } document.addEventListener('dragover',handleDragOver); Output looks like: file|image/x-icon, file|image/jpeg, file|application/vnd.ms-excel When I drag 3 files over my page. Not sure if it only works on localhost, I haven't uploaded this anywhere yet, but it's totally working. MDN docs on DataTransferItem
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/25016442
type: Answer
has comment: http://stackoverflow.com/comment/107367690
has comment: http://stackoverflow.com/comment/138750696

http://stackoverflow.com/a/42719878
has body: From Telerik Docs: Widget Jumps on Focus When widget navigation is enabled, the widget wrapper becomes a focusable element. On click, the browser focuses it and preforms the so called scroll-into-view action. If the widget exceeds the height/width of the view-port, then it scrolls the page automatically. The goal is to position the focusable element at the top left corner of the view-port. During this process, actions like double click, drag or resize would not be available due to the movement of the page. The page re-positioning is a default browser behavior, which cannot be prevented nor modified. To avoid this behavior, choose either of the available options: Disable widget's navigation, if it is not needed in your business case. Size the widget to the view-port dimensions.
score: 0
answers question: http://stackoverflow.com/q/24998039
type: Answer

http://stackoverflow.com/comment/38921609
score: 0
type: AnswerComment
type: Comment
has text: Great explanation, Thanks for linking me to your discussion on this issue.
comment on: http://stackoverflow.com/a/25026449

http://stackoverflow.com/q/24932616
tagged with: cookies
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
has body: I'm trying to build a nodejs app and I have to define cookies. This is some of the code: var app = express(); app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(express.favicon()); app.use(express.cookieParser()); app.use(express.json()); app.use(express.urlencoded()); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(path.join(__dirname, 'public'))); ... app.get('/', routes.indexGET); app.post('/login', routes.loginPOST); app.post('/number', routes.numberPOST); ... res.cookie('number', req.body.number, {secure: true, httpOnly: true, maxAge: 1209600000}); console.log(req.cookies); //Returns {} Why isn't the cookie added? I know that this question has been asked here but I didn't really fined any fine answer. Even "correct" answers (put the cookieParser before the router) wasn't helpful. Any suggestions? Thanks.
tagged with: express
favorite count: 0
has title: Nodejs express cookies are not added
has answer: http://stackoverflow.com/a/24933367
upvote count: 6
score: 6
accepted answer: http://stackoverflow.com/a/24933367
tagged with: node.js
type: AnsweredQuestion

http://stackoverflow.com/a/25006063
score: 0
has comment: http://stackoverflow.com/comment/38886202
has body: You are feeding your Parse.File instance (file) into the XmlReader, instead of the actual string that it wants. You have the actual file in your thefile variable, so use that instead. The Parse.File class is for when you want to save a file onto the cloud and store a pointer to it in a class.
type: Answer
answers question: http://stackoverflow.com/q/25000277
has comment: http://stackoverflow.com/comment/38886173

http://stackoverflow.com/q/25048053
tagged with: javascript
upvote count: 2
favorite count: 0
tagged with: parse-platform
type: UnansweredQuestion
score: 2
has body: I have a job set up in Parse and I have a bunch of status.message() called out so that I can debug whats going on in the function. However when I run the job the code doesnt seem to be executed and none of the messages are being logged. For some reason though the success function is called. Job Parse.Cloud.job("checkBag", function(request, status) { // Gets the current time var MILL_PER_MIN = 60000; var now = new Date(); var minToDate = now.getTime() / MILL_PER_MIN; status.message("test"); // Get all the bags var query = new Parse.Query("Bag"); // Go though each of them query.each(function(bag) { ... ... },{ success: function() { status.success("Job completed successfully."); }, error: function() { status.error("Uh oh, something went wrong."); } }); });
answer count: 0
has title: Parse.com Cloud Code Job function calling success but not running function
type: Question
downvote count: 0

http://stackoverflow.com/comment/38912739
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25022198
has text: @Bergi, the only reason I would see is an incompatible browser...

http://stackoverflow.com/comment/38732757
has text: It will be hard to say anything not seeing your code
score: 1
comment on: http://stackoverflow.com/q/24926703
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38779626
comment on: http://stackoverflow.com/q/24951623
score: 0
type: QuestionComment
type: Comment
has text: I didn't get you brother. Working example means?

http://stackoverflow.com/comment/38869470
type: Comment
type: QuestionComment
has text: I assume you want to access the value of the global variable through the temp variable, right? If so, see my answer below. Issue is the 'reference by value' of the number type.
comment on: http://stackoverflow.com/q/24999501
score: 0

http://stackoverflow.com/a/24967108
accepted answer of: http://stackoverflow.com/q/24966698
answers question: http://stackoverflow.com/q/24966698
type: AcceptedAnswer
has body: I recommend you to use css not js ! What you are trying to do can be easily done using css : &lt;img src="logo.jpg" style="min-width:5%;max-width:5%;"&gt; Percent in css means percent of current page size, so in this case combining min and max width always get 5% of your page width for logo image
has comment: http://stackoverflow.com/comment/38816417
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38815625

http://stackoverflow.com/q/24954115
tagged with: jquery
favorite count: 0
has body: I have below checkbox and span tag in .Net MVC 3 page, @Html.CheckBoxFor(m => m.CheckedStatus, new Dictionary<string, object> { { "id", "cbCheckedStatus7" }, { "name", "cbCheckedStatus" }, { "class", "onchange" } }) Some message Jquery: jQuery(function ($) { $('#cbCheckedStatus7').on('change', function () { $('#spBlueCheckbox').slideToggle(this.checked); }); if the checkbox is checked, i need to show the span tag, or else hide it. initially the spab tag is hidden. I have written jquery to do the above scenario, but it is only working if i click manually by mouse. What i need is, when i navigate from previous page to this page, the checkbox is checked by default based DB flag, but the span tag is not shown.
has comment: http://stackoverflow.com/comment/38783801
has answer: http://stackoverflow.com/a/24954178
tagged with: checkbox
possible better answer: http://stackoverflow.com/a/24954134
answer count: 4
tagged with: asp.net-mvc-3
type: AnsweredQuestion
tagged with: javascript
has answer: http://stackoverflow.com/a/24954166
has answer: http://stackoverflow.com/a/24954134
type: Question
score: 0
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/24954248
accepted answer: http://stackoverflow.com/a/24954178
has title: Check whether checkbox is checked or not in page load itself by jquery

http://stackoverflow.com/q/25026786
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25026974
answer count: 1
tagged with: jquery
has body: I have this sample code I am using to insert media as attachments for custom made orders. I downloaded a Role Plugin which allowed me to be able to see Media but I don't want to see media of another user so I had a question about how to show only media I uploaded or this user uploaded. But back to the main question. This is the code I am using to open the media upload window once a button is clicked: var file_frame; var wp_media_post_id = wp.media.model.settings.post.id; // Store the old id var set_to_post_id = 10; // Set this $('.upload_image_button').on('click', function( event ){ event.preventDefault(); // If the media frame already exists, reopen it. if ( file_frame ) { // Set the post ID to what we want file_frame.uploader.uploader.param( 'post_id', set_to_post_id ); // Open frame file_frame.open(); return; } else { // Set the wp.media post id so the uploader grabs the ID we want when initialised wp.media.model.settings.post.id = set_to_post_id; } // Create the media frame. file_frame = wp.media.frames.file_frame = wp.media({ title: jQuery( this ).data( 'uploader_title' ), button: { text: jQuery( this ).data( 'uploader_button_text' ), }, multiple: true // Set to true to allow multiple files to be selected }); file_frame.on( 'select', function() { var selection = file_frame.state().get('selection'); selection.map( function( attachment ) { attachment = attachment.toJSON(); // Do something with attachment.id and/or attachment.url here }); }); // Finally, open the modal file_frame.open(); }); // Restore the main ID when the add media button is pressed jQuery('a.add_media').on('click', function() { wp.media.model.settings.post.id = wp_media_post_id; }); Now the issue here is, once I upload an image. I just get an error returned which states An error occurred in the upload. Please try again later. That is it. I am not sure why I would be getting this error? Source code I got was from http://mikejolley.com/2012/12/using-the-new-wordpress-3-5-media-uploader-in-plugins/…
has answer: http://stackoverflow.com/a/25026974
type: AnsweredQuestion
tagged with: wordpress
type: Question
has title: Issue using custom insert media for plugin - Wordpress

http://stackoverflow.com/comment/38976833
comment on: http://stackoverflow.com/a/25056231
score: 0
type: AnswerComment
type: Comment
has text: awesome! i actually tried pasting the code there, but i see there is another line added so maybe thats why it wasnt working.. and sorry for my bad question (without code)

http://stackoverflow.com/q/25048493
has comment: http://stackoverflow.com/comment/38962275
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/25048609
has comment: http://stackoverflow.com/comment/38962473
score: 1
has comment: http://stackoverflow.com/comment/38962089
upvote count: 1
has body: Code: &lt;div class="moti" id="content"&gt; Hello World ! What's up ??? What ??! &lt;/div&gt; &lt;script&gt; Aloha.ready( function() { Aloha.jQuery('#content').aloha(); }); &lt;/script&gt; Here: http:http://oo.netii.net/bootstrap/index.php How can I stop the exodus of characters which DIV ? I want it to stop writing altogether characters Because I need only height and width of this or : How do I pull only from its size?
type: Question
has comment: http://stackoverflow.com/comment/38961995
has title: How to stop wrapping characters in div? or
tagged with: javascript

http://stackoverflow.com/q/24924541
favorite count: 0
has body: I have a method that when called, makes a HTTP request to the server, and does not care about what happens after. The response is not parsed, and it does not change its state after sending the request or receiving the response. Now I wish to test this method, ans since there is no state change, I cannot verify that the HTTP request has been made by inspecting the method or the object that owns it. I somehow need to attach sinon to $.mockjax such that I can perform an assertion verifying that the HTTP request was indeed made. How to do this?
tagged with: sinon
has title: How to verify that mockjax has been called
tagged with: qunit
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/25221562
type: Question
accepted answer: http://stackoverflow.com/a/25221562
tagged with: javascript
downvote count: 0
tagged with: mockjax
answer count: 1

http://stackoverflow.com/q/24933134
type: AnsweredQuestion
has title: JQuery code is not working using PHP Code for Posts and Pages plugin for Wordpress
tagged with: wordpress
type: Question
has comment: http://stackoverflow.com/comment/38744989
has answer: http://stackoverflow.com/a/24933774
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24933774
has comment: http://stackoverflow.com/comment/38744689
has comment: http://stackoverflow.com/comment/38745104
has answer: http://stackoverflow.com/a/24933573
score: 0
answer count: 2
tagged with: jquery
tagged with: php
has body: I am made to use plugin PHP Code for Posts and Pages in worpress page. I want to expand row details after clicking on it like in this example: http://jsfiddle.net/ardeezstyle/4FKCa/1/ I can't do it using the plugin. After clicking the button row details are not expanded. Maybe someone is familiar with it and could help me? Here is my code: &lt;script src="//code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).delegate('input[type="button"]','click',function(){ if($(this).parents('tr').next('tr').find('div').length==0){ $('[colspan="5"]').parent('tr').remove(); $(this).parents('tr').after('&lt;tr/&gt;').next().append('&lt;td colspan="5"/&gt;').children('td').append('&lt;div/&gt;').children().css('background','#f0f0f0').html($($(this).data('href')).html()); }else{ $('[colspan="5"]').parent('tr').remove(); } }); &lt;/script&gt; &lt;style type="text/css"&gt; #content1, #content2, #content3 { display: none; } table { table-layout: fixed; width: 100%; border-collapse: collapse; } td { border: 1px solid #000; padding: 5px; vertical-align: top; } &lt;/style&gt; &lt;?php echo ' &lt;table summary="test" cellspacing="0" id="master"&gt; &lt;colgroup&gt; &lt;col width="40px"&gt; &lt;col span="4" width="25%"&gt; &lt;/colgroup&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&amp;nbsp;&lt;/th&gt; &lt;th&gt;&lt;span&gt;Customer&lt;/span&gt;&lt;/th&gt; &lt;th&gt;&lt;span&gt;OrderID&lt;/span&gt;&lt;/th&gt; &lt;th&gt;&lt;span&gt;Order date&lt;/span&gt;&lt;/th&gt; &lt;th&gt;&lt;span&gt;Order Total&lt;/span&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="button" name="" value=" " data-href="#content1" &gt;&lt;/td&gt; &lt;td&gt;Ernst Handel&lt;/td&gt;&lt;td&gt;10258&lt;/td&gt;&lt;td&gt;07/17/1996&lt;/td&gt;&lt;td&gt;$403.72&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;input type="button" name="" value=" " data-href="#content2"&gt;&lt;/td&gt; &lt;td&…
possible better answer: http://stackoverflow.com/a/24933573

http://stackoverflow.com/q/25030207
has comment: http://stackoverflow.com/comment/38927279
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25030241
has comment: http://stackoverflow.com/comment/38927296
has answer: http://stackoverflow.com/a/25031214
type: Question
has title: Stopping marquee with css
answer count: 2
has comment: http://stackoverflow.com/comment/38927274
tagged with: javascript
tagged with: marquee
score: 0
has body: Is there any way I can stop marquee with CSS ? I cannot use javascript for security reasons. How can I do this with css ? EDIT : I want to stop it on mouse hover and start it otherwise.
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38927325

http://stackoverflow.com/comment/41000397
score: 2
type: AnswerComment
comment on: http://stackoverflow.com/a/24956620
has text: input = input || 'test' is shorthand for if ( !input ) input = 'test'; the logical or ("||") converts input to true or false, and if false, chooses the second operand. Note, however, that 0 will evaluate to false, so if 0 is passed, input will be 'test'. You can avoid this by using: input = (input !== undefined) ? input : 'test'; On the other hand, *any* string will test as true: ("","0","false","undefined") will all evaluate to true.
type: Comment

http://stackoverflow.com/q/24958111
has answer: http://stackoverflow.com/a/24958277
favorite count: 0
tagged with: angularjs
upvote count: 1
downvote count: 1
type: AnsweredQuestion
type: Question
has title: Replace content with content from file in ng-include
has body: How can I replace the content in a div, with the content in my file that i'm using in ng-include? &lt;div id="fish"&gt; &lt;button ng-click="getPartial()"&gt; &lt;div ng-model="include"&gt;&lt;/div&gt; &lt;/div&gt; $scope.getPartial = function() { $scope.include = "partials/invoices/editcustinvoice.html"; }; How can I replace the the content inside fish, with my content in editcustinvoice?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24958277
score: 0
answer count: 1

http://stackoverflow.com/a/24931426
type: Answer
has body: Let's keep it very simple. Idea is to set the keys with the object being event.keyCode to true on keydown, and delete on keyup. Then count the instances of true in keys, var keys = []; $(function () { $(document).keydown(function (event) { keys[event.keyCode] = true; var count = 0; for (var i = 0; i &lt; keys.length; i++) { if (keys[i]) count++; } console.log(count); }); $(document).keyup(function (e) { delete keys[e.keyCode]; }); });
answers question: http://stackoverflow.com/q/24930621
score: 0

http://stackoverflow.com/comment/38889927
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25010356
type: AnswerComment
has text: thanks for your answer. I figureout scenario, which would this solution not be good. See my comments.

http://stackoverflow.com/q/24925006
has title: How to test .observes() in an Ember controller?
accepted answer: http://stackoverflow.com/a/24925284
type: AnsweredQuestion
score: 2
tagged with: observers
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24925284
has body: How can you test a function that observes a property of an Ember controller? How can this be done when the observes method is asynchronous (does not return immediately)? Controller: var FooController = Ember.Controller.extend({ bar: 1, baz: null, barObserver: function() { var req = ic.ajax.raw({ method: 'POST', url: '/api/bar', data: { bar: bar }, }); return req.then(function resolve(result) { this.set('baz', result.response.baz); }); }.observes('bar'), }); Unit test: test('barObserver', function() { var ctrl = this.subject(); equal(ctrl.get('baz'), null, 'baz initially null'); Ember.$.mockjax({ url: '/api/bar', 'type': 'POST', dataType: 'json', response: function() { this.responseText = { baz: 'something' }; }, }); ctrl.set('bar', 2); //wait for barObserver's promise (from ic.ajax.raw) to return equal(ctrl.get('baz'), 'something', 'baz set to returned value'); });
tagged with: ember.js
answer count: 1
tagged with: qunit
favorite count: 0
upvote count: 2

http://stackoverflow.com/a/57198884
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25063664
has body: Chosen solution works great, but will break on multi-dash attributes (like data-one-two) because: Since jQuery 3, every two-character sequence of "-" (U+002D) followed by a lowercase ASCII letter in a key is replaced by the uppercase version of the letter, in alignment with the HTML dataset API. A statement like $( "body" ).data( { "my-name": "aValue" } ).data(); will return { myName: "aValue" }. source To make results of data() work with removeAttr() we should cast them back to normal: function removeAllData(object) { $.each(object.data(), function(i, v) { i = i.replace(/([A-Z])/g, function(all, letter) { return '-' + letter.toLowerCase() }); // fix multi-dash attributes object.removeAttr("data-"+i); console.log('removing: '+'data-'+i); }); object.removeData(); // clear the cache too } It's not an ideal solution, but should work in most cases.
type: Answer

http://stackoverflow.com/a/25003726
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25003618
answers question: http://stackoverflow.com/q/25003618
score: 1
upvote count: 1
type: AcceptedAnswer
has body: As @Karl mentioned, you need to add var to your variable, like so: var ribbonMenu= new RibbonMenu($(this)); The reason for this is because in javascript, when you don't explicitly declare a variable to be local, it is global; you need to be very careful about this, since it's one sure way to get bugs, as you know ;)
type: Answer

http://stackoverflow.com/comment/38715144
comment on: http://stackoverflow.com/q/24917144
score: 0
has text: Are you running the test script through a site hosted at a valid domain name?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25007388
answers question: http://stackoverflow.com/q/25007365
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25007365
has comment: http://stackoverflow.com/comment/38884534
type: Answer
score: 0
has body: try encoding the string first encodeURIComponent()
has comment: http://stackoverflow.com/comment/38885167
has comment: http://stackoverflow.com/comment/38884867

http://stackoverflow.com/comment/38806795
comment on: http://stackoverflow.com/a/24966028
type: AnswerComment
type: Comment
has text: @GustavoPinent, I just added a version for older browsers :) The biggest differences are that you can't depend on `Function.prototype.bind` or `Array.prototype.forEach`.
score: 0

http://stackoverflow.com/q/24935869
has answer: http://stackoverflow.com/a/24935954
has comment: http://stackoverflow.com/comment/38749880
has comment: http://stackoverflow.com/comment/38749896
has comment: http://stackoverflow.com/comment/38749592
has answer: http://stackoverflow.com/a/24936009
has body: Slightly abstract question this, but I'd be interested to know a more succinct way of writing: if( i.css('opacity') == 1 ) o = 0; else o = 1; So if something == 1, make another = 0 and if something == 0 make another = 1 There must be some sort of multiplication I can do on something to achieve this? My maths sucks.
score: -6
favorite count: 0
has title: Make 1 = 0 and 0 = 1 in javascript
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24935933
has answer: http://stackoverflow.com/a/24935918
has comment: http://stackoverflow.com/comment/38749600
has comment: http://stackoverflow.com/comment/38749604
upvote count: 1
has answer: http://stackoverflow.com/a/24935936
downvote count: 7
has comment: http://stackoverflow.com/comment/38749611
type: Question
tagged with: javascript

http://stackoverflow.com/q/24967735
score: 8
tagged with: twitter-bootstrap
accepted answer: http://stackoverflow.com/a/24967877
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/24967877
upvote count: 8
type: Question
has body: I'd like to use URLs with hashes to call specific Bootstrap modals. In other words, a user is on page1 and clicks on a link to page2#hash and the #hash modal loads when page2 loads. I've tried so many variations based on what I've read in other Q/As, but nothing has worked. I'm not at all experienced with JS, so I'd appreciate some help! Here's what I have: Link on page1: &lt;a href="/page2#myModal&gt; HTML on page2: &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true"&gt; ... &lt;/div&gt; Javascript on page2: &lt;script&gt; if(window.location.hash) { var hash = window.location.hash; $("'" + hash + "'").modal('toggle'); } &lt;/script&gt; Incidentally, &lt;a href="#" data-toggle="modal" data-target="#myModal"&gt; works just fine to call the modal when the user is actually on page2.
has title: Toggle Bootstrap modal with URL and hash
tagged with: bootstrap-modal
tagged with: javascript
possible better answer: http://stackoverflow.com/a/64994332
has answer: http://stackoverflow.com/a/64994332
answer count: 2
favorite count: 0

http://stackoverflow.com/a/24995164
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24995121
score: 2
has comment: http://stackoverflow.com/comment/38861026
upvote count: 2
has body: You are mixing javascript with jquery. getAttribute is a javascript function. try this console.log(c.attr('value')) Or simple console.log(c.val())

http://stackoverflow.com/comment/38796992
comment on: http://stackoverflow.com/a/24960969
type: AnswerComment
score: 0
type: Comment
has text: That doesn't sound like an _error_, it's a _warning_ regarding jquery-ui's CSS, not your code - if not even the webpage's own CSS.

http://stackoverflow.com/comment/38879157
type: Comment
has text: @andrew barber i asked this question for the first time 5 days ago and i didnt get any answers that duplicate was my second attempt 2 days ago. i didnt get any answers on those so i made another one with more info... i already got my answer mot did it how do i close this one?
type: QuestionComment
comment on: http://stackoverflow.com/q/24998781
score: 0

http://stackoverflow.com/comment/38783869
comment on: http://stackoverflow.com/a/24954061
has text: Your JS is essentially the same as in the original post. All you did was assign the object literal to a variable, but that shouldn't make any difference.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25066607
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25066538
has comment: http://stackoverflow.com/comment/38997432
type: Answer
accepted answer of: http://stackoverflow.com/q/25066538
has comment: http://stackoverflow.com/comment/38996762
has comment: http://stackoverflow.com/comment/38996507
has body: Did you try this ? var date = new Date(); date.getUTCMonth(); date.getUTCFullYear();
has comment: http://stackoverflow.com/comment/38996446
has comment: http://stackoverflow.com/comment/38996828

http://stackoverflow.com/q/24922912
has title: d3 area has undesirable curves
has comment: http://stackoverflow.com/comment/38727008
answer count: 0
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38789792
tagged with: javascript
has comment: http://stackoverflow.com/comment/38756218
has comment: http://stackoverflow.com/comment/38730424
downvote count: 0
has body: I am using interpolate("cardinal") to connect these points and I am getting some weird curves. Notice how starting at July 5 the curve dips below zero then curves up to intersect the zero at July 6. Then it curves up after July 7 to come back down and intersect with July 8. How can I get curvy areas without these oddities?
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
tagged with: data-visualization

http://stackoverflow.com/comment/39031477
type: QuestionComment
type: Comment
has text: Alright. I found what I was doing wrong. I needed to export as a ThreeJS Scene. This brings over the hierarchy correctly and I can access the meshes by traversing the resulting object.
comment on: http://stackoverflow.com/q/25067419
score: 1

http://stackoverflow.com/a/24963853
score: 1
has body: You're setting style.display = inline, but later removing it when you reduce style to just margin-left and margin-top. The original display: none from the CSS is all that's left. Include a visible display property alongside the margins: photoviewdiv.setAttribute("style", "margin-left: -" + viewerwidth/2 + "px; " + "margin-top: -" + viewerheight/2 +"px; " + "display: block"); Alternatively: photoviewdiv.style.display = "block"; var viewerwidth = photoviewdiv.offsetWidth; var viewerheight = photoviewdiv.offsetHeight; photoviewdiv.style.marginLeft = "-" + viewerwidth / 2 + "px"; photoviewdiv.style.marginTop = "-" + viewerheight / 2 + "px"; Example
upvote count: 1
has comment: http://stackoverflow.com/comment/38802985
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38803027
has comment: http://stackoverflow.com/comment/38802840
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24963733
answers question: http://stackoverflow.com/q/24963733

http://stackoverflow.com/q/24933593
answer count: 1
downvote count: 0
tagged with: websocket
has body: I'm looking for a way to send a unique identifier to the server when opening a WebSocket. I could implement this by sending an handshake message after being connected, but it would be very nice if that wasn't needed and instead I could just send and read the identifier via meta data, similar to header fields in http requests. Is there a way to send meta data when opening a WebSocket?
favorite count: 0
has title: Is there a way to send meta data when opening a WebSocket?
tagged with: node.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24935600
upvote count: 3
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/24935600

http://stackoverflow.com/q/25011112
has answer: http://stackoverflow.com/a/25011169
has answer: http://stackoverflow.com/a/25016920
possible better answer: http://stackoverflow.com/a/25011134
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has body: I am creating a website using vb.net. What I want to do is not have multiple forms just multiple 's on the page and hide/show them on the button click so there will be no change in the actual url, just display of the page. So I am using vb.net and javascript to achieve that. my vb.aspx page : <asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server"> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server"> ATA <asp:Button runat="server" ID="Button1" OnClientClick="return back()" Text="Back to DMI" CausesValidation="false" /> DMI <asp:Button runat="server" ID="btnatadetails" OnClientClick="return show_ata()" Text="Go to ATA" CausesValidation="false" /> </asp:Content> So that is my code, I have some code on .aspx.vb page too, but it is only to do with checking if user is logged in, and has nothing to do with page display so I will not post it here. MY PROBLEM My problem is that for some reason button on click action hides given div only for 1 sec and then shows it again, my intend was to hide it and stay hidden. Any ideas what am i doing wrong? SOLUTION Some of you guys suggested that I should wrap my javascript code in document ready function, which is probably correct but does not solve my issue. Solution is either write vb code for button click like this: Private Sub btnatadetails_Click(sender As Object, e As System.EventArgs) Handles btnatadetails.Click dmi.Visible = False ata.Visible = True End Sub Or not to use ASP:Button and use html button because asp:button runs on server and on every click page will reload and come back to its original state. Thanks for help guys.
upvote count: 1
tagged with: vb.net
accepted answer: http://stackoverflow.com/a/25016920
type: Question
tagged with: javascript
has title: Using javascript hide()/show() in vb.net
answer count: 3
has answer: http://stackoverflow.com/a/25011134
downvote count: 0
tagged with: jquery
score: 1
tagged with: asp.net
favorite count: 0

http://stackoverflow.com/a/24967582
type: Answer
has body: Add a background-image pointing to a url() where your image file is. Adjust its size via background-size. You could add this to an existing class (augmenting that class), or you could create a new class and add the new class to the existing HTML element. DEMO: http://jsbin.com/gazuf/2/edit HTML: &lt;div class="fb-login-button cs" data-max-rows="1" data-size="xlarge"&gt;&lt;/div&gt; CSS: .fb-login-button { width: 128px; /* Width &amp; height added for demo only. */ height: 40px; background-image: url(http://placekitten.com/256/80); background-size: 128px 40px; } DOCS: https://developer.mozilla.org/en-US/docs/Web/CSS/background-image https://developer.mozilla.org/en-US/docs/Web/CSS/background-size
answers question: http://stackoverflow.com/q/24967293
score: 0

http://stackoverflow.com/q/25005168
tagged with: node.js
answer count: 0
has title: async.each and http get
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38891555
type: Question
has comment: http://stackoverflow.com/comment/38882340
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38880089
has body: I want to programmatically fetch meta tags from multiple urls and use for furthur processing. I'm using this below code snippet, this one always prints only the first urls meta tag and the async callbacks res is undefined. Am I missing anything here with async? var http = require('http'), cheerio = require('cheerio'), async = require('async'), urls = [ "http://theatlantic.com", "http://nytimes.com" ]; function test() { var $, data = ''; getMetaData = function(uri, callback) { http.get(uri, function(resp) { console.log('Fetching Url:' + uri); resp.on('data', function (chunk){ data += chunk; }); resp.on('end', function () { $ = cheerio.load(data); console.log('Meta Tag:' + $('meta[property="og:description"]').attr('content') + '\n'); //use for furthur processing callback(null, $('meta[name="description"]').attr('content')); }); }); } async.each(urls, getMetaData, function(err, res) { console.log(res); }); }; test();
tagged with: asynchronous

http://stackoverflow.com/a/24914855
score: 0
upvote count: 1
downvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24914783
has body: Add a ID to your button Sign up $("#btnSubmit").click(function() { window.location.href = "http://stackoverflow.com"; //Your URi here }): MORE NOTE: I hope using a button type Submit to redirect to another page is odd, if you want to just redirect the user on button click, use button type instead of Submit type like below (OR) Use a tag also like Sign up Hope this helps...

http://stackoverflow.com/a/25013367
has body: ok, so this is my final code, which seems to work, var SubmitingNewUser = function() { $('#UserAJAXAddNewUserForm').on('submit', function(e) { e.preventDefault(); $.post($('#UserAJAXAddNewUserForm').attr('action'), $('#UserAJAXAddNewUserForm').serialize(), function(res) { var FormString = res; if ( $(FormString).find('div &gt; .error-message').size() == 0 ) { $('#UserAJAXAddNewUserForm').html('ok user saved!'); } else { $('#UserAJAXAddNewUserForm').html(res); //Add form back with errors from model } }) //End of post }) //end of 'on' submit } For now all I do is replace the user add form with a simple text message which I will style later. Thanks for all your help.
score: 0
answers question: http://stackoverflow.com/q/25011145
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25011145

http://stackoverflow.com/a/24934455
has comment: http://stackoverflow.com/comment/38758104
downvote count: 0
has comment: http://stackoverflow.com/comment/38748942
has comment: http://stackoverflow.com/comment/38748749
score: 1
upvote count: 1
has body: You will either need HTML5 (FileReader), or Flash in order to accomplish what you are looking to do. Simply put Javascript/iFrames have security against dealing with Local User Files and viewing them in the browser to prevent malicious use. For a working example using Mootools 1.3.2, which you are free to convert to jQuery. I had to override the XHR method in order to handle the request, so you will more than likely need to do the same with jQuery. Notice that I do a check for FileReader and remove the ability to preview without it. You could also adapt the window.FormData method in order to ajaxify the upload process, and update the image onSuccess with the server source. http://examples.torntech.com/ajax_file/ HTML: Preview Upload Preview Image: Response: Javascript: // Request.implement({ options: { form: null }, sendFile: function(options){ if (!this.check(options)) return this; this.options.isSuccess = this.options.isSuccess || this.isSuccess; this.running = true; var type = typeOf(options); if (type == 'string' || type == 'element') options = {data: options}; var old = this.options; options = Object.append({data: old.data, url: old.url, method: old.method, form: old.form, sendAsBinary: old.sendAsBinary}, options); var data = options.data, url = String(options.url); if (!url) url = document.location.pathname; var trimPosition = url.lastIndexOf('/'); if (trimPosition > -1 && (trimPosition = url.indexOf('#')) > -1) url = url.substr(0, trimPosition); if (this.options.noCache) url += (url.contains('?') ? '&' : '?') + String.uniqueID(); var xhr = this.xhr; xhr.open("POST", url, this.options.async, this.options.user, this.options.password); if (this.options.user && 'withCredentials' in xhr) xhr.withCredentials = true; xhr.onreadystatechange = this.onStateChange.bind(this); Object.each(this.headers, function(value, key){ try { xhr.setRequestHeader(key, value); } catch (e){ this.fireEvent('exception', [key, value]); } }, this); this.fireEvent('request'); if(options.for…
has comment: http://stackoverflow.com/comment/38758030
answers question: http://stackoverflow.com/q/24932687
type: Answer

http://stackoverflow.com/comment/38835800
comment on: http://stackoverflow.com/a/24981775
type: Comment
has text: Perfect thanks! I didn't realise I had to structure the URL differently, but it's not a problem.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25039902
has answer: http://stackoverflow.com/a/25040386
has comment: http://stackoverflow.com/comment/38946160
type: Question
tagged with: javascript
has body: I am trying to change the anchor(s) on my second column to have a link that includes information from my first and third column. How can we do this using Jquery? Please see example below: How do I go from this: Model Id Model Num(s) Company 1 Model-1 Apple 2 Model-2 MS 2 Model-3Model-4Model-5 IBM to This: Model Id Model Num(s) Company 1 Model-1 Apple 2 Model-2 MS 3 Model-3Model-4Model-5 IBM
tagged with: jquery
has answer: http://stackoverflow.com/a/25040664
score: 0
answer count: 2
has title: How to change anchor in column using text in another column?
has comment: http://stackoverflow.com/comment/38946015
accepted answer: http://stackoverflow.com/a/25040386
possible better answer: http://stackoverflow.com/a/25040664
type: AnsweredQuestion

http://stackoverflow.com/q/24929389
accepted answer: http://stackoverflow.com/a/24929609
answer count: 4
has answer: http://stackoverflow.com/a/24929491
has body: This is part of my code : document.querySelector("#edit_&lt;?= $row["item_id"]; ?&gt;").addEventListener("submit", function(a){ if(!completed){ a.preventDefault(); }else{ return true; } if((function(){ alertify.prompt("New Amount of Item : ", function(e, str){ if(e){ document.querySelector("#edit_&lt;?= $row["item_id"]; ?&gt; input[name=\"item_amount\"]").value = str; var completed = true; return true; }else{ return false; } }) )() == true){ document.querySelector("#edit_&lt;?= $row["item_id"]; ?&gt;").submit(); } }); Where &lt;? $row["item_id"]; ?&gt; will return something (ignore it, it isn't the real problem) But the problem is that I need to wait until alertify.prompt() gets str and then put it to document.querySelector("#edit_&lt;?= $row["item_id"]; ?&gt; input[name=\"item_amount\"") (Sorry for this messy code) What can I do to solve this? P.S. Better not use a jQuery solution if possible because it is already given. Use a Javascript-Only solution please.
has answer: http://stackoverflow.com/a/24929483
type: AnsweredQuestion
tagged with: prompt
tagged with: forms
has title: How to wait until one function completes and loops
type: Question
tagged with: javascript
tagged with: alertify
has answer: http://stackoverflow.com/a/24929643
possible better answer: http://stackoverflow.com/a/24929483
score: 0
has answer: http://stackoverflow.com/a/24929609

http://stackoverflow.com/q/24916090
has answer: http://stackoverflow.com/a/24916226
accepted answer: http://stackoverflow.com/a/24916332
linked to: http://stackoverflow.com/q/10425287
has title: Convert "Sentence case" to "camelCase" in JavaScript
upvote count: 3
has body: Having a difficult time finding a solution to this, there are several solutions for the reverse. I have considered replacing every " " and the following first character with an uppercase version of itself: value.toLowerCase().replace(/\s+/g, function (g) { return g[1].toUpperCase() }) Only, the regex /\s+/g needs to be changed to match the first character. If there is an existing question that is exactly this, provide link and I will close this myself. I can't find a solution on SO Examples: "I walk my dog to the park" or "i Walk my DOG to the Park" => "iWalkMyDogToThePark"
has comment: http://stackoverflow.com/comment/38712842
possible better answer: http://stackoverflow.com/a/24916316
has answer: http://stackoverflow.com/a/24916316
has comment: http://stackoverflow.com/comment/38712838
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/24916332
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24916469
type: Question
tagged with: regex
has answer: http://stackoverflow.com/a/66812973
has answer: http://stackoverflow.com/a/24916356
answer count: 6

http://stackoverflow.com/a/24979705
has comment: http://stackoverflow.com/comment/38864202
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38835660
has comment: http://stackoverflow.com/comment/38835390
downvote count: 0
has body: I think it cannot resolve your url, maybe this has to do with the way you named your routes and how they inherit eachother. Shouldnt they url be #/tab/posts/{{ postId }} ? Else you could try and see if it works with a ^ to make the route absolute and not relative to the parent. So to make the url work, try .state('tab.view', { //suspect error is here but various combos didnt work url: '^/posts/:postId', views: { 'tab-view':{ templateUrl: 'templates/tab-showpost.html', controller: 'PostViewCtrl'}}}) Else it will take on the path relative to its parent, tab in this case if i am correct and thus have the url #/tab/posts/{{ postId }}.
type: Answer
answers question: http://stackoverflow.com/q/24979576

http://stackoverflow.com/q/24960645
has answer: http://stackoverflow.com/a/24960656
has answer: http://stackoverflow.com/a/24960683
has body: I have the following JSON string: var txt= { "people": [{ "person": { "firstname":"Jane", "lastname":"Doe" } }, { "person": { "firstname":"John", "lastname":"Smith" } } ] }; I want the program to alert that there are two people in the list, but when I do my count function, it only says 1 (gets to 'people' then doesn't go deeper into the list). Here is the fiddle: http://jsfiddle.net/LipeeVora/rsBYb/3/
favorite count: 0
upvote count: 2
possible better answer: http://stackoverflow.com/a/24960683
accepted answer: http://stackoverflow.com/a/24960656
answer count: 4
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24961320
has title: Printing Information from JSON string
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24960748

http://stackoverflow.com/comment/38902952
score: 0
comment on: http://stackoverflow.com/q/25017226
has text: True. How could I have missed that one :p. Will see if this solves my problem.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25050827
has comment: http://stackoverflow.com/comment/38966514
has comment: http://stackoverflow.com/comment/38966572
score: 1
has comment: http://stackoverflow.com/comment/38966329
has comment: http://stackoverflow.com/comment/38966257
answers question: http://stackoverflow.com/q/25050652
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38966397
downvote count: 0
has comment: http://stackoverflow.com/comment/38966450
type: Answer
has body: try SAMPLE HTML dd JS function getheightWidth(className) { var o = new Object(); var span = document.createElement("P"); span.className = className; span.style.visibility = "hidden"; $("div.test1").append(span); // append into html o.width = $(span).width(); o.height = $(span).outerHeight(false); return o; } var obj=getheightWidth("test") console.log(obj); DEMO NOTE: You can not get an element's height/width before it is being appended to dom
accepted answer of: http://stackoverflow.com/q/25050652
has comment: http://stackoverflow.com/comment/38966603
upvote count: 1

http://stackoverflow.com/q/24926055
tagged with: css
favorite count: 0
type: AnsweredQuestion
score: 2
downvote count: 0
possible better answer: http://stackoverflow.com/a/24926116
has title: JS CSS font color and underline
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24926215
accepted answer: http://stackoverflow.com/a/24926215
tagged with: javascript
upvote count: 2
linked to: http://stackoverflow.com/q/5948601
has answer: http://stackoverflow.com/a/24926116
tagged with: http://stackoverflow.com/tag/html
has body: I would like to change css for the font. This will change b element This is element b This will change g element This is element g This will change k element This is element k As what I understand this used 'chbg' to change background color, If I want to make the font underline + font color how could I applied to this. Here is live fiddle http://jsfiddle.net/NAuxn/

http://stackoverflow.com/q/24994736
has body: I am using AngularJS with ng-repeat directive. I really need to know if there is a way to bind events like 'ng-repeat-before-render' and 'ng-repeat-after-render'. I need that for several reasons, one of them is in order to calculate the height before and after the rendering. I saw several directives that rely on $scope.$last, but $scope.$last is true only when rendering the last element in sequence and in my case I add elements in the middle of the list. I really appreciate a direction to solve this issue.
has answer: http://stackoverflow.com/a/24996084
has comment: http://stackoverflow.com/comment/38861043
score: 0
has comment: http://stackoverflow.com/comment/38860575
linked to: http://stackoverflow.com/q/18297208
has title: angularjs ng-repeat after render
has comment: http://stackoverflow.com/comment/38860574
has answer: http://stackoverflow.com/a/24998412
tagged with: angularjs-directive
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38860213
has comment: http://stackoverflow.com/comment/38860640
type: Question
tagged with: angularjs-ng-repeat
has comment: http://stackoverflow.com/comment/38861061
tagged with: angularjs
answer count: 2

http://stackoverflow.com/q/24942396
upvote count: 1
type: Question
has title: Fetch XML Content into HTML
has answer: http://stackoverflow.com/a/24942508
has answer: http://stackoverflow.com/a/24942484
has body: I am a newbie to HTML/JS, so I am hoping you experts can help me out here with a small question. I have html5 music player with playlist, contents of which are currently mentioned within the index.html file as follows: Song1Buy SongArtist1 Song2Buy Song< /a>Artist2 Song3Buy SongArtist1 Song4Buy SongArtist2 My goal is to get items from a XML file so that I don't have to keep updating the html file every time but instead if I change the strings on my external(dropbox like) source.XML file being maintained in the same syntax as follows: <?xml version="1.0" encoding="utf-8"?> Song1Buy SongArtist1 Song2Buy SongArtist2 Song3Buy SongArtist1 Song4Buy SongArtist2 I am not sure how to associate or call the XML file so that html can read them as if they were being called directly in html. Any code help you can share will be greatly appreciated. Thanks!
tagged with: javascript
answer count: 2
downvote count: 0
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/xml
score: 1

http://stackoverflow.com/comment/38943385
has text: **Danger**: This code is [vulnerable to XSS](https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)). User input needs escaping before being inserted into an HTML document!.
score: 0
comment on: http://stackoverflow.com/q/25021005
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24913577
upvote count: 1
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24913654
has comment: http://stackoverflow.com/comment/38707750
possible better answer: http://stackoverflow.com/a/24913885
tagged with: javascript
has comment: http://stackoverflow.com/comment/38707814
has answer: http://stackoverflow.com/a/24913760
score: 0
has answer: http://stackoverflow.com/a/24913654
tagged with: jquery
has title: jQuery get value of hidden input
favorite count: 0
has answer: http://stackoverflow.com/a/24913788
has body: I've got an ajax call that returns something like this: &lt;p&gt; &lt;a href="javascript:void(0);" class="addressOpt"&gt; John Paul Jones &lt;br/&gt; 399 OAK ST &lt;br/&gt; DELROY ND 30254 &lt;br/&gt; &lt;input type="hidden" name="XNAME" value=" John Paul Jones"&gt; &lt;input type="hidden" name="XADD1" value="399 OAK ST"&gt; &lt;input type="hidden" name="XADD2" value=""&gt; &lt;input type="hidden" name="XCITY" value="DELROY"&gt; &lt;input type="hidden" name="XSTA" value="ND"&gt; &lt;input type="hidden" name="XZIP" value="30254"&gt; &lt;input type="hidden" name="XPHON" value=""&gt; &lt;/a&gt; &lt;/p&gt; &lt;p&gt; &lt;a href="javascript:void(0);" class="addressOpt"&gt; John Paul Jones &lt;br/&gt; 2680 PALUMBO DRIVE &lt;br/&gt; LEXINGTON KY 40509 &lt;br/&gt; 8592667227 &lt;input type="hidden" name="XNAME" value="John Paul Jones"&gt; &lt;input type="hidden" name="XADD1" value="2680 PALUMBO DRIVE"&gt; &lt;input type="hidden" name="XADD2" value=""&gt; &lt;input type="hidden" name="XCITY" value="LEXINGTON"&gt; &lt;input type="hidden" name="XSTA" value="KY"&gt; &lt;input type="hidden" name="XZIP" value="40509"&gt; &lt;input type="hidden" name="XPHON" value="8592667227"&gt; &lt;/a&gt; &lt;/p&gt; So I want to get every hidden value when any of those links are clicked. I tried: $(document).on('click', '.addressOpt', function(e) { alert($("[name=XCITY]").val()); }); But always gives me back the value of the first element (DELROY), even if I click the second. I know I've got to use 'this' but don't know who to use it with the attribute equals selector. Any help would be appreciated.
answer count: 5
has answer: http://stackoverflow.com/a/24913885
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24913737
type: AnsweredQuestion

http://stackoverflow.com/a/25041174
upvote count: 21
has comment: http://stackoverflow.com/comment/38948477
has comment: http://stackoverflow.com/comment/38950054
downvote count: 4
has body: But console.log(formData) shows formData is empty. What do you mean by "empty"? When I test this in Chrome it shows ‣ FormData {append: function} ... which is to say it's a FormData object, which is what we expected. I made a fiddle and expanded to code to this: var form = document.querySelector('form'), formData = new FormData(form), req = new XMLHttpRequest(); req.open("POST", "/echo/html/") req.send(formData); ...and this is what I saw in the Chrome Developer Tools Network panel: So the code is working as expected. I think the disconnect here is that you're expecting FormData to work like a vanilla JavaScript object or array and let you directly look at and manipulate its contents. Unfortunately it doesn't work like that—FormData only has one method in its public API, which is append. Pretty much all you can do with it is create it, append values to it, and pass it to an XMLHttpRequest. If you want to get the form values in a way you can inspect and manipulate, you'll have to do it the old-fashioned way: by iterating through the input elements and getting each value one-by-one—or by using a function written by someone else, e.g. jQuery's. Here's an SO thread with a few approaches to that: How can I get form data with JavaScript/jQuery?
has comment: http://stackoverflow.com/comment/38948585
type: Answer
has comment: http://stackoverflow.com/comment/38948335
has comment: http://stackoverflow.com/comment/38948026
has comment: http://stackoverflow.com/comment/139700389
answers question: http://stackoverflow.com/q/25040479
has comment: http://stackoverflow.com/comment/38948346
has comment: http://stackoverflow.com/comment/38949230
score: 17

http://stackoverflow.com/comment/38923454
type: QuestionComment
comment on: http://stackoverflow.com/q/25027830
has text: @epascarello—not if [*ToPrimitive*](http://ecma-international.org/ecma-262/5.1/#sec-9.1)`(c)` returns a number.
score: 0
type: Comment

http://stackoverflow.com/q/25041076
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25041827
possible better answer: http://stackoverflow.com/a/25041629
has body: I need to trigger when user stop scrolling and alert some message. But I need to trigger it by percent. For example I want to alert to user some message if he scroll, but when he stop scrolling and if he scroled more then 80% of window. I have this code which trigger when srcoll is stopped and don't know how to get this work with scroll percen: $.fn.scrollStopped = function(callback) { $(this).scroll(function(){ var self = this, $this = $(self); if ($this.data('scrollTimeout')) { clearTimeout($this.data('scrollTimeout')); } $this.data('scrollTimeout', setTimeout(callback,250,self)); }); }; jQuery(window).scrollStopped(function(){ alert('stopped'); });
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25041629
has title: Trigger when scroll stopped by percent
has comment: http://stackoverflow.com/comment/38947579
accepted answer: http://stackoverflow.com/a/25041827

http://stackoverflow.com/q/24909326
favorite count: 0
tagged with: ajax
duplicate of: http://stackoverflow.com/q/8824511
type: UnansweredQuestion
score: 5
has body: I have made changes on my comments for add TinyEditor(WYSIWYG). to send data i use this jquery function function AddComent(){ var formulario="#send_coment"; var url = "comentario.php"; var destino="#leercomentarios"; $.ajax({ type: "POST", url: url, data: $(formulario).serialize(), success: function(data) { $(destino).html(data); } }); envio_comentario.reset(); $("#iframe_a_limpiar").contents().find("body").html(''); } I have tried to set json data datatype, and more option that i have read in other places, but my log say same concept, error 403, it only happens depending the html entities to send, if i use the editor only with one or none style it works. By other side, i have tried to use tinyeditor on pure PHP HTML, and it works fine. Anyone know where is the problem on my script. (thanks to Quentin for all) The problem is apache security mod, but i cant change it, i have seening a solution like this function awesome() { elements = document.forms[0].elements; for(var i = 0; i &lt; elements.length; i++) { switch(elements[i].name) { case "ads": case "shortDescription": case "template": case "questions": case "salary": case "jobs": str = elements[i].value; elements[i].value = str.replace(/&lt;/g,"#@!"); break; } } return true; } How can i convert this code to do with only with textarea and send all form at same time?
answer count: 0
has comment: http://stackoverflow.com/comment/38699343
has comment: http://stackoverflow.com/comment/38701002
type: Question
has comment: http://stackoverflow.com/comment/38700856
tagged with: tinyeditor
upvote count: 5
has comment: http://stackoverflow.com/comment/38701141
has comment: http://stackoverflow.com/comment/38699598
has comment: http://stackoverflow.com/comment/38699320
has comment: http://stackoverflow.com/comment/38699393
linked to: http://stackoverflow.com/q/8824511
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: How to send textarea who contains html using Jquery $.ajax

http://stackoverflow.com/q/24966304
accepted answer: http://stackoverflow.com/a/24966377
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/43077137
tagged with: angularjs
type: Question
score: 3
has title: Yeoman changing picture file names, not updating in HTML
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: yeoman
has comment: http://stackoverflow.com/comment/43075917
has answer: http://stackoverflow.com/a/24966377
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/27667892
has body: I've been building an Angular app with the help of Yeoman and I am finding it to be pretty delightful except for one small thing. When I build and deploy my project with grunt serve:dist all of the images I use are broken. This is because Yeoman is changing the filenames of every single picture but doesn't bother to update the HTML. However, it does update the CSS. For instance, if I have a picture called default_picture and I am using it in my HTML like so: &lt;img src="../images/default_picture.jpg" alt="#"&gt; When the project gets built, Yeoman changes the file name of the image from default_picture to something like default_picture.cbed2a58.jpg but the src in the img tag is never updated, so images no longer have a reference to a valid image in the directory structure. I've scoured the Yeoman project on Github and I can't seem to find the answer to this. How do I fix this so I can either update the HTML properly or just stop changing my image file names?
possible better answer: http://stackoverflow.com/a/27667892
tagged with: javascript

http://stackoverflow.com/comment/38883609
comment on: http://stackoverflow.com/a/24978954
type: AnswerComment
has text: Interesting...I'll keep it for future reference.
score: 0
type: Comment

component.io
tag name: component.io
type: Tag
tags question: http://stackoverflow.com/q/25013421

http://stackoverflow.com/comment/38890370
type: Comment
has text: better create a fiddle.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25010597

http://stackoverflow.com/q/25064494
score: 1
has title: how to get callback for telerik grid submitChanges method
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: ajax
tagged with: telerik
has answer: http://stackoverflow.com/a/25064673
downvote count: 0
type: UnansweredQuestion
tagged with: submitchanges
type: Question
has body: I am calling telerik Grid's grid.submitchanges()(FUNCTION1) in javascript which is an async call and there is one ajax synchronous callback (FUNCTION2) after FUNCTION1. The problem is sometimes FUNCTION2 is getting executed before the completion of FUNCTION1 as FUNCTION1 is Async call. But I need FUNCTION2 to execute only after completion of FUNCTION1. So Is there any way to get callback for telerik grid submitChanges(FUNCTION1)? or Can I make telerik grid submitChanges(FUNCTION1) a sync call? Code-: //FUNCTION 1 if (grid != undefined &amp;&amp; grid.hasChanges()) { grid.submitChanges(); } //FUNCTION 2 $.ajax({ url: urlForTheController, type: 'GET', async: false, cache: false, data: { TotalConAssociation: noOfRows }, success: function (data) { $('#AssociationWithDocument').data('tWindow').close(); showConcepts(currentConceptIndex); },

http://stackoverflow.com/q/25015555
downvote count: 0
tagged with: .net
score: 1
tagged with: asp.net
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/25078645
has comment: http://stackoverflow.com/comment/38899957
upvote count: 1
answer count: 1
tagged with: c#
has comment: http://stackoverflow.com/comment/38899647
tagged with: javascript
has title: JavaScript client side function not firing for ASP custom validator
has answer: http://stackoverflow.com/a/25078645
has comment: http://stackoverflow.com/comment/38900089
has body: I have the following ASP CustomValidator: &lt;asp:CustomValidator ID="CustomValidator2" runat="server" EnableClientScript="true" OnServerValidate="ins_server" ClientValidationFunction ="ins_client" ErrorMessage="CustomValidator"&gt; * Insurance dates not valid without supporting attached document&lt;/asp:CustomValidator&gt; The following C# server side function: protected void ins_server(object source, ServerValidateEventArgs args) { //new user if (PageMode == PageModes.NewVessel) { if (fuAttachment.HasFile &amp;&amp; datetimepickerinsend != null &amp;&amp; datetimepickerinsstart != null) { args.IsValid = true; } else { args.IsValid = false; } } //existing user if (PageMode == PageModes.EditVessel) { args.IsValid = true; } } And also the following client side function in JavaScript stored in a file named customfunctions.js: //declerations var insurancestart; var insuranceend; var filesattached; function ins_client(sender, e) { if (pagemode == 'EditVessel') { e.IsValid = true; } if (pagemode == 'NewVessel') { if (insurancestart !== '' &amp;&amp; insuranceend !== '' &amp;&amp; filesattached &gt; 0) { e.IsValid = true; } else { e.IsValid = false; } } } I also have the following global variable definition in the ASPX page the control sits on: &lt;script type="text/javascript"&gt; var pagemode; $(document).ready(function () { // removed var to give global scope pagemode = '&lt;%=this.PageMode.ToString()%&gt;'; }); &lt;/script&gt; My problem is I have placed a breakpoint on the server side function, every time I click the submit button the server side code is being called and the page refreshes. If I debug in chrome I can see that all my JS variables have the expected values, it just seems like for some reason the client side JS function is not firing and is instead falling over to the server side function.
type: AnsweredQuestion

http://stackoverflow.com/comment/38972505
has text: Unfortunately, after some tests, this isn't what I was looking for, as `bundles` is useful for building tools and doesn't start fetching the modules if they're not explicitly declared as dependencies somewhere.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25033553
type: Comment

http://stackoverflow.com/comment/38933306
score: 0
comment on: http://stackoverflow.com/q/24997217
has text: @pixelbits, yes, I included it as a dependency and there are no errors in console.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24991582
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24992604
tagged with: css
has comment: http://stackoverflow.com/comment/38854711
accepted answer: http://stackoverflow.com/a/24992390
favorite count: 0
has title: Change navigation font color based on background
upvote count: 2
possible better answer: http://stackoverflow.com/a/24992604
tagged with: php
has body: My problem is this. I have a fixed left navigation bar and I have to change the list font color based on the background of the section under it. The code is like this fiddle. So if the section is black and is below a link, the text is not seen. I have to change each list based on the background of a section under it so that it can be readable. html Nav list 1 Nav list 2 Nav list 3 Nav list 4 Nav list 5 section1 section2 section3 section4 section5 css .content{ position:relative; } #left_side { position:fixed; left: 20px; right: 20px; z-index:999; } .mainLeft { list-style-type:none; margin-left:0px; padding-left:0px; } .mainLeft li { padding:5px 0; } .mainLeft li a { color:#000; margin-bottom:5px; } #wrapper { position:relative; } .section { width: 100%; text-align:center; padding:150px 0; border:1px solid #666; } #section1 { background: #fff; } #section2 { background: #000; color:#fff; } #section3 { background: #fff; } #section4 { background: #000; color:#fff; } #section5 { background: #fff; } Fiddel
has answer: http://stackoverflow.com/a/24991830
linked to: http://stackoverflow.com/q/18961151
answer count: 5
has answer: http://stackoverflow.com/a/24992614
has answer: http://stackoverflow.com/a/24992390
has comment: http://stackoverflow.com/comment/38854842
score: 2
has comment: http://stackoverflow.com/comment/38854522
linked to: http://stackoverflow.com/q/1740700
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24991764
type: Question

http://stackoverflow.com/comment/38942316
has text: `declaredVariable` will be accessible only inside the *function* it was declared in. To make it accessible elsewhere (globally) you can either drop the `var` or explicitly do `window.declaredVariable = 'test';`
score: 4
comment on: http://stackoverflow.com/q/25038364
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24995202
type: Answer
answers question: http://stackoverflow.com/q/24994954
score: 0
has body: // change event $('input[type="checkbox"]').change(function() { // if we dont (!) have even 1 checkbox 'checked' if(!$('input[type="checkbox"]:checked').length) { $("li").hide(); } else { $("li").show(); } }); demo: http://jsfiddle.net/e5L37/1/

http://stackoverflow.com/comment/38880380
has text: possible duplicate of [How to make output of a select list be dependant on parent list?](http://stackoverflow.com/questions/15748968/how-to-make-output-of-a-select-list-be-dependant-on-parent-list)
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25001445

http://stackoverflow.com/comment/38826973
type: AnswerComment
has text: Interesting . Composed a basic `html` page with this content `<doctype html> Link ` , tested locally , as try at jsfiddle SO has same origin policy (see `console` at jsfiddle). Worked ok at basic html page . `css` issue ? Try above `html` in file , i.e.g., `link.html` , without style, clicking both around `link` and `link` itself ? Thanks
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24976921

http://stackoverflow.com/q/24955292
upvote count: 2
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38795755
has title: Return 0 if $sum is null (aggregation framework)
downvote count: 1
has comment: http://stackoverflow.com/comment/39361167
type: Question
linked to: http://stackoverflow.com/q/24823782
has comment: http://stackoverflow.com/comment/38794050
has comment: http://stackoverflow.com/comment/38786814
has comment: http://stackoverflow.com/comment/38793146
tagged with: javascript
has comment: http://stackoverflow.com/comment/38807685
linked to: http://stackoverflow.com/q/25039406
tagged with: mongodb
has comment: http://stackoverflow.com/comment/38792319
has body: So I'm using aggregation framework to sum some results in given time blocks. My question is how do I return count: 0 every time if there was no results in the time block. So let's say in first ten seconds my count: 7 in next ten seconds count: 2 and then if in the third time block there was nothing I would like aggregate function to return count: 0 Below simple summing operation: $group: { _id: 1, count: { $sum: 1 } } I have tried using $ifNull, but it didn't work for me: $group: { _id: 1, count: { $sum: { $ifNull: [ $count, 0 ] } } }
has comment: http://stackoverflow.com/comment/38786941
has comment: http://stackoverflow.com/comment/38790741
favorite count: 0
has comment: http://stackoverflow.com/comment/38793050
has comment: http://stackoverflow.com/comment/38786396
tagged with: aggregation-framework
has comment: http://stackoverflow.com/comment/38793739
tagged with: node.js
answer count: 0

http://stackoverflow.com/comment/38933588
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25033686
has text: Why is everyone promoting regular expressions like madness?
type: Comment

http://stackoverflow.com/comment/38880529
type: QuestionComment
comment on: http://stackoverflow.com/q/25005335
score: 0
type: Comment
has text: ` ` is for pre-formatted text. If you want to display markup in the ` ` you need to convert the markup to entities as per your example. You can either do it manually or through scripting JS or php. `html_entites(str)` in php

http://stackoverflow.com/comment/38776578
comment on: http://stackoverflow.com/a/24949716
type: AnswerComment
score: 0
type: Comment
has text: Thank you! this is what I was looking for. Do I need to include anything? It isn't working when I run it on a html file off my browser.

http://stackoverflow.com/a/24911959
type: Answer
answers question: http://stackoverflow.com/q/24910466
has comment: http://stackoverflow.com/comment/38711734
score: 0
has body: You won't be able to acheive this in a single JSP load. The JSP is a view that is evaluated and rendered on a single web request (a request correspond to the loading of your web page) If you click on a button you will then you are already on the client side and you don't have access to the database which is on the server side. You have to generate a second request (for example, instead of a button you put a submit and you put it inside a form) and you pass parameters to this request to allow the server to execute the SQL query. With this approach you won't need to inject some html in javascript. You should read more about N-tier architecture, servlets and the MVC model. The good practice is to have : a servlet (controller) that do the treatment (your sql query) and generates one or more beans. the java beans (model) that contains the data to be displayed the JSP (the view) that only displays the html with the dynamic values contained in the view This structure will help you to understand what happens really in a web application. deal with exceptions (your database access is not well coded, you have to manage exceptions and close the connection in a finally block) test your treatments without the graphical issues. you can try this link as a start http://rathinasaba.wordpress.com/2011/10/13/simple-webapplication-using-servlet-and-jsp/
has comment: http://stackoverflow.com/comment/38710225

http://stackoverflow.com/q/24956424
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24956839
linked to: http://stackoverflow.com/q/8396407
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38788151
type: Question
answer count: 2
score: 5
has comment: http://stackoverflow.com/comment/38788784
has answer: http://stackoverflow.com/a/24956506
has title: Why does my page fire "ready" event in Chrome during refresh?
linked to: http://stackoverflow.com/q/3698200
has comment: http://stackoverflow.com/comment/38788184
tagged with: google-chrome
tagged with: dom
has body: I have an HTML like this: &lt;!-- simulate a slow-loading request --&gt; &lt;script src="http://example.com:81/non-existent-script.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { alert("ready"); }) &lt;/script&gt; (see http://jsfiddle.net/mK63F/) When I open the page in Chrome, the example.com request should hang - but then, when I hit F5, the "ready" alert appears, before the page refreshes. Why does that happen? And how to distinguish that situation (i.e. refresh during page load) from "normal" page ready?
upvote count: 5

http://stackoverflow.com/comment/38766769
has text: thanks, I still do not know how to solve the problem. because after sending the file the lock is released, so another person can assess. it. Actually, The first person can write the data back after click a button(using ajax and php), at this time he can release the lock. Is it possible? Another thing is I want to lock the certain file, If a new person coming, I can give him another file, if he find the file is in using.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24943039

http://stackoverflow.com/a/24967184
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24967130
type: Answer
answers question: http://stackoverflow.com/q/24967130
has comment: http://stackoverflow.com/comment/38809559
upvote count: 1
has body: What I know the very basic difference is var User = function(name, email) is created at runtime, and function User(name, email) will be created at parse time. adding example This will work here because name is available when it parsed the file name(); function name () { console.log('My Name') } But this will throw an error called undefined is not a function But here problem was it won't be declared until it read the line var name = function(). name() var name = function(){ console.log('My Name'); }

http://stackoverflow.com/q/25013265
answer count: 3
accepted answer: http://stackoverflow.com/a/25013350
has body: Good day all. i'm starting a code review of a big project, in where the javascript code has been written by many other people than me. I have seen, at a certain moment a functon delcared like: jQuery.cookie=function(name,value,options){...} so basically, someone wants to define a function called jQuery.cookie. Now, since I can't tolerate this, I would like at least to check if jQuery.cookie (the real library) isn't present before declare this function. In this case, does: if(jQuery.cookie!== 'undefined') return true; should make the trick?
tagged with: declaration
has title: check if a jquery function has been already defined using the runtime notation definition
possible better answer: http://stackoverflow.com/a/25013320
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25013320
has answer: http://stackoverflow.com/a/25013350
has answer: http://stackoverflow.com/a/25013414
type: Question
tagged with: function
tagged with: javascript
tagged with: jquery
score: 0

http://stackoverflow.com/a/24989629
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24989570
type: Answer
score: 1
has body: You can access any of the attributes by name tpoints["Foods"] and that returns you an array of strings, in the foods case [Restaurant, Cafe, Bakery] If you want to iterate, for (var property in tpoints ) { if (tpoints.hasOwnProperty(property)) { // do stuff } }
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24989570

http://stackoverflow.com/comment/38737798
type: QuestionComment
score: 0
has text: Yeah I totally agree, It has that smell but I couldn't find where :) Thanks for your feedbacks! @Radim Köhler Thanks for that, it could be usefull to know
type: Comment
comment on: http://stackoverflow.com/q/24929233

http://stackoverflow.com/q/25062578
upvote count: 1
tagged with: javascript
tagged with: drop-down-menu
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38988770
answer count: 0
downvote count: 0
type: UnansweredQuestion
has body: I have a drop down menu that that is suppose to switch the image of the button out with a darker image. I use HTML and CSS, and onmouseover/out JavaScript. My problem in IE is that the drop down part of the menu switches images at the top of the menu, however the image is suppose to drop down and stack below the main button. It works fine in Chrome and Firefox, but I can not get to work in IE. I was going to add a couple of pictures so you can see the result in IE and Chrome together, but I can't. I have try all that I can think of and have search online for the answer, but can't find it. CSS enter code here img { border: none; } a { outline: none; } #top_nav li:hover ul { display: block; position: absolute; } #top_nav { display: block; position: relative; } #top_nav li:hover ul { display: block; position: absolute; } #top_nav { display: block; position: relative; } #top_nav ul { margin: 0px; padding: 0px; } #top_nav li { position: relative; float: left; list-style-type: none; } #top_nav ul:after { content: "."; display: block; height: 0px; clear: both; visibility: hidden; } #top_nav ul ul { position: absolute; display: none; left: 0px; width: 0px; }
score: 1
has title: Dropdown image menu not working in IE properly
has comment: http://stackoverflow.com/comment/38988350
type: Question
has comment: http://stackoverflow.com/comment/38989171

http://stackoverflow.com/comment/38889731
has text: Can you check if the mod_rewrite is actually being called via ajax and what really happens, maybe you need `/` before the controller name?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25010326
type: QuestionComment

http://stackoverflow.com/q/24965221
upvote count: 2
tagged with: eval
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24965381
type: AnsweredQuestion
downvote count: 2
has body: I am trying to use evals to run user-defined code in my HTML5/JS/CSS3 project. If the user-defined code contains an eval, I get the following error in the JS console when the code runs: Uncaught SyntaxError: Unexpected token ILLEGAL at eval(a); with the parentheses underlined. Any tips? BTW: I'm using Chrome
type: Question
has comment: http://stackoverflow.com/comment/38805151
tagged with: javascript
score: 0
answer count: 1
tagged with: web
has title: Are nested evals allowed?
favorite count: 0
has answer: http://stackoverflow.com/a/24965381

http://stackoverflow.com/q/25066815
answer count: 1
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38996895
has comment: http://stackoverflow.com/comment/38996800
has comment: http://stackoverflow.com/comment/38996768
has comment: http://stackoverflow.com/comment/38996872
has comment: http://stackoverflow.com/comment/38996918
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25067246
has comment: http://stackoverflow.com/comment/38996819
has comment: http://stackoverflow.com/comment/38997323
downvote count: 1
type: Question
tagged with: object
has title: Why is 'this' not what I expect it to be?
accepted answer: http://stackoverflow.com/a/25067246
has comment: http://stackoverflow.com/comment/38997220
tagged with: javascript
has comment: http://stackoverflow.com/comment/38997742
has comment: http://stackoverflow.com/comment/38997161
has comment: http://stackoverflow.com/comment/38996499
has body: Why is 'this' not what I expect it to be? Always thought I understood js closure pretty well and was too smart and sexy to run into a problem like this, but I'm ready to become an functional atheist... Observe the example code js Ninjas: function Drawing (id, element) { /* * Section A: value of 'this' object of type 'Drawing' (expected); * Variables I ought to have access to from any point in Drawing's invocation */ { // Preconstruction var Drawing = this; var SVG = document.createElementNS('http://www.w3.org/2000/svg', "SVG"); support.dom.Associative.call(Drawing, id, element); element = Drawing.$(); // In case element was null element.className = "Drawing"; // Things in or about the drawing var shapes = []; } function add (shape) { /* * Section B: value of 'this' Window object * What gives in this function? * Variables I have access to from section A: * element: yes, id: no, Drawing: no, SVG: yes * ?$@#$%^$#!!!!! Help me! */ if (shape instanceof Shape) { shapes.push(shape); if(!this.render) SVG.appendChild(shape.toSVG()); return shape; } } this.modify = function (options) { if (options.create) { return add(create[options.create](options)); } }; } What don't I get? function add is defined in function Drawing, and in my wild application there is no other function named or defined add `add'. The function I expect is in fact invoking, and I break inside it and see that I have access to some of the closure defined vars from Drawing's invocation, but not all or at least it seems this way. Edumucate me please maybe I'm making a silly mistake and another pair of eyes will help... I'm ready to give up on science everything I know is wrong :) Below is a cap of the spiritually offending output:
tagged with: this

http://stackoverflow.com/comment/38790719
type: AnswerComment
has text: Yes this does help. I not longer have a Group object because I renamed it Query, guess I missed one. However, I changed it to .controller('QueryCtrl', ['$scope', 'Query', function ($scope, Query) { $scope.queries = Query.query(); and it's still broken
score: 0
comment on: http://stackoverflow.com/a/24957743
type: Comment

http://stackoverflow.com/q/25037733
tagged with: javascript
has comment: http://stackoverflow.com/comment/38945226
linked to: http://stackoverflow.com/q/15173965
has body: I need to send an array from my JSP page to a Spring Controller. In my JSP I get my array full with the things I need, and then, I start an AJAX request: var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } ajaxRequest.open('POST', 'saveRecompensas.action'); ajaxRequest.send('array='+array); In the Controller: @RequestMapping ("/proyecto/saveRecompensas") public String saveRecompensas(@RequestParam ("array") String[] array, HttpSession session){ //public String saveRecompensas(){ System.out.println(Method saveRecompensas called"); return null; } As you can see, I have two methods signature. That is because, if I use the one without the @RequestParam ("array") String[] array, the method is called ok. But I need that array. If I use with the RequestParam, the method is never called. Is this the correct way to send and array from JSP to Controller? What Im doing wrong? Thank you.
has comment: http://stackoverflow.com/comment/38944496
tagged with: spring
has comment: http://stackoverflow.com/comment/38946832
type: UnansweredQuestion
type: Question
has title: Sending Javascript array to Spring Controller without jquery
score: 0
has answer: http://stackoverflow.com/a/25038181
answer count: 1
tagged with: arrays
tagged with: jsp

http://stackoverflow.com/comment/38927099
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25029156
type: Comment
has text: Can you post the json data that is actually sent over HTTP from the client to the Spring MVC controller?

http://stackoverflow.com/a/25047480
has body: You're somehow on the right track: DEMO $('#ajax-facets-selectbox-field-video-tags option').filter(function() { return /^\d+/.test( $(this).text() ); }).hide();
type: Answer
answers question: http://stackoverflow.com/q/25047280
has comment: http://stackoverflow.com/comment/38960163
score: 0

http://stackoverflow.com/q/25059449
score: 0
tagged with: custom-controls
has title: ASP .NET custom control validation is not working in Firefox or Chrome?
tagged with: validation
answer count: 1
tagged with: asp.net
has body: I use the date picker control from this link. here is the generated code for a DatePickerControl with ID="DatePicker1" and a required field validator with ID="dateValid1" &nbsp *required and the javascript code is the problem is that the validator is always not valid in Chrome and Firefox, but it works fine in IE.
accepted answer: http://stackoverflow.com/a/25060852
has comment: http://stackoverflow.com/comment/38984899
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25060852
type: Question
tagged with: c#
tagged with: javascript
has comment: http://stackoverflow.com/comment/38982188

http://stackoverflow.com/a/24949465
has comment: http://stackoverflow.com/comment/38798735
has comment: http://stackoverflow.com/comment/38798495
type: Answer
accepted answer of: http://stackoverflow.com/q/24949013
answers question: http://stackoverflow.com/q/24949013
has body: These are all the options/events/methods you can use for panels in JQM. http://api.jquerymobile.com/panel/ to open your panel $( "#mypanel" ).panel( "open" );
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/38765120
score: 0
has text: "Request failed with response: 405: Method Not Allowed" is an HTTP error message telling you that you used `GET` requests, but the server expected `POST` (or vice versa, or a different request method). Consult the documentation of the HTTP API you are trying to use.
comment on: http://stackoverflow.com/q/24924683
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38714339
comment on: http://stackoverflow.com/a/24916958
type: Comment
has text: I just modified my HTML to yours, and I made a console.log on the data which gives a correct object. Still, it shows nothing.. Hmm :)
type: AnswerComment
score: 0

unit-testing
tags question: http://stackoverflow.com/q/25002520
tags question: http://stackoverflow.com/q/24985778
tags question: http://stackoverflow.com/q/25022663
tags question: http://stackoverflow.com/q/24953218
tags question: http://stackoverflow.com/q/25039243
tags question: http://stackoverflow.com/q/24989596
type: Tag
tags question: http://stackoverflow.com/q/24995072
tags question: http://stackoverflow.com/q/25025941
tag name: unit-testing
tags question: http://stackoverflow.com/q/25001412
tags question: http://stackoverflow.com/q/24948577
tags question: http://stackoverflow.com/q/24988136
tags question: http://stackoverflow.com/q/24928454
tags question: http://stackoverflow.com/q/24960459

http://stackoverflow.com/q/24966038
accepted answer: http://stackoverflow.com/a/24966253
type: AnsweredQuestion
has body: I am making a jQuery program where when you click a part of an image map, it puts of colored version of that part directly over the part you clicked. It's basically like a coloring book type of tool. I have finally finished designing it and am not putting it into its website but am running into a very major problem. The website it centered with a width of 800px and the coloring tool is in the middle of the page below the navigation bar. When someone clicks on a part of the image, it needs to go directly on top of where they clicked. I'm not sure how to do this with the website centered when people have different browser window sizes and different monitor sizes. I can try to be more descriptive if anyone needs me to but I'm don't want to throw out so much code that this posts gets anymore confusing that it already may be. Thanks in advance. Tool that I'm talking about is here: http://www.segodevelopment.com/custom/custom.html
type: Question
has title: How can I make an image always be aligned on top of another one regardless of browser window size?
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24966686
score: 0
has answer: http://stackoverflow.com/a/24966686
answer count: 2
has answer: http://stackoverflow.com/a/24966253
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/24940119
has answer: http://stackoverflow.com/a/24946657
tagged with: ajax
type: UnansweredQuestion
score: 2
upvote count: 2
has body: I have a page with a very large table (several thousand rows). The table shows a subset of data specified by certain filters. I need the table to update whenever one of the filters changes. Basically, there are a few check boxes and a text box, whenever one of these changes I reload the table to display only those rows which fit the criteria specified by the user. I'm doing this by clearing the table and reloading the rows that match the filters. This works but has proven to be very slow. Here is my javascript code: function reloadTable() { var tablebody = document.getElementById("tablebody"); while(tablebody.hasChildNodes()) tablebody.removeChild(tablebody.firstChild); filter = new FilterChecker(); for (var i=0;i&lt;rows.length;i++) { if (filter.isVisible(rows[i])) addRowToTable(rows[i]); } } Is there a way to make it faster?
type: Question
has comment: http://stackoverflow.com/comment/38764184
has comment: http://stackoverflow.com/comment/38758370
has comment: http://stackoverflow.com/comment/38760572
has comment: http://stackoverflow.com/comment/38759089
answer count: 1
downvote count: 0
tagged with: javascript
has title: Table with large number of rows is slow to update
has comment: http://stackoverflow.com/comment/38758157
favorite count: 0

http://stackoverflow.com/q/24977180
type: Question
tagged with: mongodb
possible better answer: http://stackoverflow.com/a/24977506
tagged with: mongoose
tagged with: javascript
upvote count: 3
answer count: 2
favorite count: 0
has title: MongoDB: incorrect update count
has answer: http://stackoverflow.com/a/24977506
tagged with: node.js
type: AnsweredQuestion
score: 3
downvote count: 0
has body: In my database, I have a field called 'fruits' which is a simple array. When inserting elements in this array, I use $addToSet to only insert elements that do not exist already in this array. I want to know whether or not the element I insert really modified this field. However, the docModified parameter in the callback always returns 1 even when I try to add an element that already exists. model.update ( { username: username }, // find the document { $addToSet : { fruits: "apple" } }, // add "apple" to fruits field function (err, docModified) { console.log(docModified); // !PROBLEM: this will print "1" no matter what } ); Does anyone know why? Thanks a lot! (btw I'm using Mongoose)
has answer: http://stackoverflow.com/a/24977711
accepted answer: http://stackoverflow.com/a/24977711

http://stackoverflow.com/comment/38879529
type: QuestionComment
has text: Wow you are right, the obvious never hit me, why in the world didn't I just update...It seems to be working..Thanks.
type: Comment
comment on: http://stackoverflow.com/q/24920106
score: 0

http://stackoverflow.com/comment/38908165
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25019735
has text: Cool, thanks. The [scope docs](https://developers.google.com/+/api/oauth#login-scopes) don't really seem to suggest that this will work, but it does.
score: 0

http://stackoverflow.com/comment/38744724
type: QuestionComment
comment on: http://stackoverflow.com/q/24932829
score: 0
has text: as you can check on `success` and `error` calls to see what is going on
type: Comment

http://stackoverflow.com/comment/38769192
type: Comment
has text: so the problem was that I needed to store the result of sen.split(' ') in a variable. Got it!
comment on: http://stackoverflow.com/a/24945884
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38827877
comment on: http://stackoverflow.com/q/24977456
score: 3
type: Comment
type: QuestionComment
has text: `while(1){}` works in almost all programming languages.

http://stackoverflow.com/q/25032130
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/245062
linked to: http://stackoverflow.com/q/2977041
upvote count: 1
has answer: http://stackoverflow.com/a/25032191
has title: id to fields in jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25032624
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38930845
has body: I have a table and I have multiple text boxes in a column.I am add rows to the table using jquery clone method var row = $('#nameTable tbody&gt;tr:last').clone(true); Now I want to add ids to the text fields of the new row. Any help?
has comment: http://stackoverflow.com/comment/38930922
answer count: 4
downvote count: 0
score: 1
type: Question
has answer: http://stackoverflow.com/a/25032157
has answer: http://stackoverflow.com/a/25032819

recursion
type: Tag
tags question: http://stackoverflow.com/q/24915428
tag name: recursion
tags question: http://stackoverflow.com/q/25021146
tags question: http://stackoverflow.com/q/25050876
tags question: http://stackoverflow.com/q/24961131
tags question: http://stackoverflow.com/q/24992000

http://stackoverflow.com/a/25052017
answers question: http://stackoverflow.com/q/25051796
type: Answer
score: 3
upvote count: 3
has body: Approach 1. On each iteration ngRepeat creates a new child scope. You can refer current one with this keyword in corresponding controller method. For example: $scope.show = function() { this.showThis = true; }; And that will make a trick. Demo: http://plnkr.co/edit/857DsN6EYI21sEvn15Ul?p=preview Approach 2. You just pass current student reference to show method and set its showThis property: {{stu.name}} {{stu.age}} show Hello {{stu.name}} And in controller: $scope.show = function(student) { student.showThis = true; }; Demo: http://plnkr.co/edit/F3yKm4kiq2HDZGe9aF6W?p=preview
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25051796

http://stackoverflow.com/a/62418466
has body: Use this: https://github.com/mozilla/source-map sourceMap.SourceMapConsumer will translate the line numbers from source-mapped to original.
answers question: http://stackoverflow.com/q/24970653
score: 0
type: Answer

http://stackoverflow.com/comment/38831602
type: QuestionComment
has text: You are violating html all over the place, id's has be unique, stop floating everything left, everything is naturally placed from left to right. The problem is your display: none; is on the outer div, but you are changing the buttons in js. So get rid of all the extra junk and it's easier not to select the wrong elements :) Event attributes are lowercase, and put the onchange event on the select item which is the one you expect a change from. I think that should get you started :)
comment on: http://stackoverflow.com/q/24979316
score: 0
type: Comment

http://stackoverflow.com/q/24932034
has answer: http://stackoverflow.com/a/24932275
favorite count: 0
has comment: http://stackoverflow.com/comment/38742140
has body: how to change string $V3FTD to other string can you show me example ...i try use this str_replace but not working
score: -3
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38742152
downvote count: 3
accepted answer: http://stackoverflow.com/a/24932275
type: Question
has comment: http://stackoverflow.com/comment/38742394
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38742479
has title: how to change string $V3FTD to other string can you show me example
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/comment/38803334
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24964208
has text: Sorry if I wasn't clear, the right one has always worked, it's the left one that doesn't. The strange thing is that they have essentially the same css just with left and right switched, so theres no reason one should work and the other shouldn't.
type: AnswerComment

http://stackoverflow.com/comment/38912406
has text: I think i'm doing something wrong, because, when I execute it, it download the document (same as I use wget), instead of requesting the answer. For example, if I do: `code` request.post('http://service.com/upload', {form:{key:'value'}} I expect not to download source code. Just the respones, as if my nodejs app were a "browser"
type: Comment
comment on: http://stackoverflow.com/a/25020681
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38837511
comment on: http://stackoverflow.com/a/24982530
has text: @EmyleeEsteban if that's the case what you're trying to achieve will not work http://jsbin.com/mehupe/6/edit The second main thumbnail has 3 images in array, but after you click "ONE", "TWO" will show only 2 images. So if that's what you're trying to build it's wrong. I might suggest another way... and **that simply not to have any thumbnails on page load. Click on an image will create them (after removing existent ones)**
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25040862
favorite count: 0
has comment: http://stackoverflow.com/comment/38947276
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
duplicate of: http://stackoverflow.com/q/10984771
has comment: http://stackoverflow.com/comment/38947206
downvote count: 0
answer count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38947526
linked to: http://stackoverflow.com/q/9336778
has title: CSS3 vs Javascript/jQuery
has comment: http://stackoverflow.com/comment/38947176
linked to: http://stackoverflow.com/q/10984771
has comment: http://stackoverflow.com/comment/38947359
has comment: http://stackoverflow.com/comment/38947213
has comment: http://stackoverflow.com/comment/38947220
tagged with: javascript
has comment: http://stackoverflow.com/comment/38947221
has comment: http://stackoverflow.com/comment/38948573
has comment: http://stackoverflow.com/comment/38947273
upvote count: 1
tagged with: jquery
has body: I am making some Web Apps that need a quick response and have a significantly tight refreshing time. All I want is to save memory and CPU Load. My Question is: Which is prefferable CSS or Javascript/jQuery in styling things like: Visibility Animation I mean both are achievable from both respects and both seem ok. But I would like to be effective from the Structure. Any help will be appreciable. Please be honest with the core-level reason if possible. Thanks. And to those who marked this question duplicate: I am not looking for iPad Native Systems only. I am looking all aproaches.

http://stackoverflow.com/comment/38993532
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25065319
has text: No worries, you can mark this one as answer. I was too busy/lazy to create one. :)

http://stackoverflow.com/comment/38883850
score: 2
type: Comment
has text: Hi! Can we see your HTML?
type: QuestionComment
comment on: http://stackoverflow.com/q/25007169

http://stackoverflow.com/comment/39003302
comment on: http://stackoverflow.com/q/25069594
has text: the top div resizes on resizing the window, will changing the margin from % to fixed value work in that case?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38984495
score: 0
comment on: http://stackoverflow.com/q/25060507
type: Comment
type: QuestionComment
has text: you should check this http://stackoverflow.com/questions/13670579/how-to-replace-and-append-with-javascript

http://stackoverflow.com/comment/38967681
type: Comment
has text: Go to your browser console, and paste the error, if this is a CORS problem, you might have to tinker with your Apache server configuration to allow Cross Domain Access.
comment on: http://stackoverflow.com/a/25050953
score: 0
type: AnswerComment

http://stackoverflow.com/q/25006813
has answer: http://stackoverflow.com/a/25006862
has title: onclick html and jquery doesn't work
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25006837
downvote count: 1
has body: I have a problem with my jQuery and html code, when I click in the element that contains the onclick event nothing happens. This is the html code Cabana 49 Minutes ago content here This is the JS code, when I use this code nothing happens function actus(b){ $(".actus"+b).hide(); } But when I do this the code alerts the value 122 and works fine function actus(b){ alert('122'); } I already debugged it. I'm using the latest version of Chrome and jquery-1.9.1.min.js
type: Question
has comment: http://stackoverflow.com/comment/38883036
upvote count: 0
has comment: http://stackoverflow.com/comment/38883121
has comment: http://stackoverflow.com/comment/38883162
tagged with: javascript
tagged with: jquery
score: -1
has comment: http://stackoverflow.com/comment/38883077
possible better answer: http://stackoverflow.com/a/25006850
answer count: 3
has answer: http://stackoverflow.com/a/25006850
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38883059
has answer: http://stackoverflow.com/a/25006837
favorite count: 0

http://stackoverflow.com/q/25054012
has answer: http://stackoverflow.com/a/25054103
tagged with: web-services
has body: I tried to call GetCityWeatherByZIP from Weather.asmx web service and get Uncaught SyntaxError: Unexpected token < error. Can anyone advise on this issue?
has answer: http://stackoverflow.com/a/25054040
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38973130
upvote count: 0
has comment: http://stackoverflow.com/comment/38975764
tagged with: javascript
tagged with: jquery
score: -1
answer count: 2
has comment: http://stackoverflow.com/comment/38975825
favorite count: 0
has title: Uncaught SyntaxError: Unexpected token < error when calling external web service in Javascript
has comment: http://stackoverflow.com/comment/38975745
has comment: http://stackoverflow.com/comment/38973368
type: UnansweredQuestion

odata
tag name: odata
type: Tag
tags question: http://stackoverflow.com/q/24950922
tags question: http://stackoverflow.com/q/25043803

http://stackoverflow.com/comment/65101968
has text: @Moritur Awesome, you have my blessing to do whatever you want with this code, I really encourage you to make a library. Hopefully someone else will improve it for newer versions of PDF
score: 1
type: Comment
comment on: http://stackoverflow.com/a/25034254
type: AnswerComment

http://stackoverflow.com/q/25033754
tagged with: vaadin7
upvote count: 1
answer count: 1
tagged with: vaadin
has answer: http://stackoverflow.com/a/25036197
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25036197
has body: I have a TextField component and added ValueChangeListener on it. @Theme("myTheme") @SuppressWarnings("serial") @Title("VaadinTest") @PreserveOnRefresh @JavaScript({ "vaadin://js/jquery/jquery-1.10.1.min.js", "vaadin://js/test.js" }) public class HelloWorldUI extends UI { @Override protected void init(VaadinRequest request) { final VerticalLayout layout = new VerticalLayout(); final TextField txtName = new TextField(); txtName.setId("test"); txtName.setImmediate(true); txtName.addValueChangeListener(new ValueChangeListener() { @Override public void valueChange(final ValueChangeEvent event) { System.out.println(txtName.getValue()); } }); layout.addComponent(txtName); Button btnOK = new Button("OK"); btnOK.addClickListener(new ClickListener() { public void buttonClick(ClickEvent event) { Page.getCurrent().getJavaScript().execute("doSomething()"); } }); layout.addComponent(btnOK); setContent(layout); } } And at my js file (test.js) function doSomething() { $('input#test').val("John").change(); } But I never get the ValueChangeEvent , I mean I never get the console log for text John. What am I missing ? Or can It be possible to trigger component's event by javascript ?
type: Question
type: AnsweredQuestion
score: 1
favorite count: 0
has title: Vaadin : How to trigger change events by javascript?

http://stackoverflow.com/q/25042309
upvote count: 5
has body: Here is the warning i get when i run grunt in my yeoman generated angular project: Running "cdnify:dist" (cdnify) task Going through dist/404.html, dist/index.html to update script refs Warning: Arguments to path.join must be strings Use --force to continue. Aborted due to warnings. Here are the versions I'm running: grunt-cli v0.1.13 grunt v0.4.5 node v0.10.29 npm 2.0.0-alpha-5 yeoman 1.2.1 Here are the contents of my grunt.js file: // Generated on 2014-07-28 using generator-angular 0.9.5 'use strict'; // # Globbing // for performance reasons we're only matching one level down: // 'test/spec/{,*/}*.js' // use this if you want to recursively match all subfolders: // 'test/spec/**/*.js' module.exports = function (grunt) { // Load grunt tasks automatically require('load-grunt-tasks')(grunt); // Time how long tasks take. Can help when optimizing build times require('time-grunt')(grunt); // Configurable paths for the application var appConfig = { app: require('./bower.json').appPath || 'app', dist: 'dist' }; // Define the configuration for all the tasks grunt.initConfig({ // Project settings yeoman: appConfig, // Watches files for changes and runs tasks based on the changed files watch: { bower: { files: ['bower.json'], tasks: ['wiredep'] }, js: { files: ['&lt;%= yeoman.app %&gt;/scripts/{,*/}*.js'], tasks: ['newer:jshint:all'], options: { livereload: '&lt;%= connect.options.livereload %&gt;' } }, jsTest: { files: ['test/spec/{,*/}*.js'], tasks: ['newer:jshint:test', 'karma'] }, styles: { files: ['&lt;%= yeoman.app %&gt;/styles/{,*/}*.css'], tasks: ['newer:copy:styles', 'autoprefixer'] }, gruntfile: { files: ['Gruntfile.js'] }, livereload: { options: { livereload: '&lt;%= connect.options.livereload %&gt;' }, files: [ '&lt;%= yeoman.app %&gt;/{,*/}*.html', '.tmp/styles/{,*/}*.css', '&lt;%= yeoman.app %&gt;/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}' ] } }, // The actual grunt server settings connect: { options: { port: 9000, // Change this to '0.0.0.0' to access the serve…
tagged with: javascript
tagged with: gruntjs
score: 4
has answer: http://stackoverflow.com/a/25165042
answer count: 1
has comment: http://stackoverflow.com/comment/38954605
tagged with: yeoman
favorite count: 0
tagged with: npm
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39179022
tagged with: bower
has comment: http://stackoverflow.com/comment/39083440
has comment: http://stackoverflow.com/comment/38955927
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39042785
has title: Grunt fails at cdnify with warning: "Warning: Arguments to path.join must be strings"?

http://stackoverflow.com/q/24990531
accepted answer: http://stackoverflow.com/a/24995249
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38860807
tagged with: javascript
tagged with: google-maps-api-3
answer count: 1
has answer: http://stackoverflow.com/a/24995249
has title: V3 maps poly line blocking click listener
has comment: http://stackoverflow.com/comment/38852447
has body: I have a map and a couple of listeners, One click listener for drawing points of a poly line and one mousemove listener for the poly line to follow (guide) the user to the next point but the trouble is when the PolyLine is directly underneath the cursor preventing the map from receiving the click listener. I'm not sure if this is great design/execution or an edge case for Google Maps. Is there any way that I can get the click regardless of the poly underneath the cursor? // Listen for mouse stuff. google.maps.event.addListener($scope.googleMapsInstance, 'click', function($event) { // Do something different at each stage switch (MyService.currentStage) { case MyService.stages.IDLE: // Abort any previous attempts. if (guide instanceof guideDrawing) { guide.abort(); guide = null; } // Begin drawing poly line. guide = new guideDrawing($event.latLng); // Update the current stage. MyService.currentStage = MyService.stages.APEX_GUIDE_START; break; case MyService.stages.GUIDE_START: // Update the stage MyService.currentStage = MyService.stages.GUIDE_END; // Send the new coordinates guide.finish($event.latLng); break; } }); // Update the poly line with the mouse. google.maps.event.addListener($scope.googleMapsInstance, 'mousemove', function($event) { // If we haven't started, just exit; if (!guide || MyService.currentStage !== MyService.stages.GUIDE_START) { return; } // Send the new coordinates guide.update($event.latLng); // Draw the polyline. guide.draw($scope.googleMapsInstance); });
type: AnsweredQuestion
score: 0

ms-word
tags question: http://stackoverflow.com/q/25030547
tags question: http://stackoverflow.com/q/24957058
tag name: ms-word
type: Tag

http://stackoverflow.com/a/25050465
downvote count: 0
has body: I don't think it's worth it. The expensive part is selecting the elements, which your code always does once in the if statement condition. Worse, it does this when the page loads, which is arguably the least ideal time to be doing a lot of heavy lifting. The actual binding and then dispatching of the click events, which is what your code tries to optimize out, is relatively cheap since your event handler will never actually be dispatched to, and the call to "on" doesn't immediately evaluate the selector expression, so it's actually a pretty cheap operation. More importantly, your optimization results in more code, and all of the ongoing maintenance expenses that go along with those extra checks. That said, if you really want to do those extra checks, and if this is a pattern you think you'll use in a lot of places, instead of adding a bunch of if statements throughout your code, consider writing a small function that does it for you: function attachGlobalEvent(eventName, selector, handler) { if ($(selector).length &gt; 0) $(document).on(eventName, selector, handler); } I still think that this is going to be a bit slower than not having it in a bit too many cases, but at least it won't result in as much code. Just be aware that your handler won't be called if the first matching element isn't added to the DOM until after the event-attaching code is executed, which is usually why you'd attach the event indirectly like this to begin with.
type: Answer
score: 1
answers question: http://stackoverflow.com/q/25050270
upvote count: 1

http://stackoverflow.com/q/25033213
has answer: http://stackoverflow.com/a/25033616
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38932828
has answer: http://stackoverflow.com/a/25036736
has title: How to scroll to top of parent iframe pressing a button inside iframe?
tagged with: jquery
has comment: http://stackoverflow.com/comment/38933616
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38933106
has comment: http://stackoverflow.com/comment/38932685
tagged with: iframe
type: Question
has comment: http://stackoverflow.com/comment/38932908
has body: The page is from eBay listings. This is the main sctructure: &lt;html&gt; &lt;body&gt; &lt;iframe src="http://vi.vipr.ebaydesc.com/" /&gt; &lt;/body&gt; The main html location is ebay.co.uk and the iframe is from another domain. Inside of iframe i have a button #totop and on press I want the main html to scroll to top of page, not the iframe content. This is possible?
tagged with: javascript

http://stackoverflow.com/comment/38944174
type: QuestionComment
comment on: http://stackoverflow.com/q/25039205
has text: Do you mean that it's continuing through the program without waiting for the call to complete? And if it is, would a do{}while(stepResults.length==0) solve it?
score: 0
type: Comment

http://stackoverflow.com/comment/38886428
type: QuestionComment
comment on: http://stackoverflow.com/q/25008570
has text: Also, know that in your case `alert()` will pop only once. Same for `print()`
score: 0
type: Comment

http://stackoverflow.com/a/24930237
type: AcceptedAnswer
has body: DEMO You need to add this code to make x-axis label clickable with formatting (underline): (function (H) { //For X-axis labels H.wrap(H.Point.prototype, 'init', function (proceed, series, options, x) { var point = proceed.call(this, series, options, x), chart = series.chart, tick = series.xAxis &amp;&amp; series.xAxis.ticks[x], tickLabel = tick &amp;&amp; tick.label; //console.log("series"); //console.log(series); console.log("Point = "); console.log(point); if (point.drilldown) { if (tickLabel) { if (!tickLabel._basicStyle) { tickLabel._basicStyle = tickLabel.element.getAttribute('style'); } tickLabel.addClass('highcharts-drilldown-axis-label').css({ 'text-decoration': 'underline', 'font-weight': 'normal', 'cursor': 'pointer', 'color':'brown' }).on('click', function (){ //alert('clicked'); //point.doDrilldown(); point.firePointEvent('click'); }); } } else if (tickLabel &amp;&amp; tickLabel._basicStyle) { } return point; }); })(Highcharts);
downvote count: 0
has comment: http://stackoverflow.com/comment/38743732
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38740042
has comment: http://stackoverflow.com/comment/38739833
answers question: http://stackoverflow.com/q/24926241
has comment: http://stackoverflow.com/comment/38741202
has comment: http://stackoverflow.com/comment/38744316
has comment: http://stackoverflow.com/comment/38743921
accepted answer of: http://stackoverflow.com/q/24926241

http://stackoverflow.com/comment/38743150
type: Comment
type: QuestionComment
score: 0
has text: @Bewusstsein While it's true that the FileSystem API is abandoned elsewhere, File API is in no way a replacement. They have very different roles.
comment on: http://stackoverflow.com/q/24930403

http://stackoverflow.com/a/24976910
has comment: http://stackoverflow.com/comment/38826895
answers question: http://stackoverflow.com/q/24976858
downvote count: 0
score: 1
has body: Use JQuery's .data() function. First you can grab the td element via jQuery: var el = $("#ctl00_cphRoblox_lstItemsForResale_ctrl1_Td1"); Then find it's first child element and use use .data() to return the expected-price data attribute's value: alert(el.find('&gt; div').data('expected-price')); jsFiddle
type: AcceptedAnswer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24976858
type: Answer

http://stackoverflow.com/comment/38923856
type: Comment
comment on: http://stackoverflow.com/a/25028046
has text: @sarbbottam You may want to add a radix to the `parseInt` calls (for posterity)
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38946211
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25039645
has text: no errors. all works, content are downloaded, tags all are correct. Problem only that new style is not apllied. No errors in error window

http://stackoverflow.com/q/24909805
answer count: 1
tagged with: javascript
favorite count: 0
has title: analytics call as last after page load.(AngularJS)
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
has body: How do i make sure that analytics call goes as a last item after page load in Single page application? I tried using $viewContentLoaded but it gets triggers before the page fetches services and load data. $scope.$on('$viewContentLoaded', function () { }
tagged with: angular-ui-router
has answer: http://stackoverflow.com/a/24910310
score: 1
type: Question
downvote count: 0

http://stackoverflow.com/comment/38989341
type: Comment
type: QuestionComment
has text: Is that *really* the JSON you get? You need to quote your keys with double quotes, *ALSO* you are missing commas!
score: 2
comment on: http://stackoverflow.com/q/25063169

http://stackoverflow.com/a/25049333
accepted answer of: http://stackoverflow.com/q/25049278
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25049278
has body: You just need to make sure that groups[i] is setup as an array before you try and add 2nd level elements to the array. $.noConflict(); var sections = document.getElementsByClassName('section'); var groups = new Array(); for (i = 0; i &lt; sections.length; i++) { var section = sections[i]; var sectionID = section.id; groups[i] = []; var j = 0; jQuery.each(jQuery("#" + sectionID + " .lineitem"), function () { groups[i][j] = jQuery(this).attr('id'); j++; }); } console.log(groups);
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/38830847
has text: appreciate the comment.. I fixed that.. any advice about the rest?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24979019
score: 0

http://stackoverflow.com/comment/38929005
type: Comment
type: QuestionComment
score: 0
has text: @IlyaLuzyanin thanks collapse() worked.
comment on: http://stackoverflow.com/q/25030789

http://stackoverflow.com/comment/38735084
has text: Delegated event handling really should use a parent object as close as possible to the dynamic element, not something as far away as `body` or `document`. In fact, `.live()` was removed from jQuery because it put everything on the `document` object and that can cause performance issues.
type: Comment
comment on: http://stackoverflow.com/a/24928080
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38782016
type: Comment
type: QuestionComment
has text: RTFM? Settings: `overlayClose`; default: `true`; If false, disables closing Colorbox by clicking on the background overlay.
comment on: http://stackoverflow.com/q/24952966
score: 0

http://stackoverflow.com/a/25005951
answers question: http://stackoverflow.com/q/25003280
has comment: http://stackoverflow.com/comment/39178213
type: AcceptedAnswer
has body: Here's my take on your questions: The request parameter is for you to access everything that is part of the request/call to your cloud function, it includes the parameters passed (request.params), the User that is authenticated on the client (request.user) and some other things you can learn about in the documentation. The response is for you to send information back to the calling code, you generally call response.success() or response.error() with an optional string/object/etc that gets included in the response, again documentation here. That's a way of creating an instance of a User, which because it is a special internal class is named _User instead, same with _Role and _Installation. It is creating an instance of the user with an ID, not creating a new one (which wouldn't have an ID until saved). When you create an object this way you can "patch" it by just changing the properties you want updated. Again, look at the documentation or an example, the first parameter is the column name (it will be created if it doesn't exist), the second value is what you want that column set to. You have to do Parse.Cloud.useMasterKey() when you need to do something that the user logged into the client doesn't have permission to do. It means "ignore all security, I know what I'm doing". You're seeing a promise chain, each step in the chain allows you to pass in a "success" handler and an optional "error" handler. There is some great documentation. It is super handy when you want to do a couple of things in order, e.g. Sample code: var post = new Parse.Object('Post'); var comment = new Parse.Object('Comment'); // assume we set a bunch of properties on the post and comment here post.save().then(function() { // we know the post is saved, so now we can reference it from our comment comment.set('post', post); // return the comment save promise, so we can keep chaining return comment.save(); }).then(function() { // success! response.success(); }, function(error) { // uh oh! // this ca…
type: Answer
score: 11
has comment: http://stackoverflow.com/comment/38883905
downvote count: 0
has comment: http://stackoverflow.com/comment/75599618
accepted answer of: http://stackoverflow.com/q/25003280
upvote count: 11

http://stackoverflow.com/q/24937212
has answer: http://stackoverflow.com/a/67593379
tagged with: javascript
tagged with: mocha.js
answer count: 6
has answer: http://stackoverflow.com/a/60261786
has answer: http://stackoverflow.com/a/29222051
has answer: http://stackoverflow.com/a/58034943
has body: I am working in node.js. My app interacts with Redis via the node_redis module. I'm using mocha and sinon to automate testing of my app. My app looks something like this: ...snip var redisClient = redis.createClient(redisPort, redisHost); var someValue = redisClient.get("someKey"); return someValue; .... I want to stub the call to redisClient.get(). To do this I also need to stub the call to redis.createClient() - I think... Here's my test code: ... var redis = require("redis"); var redisClient; ... sinon.stub(redisClient, 'get').returns("someValue"); sinon.stub(redis, "createClient").returns(redisClient); ... assert.equal(redis_client_underTest.call_to_redis(), "someValue"); ... The test fails with AssertionError: false == "someValue" How do I stub out redisClient, or is this even possible?
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/57382287
tagged with: redis
type: UnansweredQuestion
tagged with: sinon
has answer: http://stackoverflow.com/a/56957472
tagged with: node.js
has title: Stubbing Redis interactions in javascript using Sinon
upvote count: 14
type: Question
score: 14

http://stackoverflow.com/q/24944023
upvote count: 1
has body: I'm trying to achieve a strike/line through old price (P1) if there is a sale price (P5) I think i'm pretty close, maybe somewhere along the else part that's stopping it from putting the line through old price if there isn't a sale price. &lt;script type="text/javascript"&gt; if(jq('.spn_P5')){ jq('.spn_P1').wrap("&lt;strike&gt;"); } else{ if(jq('.spn_P5:empty')){ jq('.spn_P1').unwrap("&lt;strike&gt;"); } } &lt;/script&gt; http://oi59.tinypic.com/359hl61.jpg As you can see it is still applying the line through in the 2nd and 3rd product. Could someone please assist. Many Thanks.
downvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24944297
has comment: http://stackoverflow.com/comment/38765758
has comment: http://stackoverflow.com/comment/38765982
has comment: http://stackoverflow.com/comment/38765943
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38766306
has title: Line through price 1 if price 5 is set javascript
has comment: http://stackoverflow.com/comment/38765914
tagged with: javascript
has comment: http://stackoverflow.com/comment/38766238
favorite count: 0
has comment: http://stackoverflow.com/comment/38765766
score: 0
possible better answer: http://stackoverflow.com/a/24944098
accepted answer: http://stackoverflow.com/a/24944297
has answer: http://stackoverflow.com/a/24944098
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24984648
has comment: http://stackoverflow.com/comment/38841575
answer count: 1
tagged with: selenium-webdriver
tagged with: java
has body: I am trying to highlight an element. I want the highlight to remain for around 5-6 seconds but I'm not able to do so. The code for highlighting is working fine but it appears only for a flash. I tried achieving this using thread.sleep(), but couldn't achieve it. Can I define a conditional wait for such highlight using Explicit wait or any other method. Here is the code for highlighting the element : import java.util.Set; import java.util.concurrent.TimeUnit; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; public class HighlightElement { public WebDriver driver; private String baseUrl; public static void main(String[] args) { HighlightElement obj=new HighlightElement(); obj.func(); // TODO Auto-generated method stub } public void func(){ driver=new FirefoxDriver(); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); baseUrl="http://www.creativebloq.com/netmag/get-started-django-7132932"; driver.get(baseUrl); WebElement ele=driver.findElement(By.xpath("//*[@id='main- content']/section/article/div/div/figure[1]/img")); highlightElement(driver, ele); try { Thread.sleep(5000); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } public void highlightElement(WebDriver driver, WebElement element) { for (int i = 0; i &lt; 2; i++) { JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, "color: yellow; border: 2px solid yellow;"); js.executeScript("arguments[0].setAttribute('style', arguments[1]);", element, ""); }} } I also tried using the sleep method within the highlighElement(), but it is also not serving the purpose.
accepted answer: http://stackoverflow.com/a/24987167
has title: Waiting for a few seconds after highlighting an element using Webdriver
type: AnsweredQuestion
tagged with: javascript
has comment: http://stackoverflow.com/comment/38848422
type: Question
has answer: http://stackoverflow.com/a/24987167
score: 0
tagged with: selenium

http://stackoverflow.com/q/24976114
tagged with: d3.js
upvote count: 3
type: UnansweredQuestion
tagged with: calendar
type: Question
score: 3
has title: Cal-Heatmap display day with hours from 9-5 only
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: visualization
has body: I have been using Cal-Heatmap to create a calendar. I am doing something like this to visualize 24 hours of a day. I would like to only visualize the hours between 9am and 5pm on that day. Is there any way to do this through cal-heatmap? var date = new Date(2000, 0, 5) var day = new CalHeatMap(); day.init({ itemSelector: "#day", domain: "day", subDomain: "x_hour", data: "dates-years.json", start: date, cellSize: 40, range: 1, legend: [2, 4, 6, 8] })
tagged with: heatmap
answer count: 0

http://stackoverflow.com/comment/38776380
has text: Thanks, we actually found the root cause of it. Snare.js injects a flash object in this html page when it loads. In IE once you tab (focus) to this flash object, you can never get out of it. We resolved it using jQuery by disabling this flash object.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24945031

http://stackoverflow.com/a/66317921
score: 9
type: Answer
downvote count: 1
upvote count: 10
answers question: http://stackoverflow.com/q/24998624
has body: let weekday = new Date(dateString).toLocaleString('en-us', {weekday:'long'}); console.log('Weekday',weekday);

http://stackoverflow.com/comment/38750074
score: 0
has text: encoding type of Page. There are two selection. With BOM or without BOM. Choose utf8 without BOM. You can do it by notepad++
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24935878

http://stackoverflow.com/comment/38854076
score: 0
comment on: http://stackoverflow.com/q/24960265
type: Comment
type: QuestionComment
has text: Hmm it's likely that the browser is dropping the frame rate to deal with the large reflows/draws. Have you tried using css 3D translate on your content with an overflow container for clipping? Will move your content to the GPU layer for processing. Might work better or could work exactly the same depending on where the exact bottleneck is... Incidentally 2D translate moves the content between the CPU and GPU layer depending on wether it's animating or not, which is a bit of a lag monster( so use the 3D one!!).

http://stackoverflow.com/a/25065812
accepted answer of: http://stackoverflow.com/q/25065729
type: AcceptedAnswer
downvote count: 0
has body: The problem is not how you return the promise, or set the promise.action; it's how you pass the promise.action function to angular.extend; you're passing the function reference, so when you later update promise.action (to point to a new function reference), your extended object is still pointing to the old function reference. Instead, you could do something like this; angular.extend({}, DataTemplates.headerContextualTab, { id: 'people', label: 'People', classes: 'icon-group', count: 0, action: function () { return promise.action.apply(this, arguments); }, filter: filter, sort: sort, viewModes: viewModes })); This way, as it holds a reference to promise instead, it will always be able to resolve to the current value of promise.action. Using Function.prototype.apply() lets you forward the arguments passed to the action method to the promise.action method.
type: Answer
has comment: http://stackoverflow.com/comment/38994694
upvote count: 1
answers question: http://stackoverflow.com/q/25065729
score: 1

http://stackoverflow.com/a/25057304
answers question: http://stackoverflow.com/q/24970416
type: Answer
has comment: http://stackoverflow.com/comment/39090100
has body: You're looking for div collision detection. If you want to raise an event, you have to repeatedly test, but it would be be better just to run the function over all your divs. The sample demo is at http://jsfiddle.net/nGRwt/7/ Here is the function you need to use function collision($div1, $div2) { var x1 = $div1.offset().left; var y1 = $div1.offset().top; var h1 = $div1.outerHeight(true); var w1 = $div1.outerWidth(true); var b1 = y1 + h1; var r1 = x1 + w1; var x2 = $div2.offset().left; var y2 = $div2.offset().top; var h2 = $div2.outerHeight(true); var w2 = $div2.outerWidth(true); var b2 = y2 + h2; var r2 = x2 + w2; if (b1 &lt; y2 || y1 &gt; b2 || r1 &lt; x2 || x1 &gt; r2) return false; return true; } Another Demo You can also refer to http://jsfiddle.net/98sAG/ for collison detection. For this use below code : var overlaps = (function () { function getPositions( elem ) { var pos, width, height; pos = $( elem ).position(); width = $( elem ).width(); height = $( elem ).height(); return [ [ pos.left, pos.left + width ], [ pos.top, pos.top + height ] ]; } function comparePositions( p1, p2 ) { var r1, r2; r1 = p1[0] &lt; p2[0] ? p1 : p2; r2 = p1[0] &lt; p2[0] ? p2 : p1; return r1[1] &gt; r2[0] || r1[0] === r2[0]; } return function ( a, b ) { var pos1 = getPositions( a ), pos2 = getPositions( b ); return comparePositions( pos1[0], pos2[0] ) &amp;&amp; comparePositions( pos1[1], pos2[1] ); }; })(); Hope this will help you :)
has comment: http://stackoverflow.com/comment/39026358
downvote count: 1
has comment: http://stackoverflow.com/comment/39093297
score: -1
upvote count: 0
has comment: http://stackoverflow.com/comment/39085452

http://stackoverflow.com/comment/39098135
score: 0
has text: @mutt: I have made a workaround. As Select object did not see any of actual dropdownlist values, but WebElement itself is visible, so in that one place I did: *if (webDriver instanceof InternetExplorerDriver)* {keyTypeInput.click();keyTypeInput.sendKeys(Keys.ARROW_DOWN);}
comment on: http://stackoverflow.com/q/25067716
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38760446
has text: A little imagination for ondragend... position relative only change the style.top
score: 1
comment on: http://stackoverflow.com/q/24941344
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38771557
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24947165
type: Comment
has text: Hi PHPglue, I've changed it back to Jquery and call it using the button with onclick="changeStyle()" but it just does the same thing.

http://stackoverflow.com/comment/38842917
type: AnswerComment
comment on: http://stackoverflow.com/a/24979326
has text: You're awesome sir, this indeed did the trick. Thanks for explaining it in a lot more detail, that really makes sense to me. Awsome!
type: Comment
score: 0

http://stackoverflow.com/comment/38753482
has text: @IanPennebaker -- Yep
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24937376
score: 1

http://stackoverflow.com/q/25068719
has comment: http://stackoverflow.com/comment/39000666
tagged with: javascript
has answer: http://stackoverflow.com/a/25068968
has title: body overflow:visible on pop up close
has body: This is JS function to show pop up contact form: function check_empty(){ if(document.getElementById('name').value == "" || document.getElementById('email').value == "" ||document.getElementById('msg').value == "" ){ alert ("Fill All Fields !"); } else { document.getElementById('form').submit(); alert ("Form submitted successfully..."); } } //function to display Popup function div_show(){ document.getElementById('abc').style.display = "block"; document.body.style.overflow = "hidden"; } //function to check target element function check(e){ var target = (e && e.target) || (event && event.srcElement); var obj = document.getElementById('abc'); var obj2 = document.getElementById('popup'); checkParent(target)?obj.style.display='none':null; target==obj2?obj.style.display='block':null; } //function to check parent node and return result accordingly function checkParent(t){ while(t.parentNode){ if(t==document.getElementById('abc')) { return false } else if(t==document.getElementById('close')) { return true } t=t.parentNode } return true } When popup load document.body.style.overflow = "hidden"; deactivate overflow. Now i want to set document.body.style.overflow = "visible"; on close button click (when i close pop up). Close button is defined in html for as : Is it possible ? Here is full html form: Contact Us Send
score: 0
has comment: http://stackoverflow.com/comment/39000419
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25068968
type: AnsweredQuestion
tagged with: forms
type: Question

http://stackoverflow.com/comment/38904134
type: QuestionComment
has text: Please provide a [Minimal, Complete, Tested and Readable example](http://stackoverflow.com/help/mcve).
comment on: http://stackoverflow.com/q/25017779
score: 0
type: Comment

http://stackoverflow.com/comment/38789468
score: 0
type: Comment
type: QuestionComment
has text: @SuziLarsen You might make a javascript function that just appends the link with the `` id as a get param and then call it several times for each individual `` element. For the handling part you have a main script based on page id.
comment on: http://stackoverflow.com/q/24956704

http://stackoverflow.com/a/24989502
score: 23
answers question: http://stackoverflow.com/q/24989475
accepted answer of: http://stackoverflow.com/q/24989475
type: AcceptedAnswer
upvote count: 23
has body: for disable $("#search").prop('disabled', true); for enable $("#search").prop('disabled', false); like below in your function function GetProductByManufacturerID(value) { $.ajax({ type: "POST", url: "add_rebate_by_quat_volume.php", data: { manufacturer_id: value, op:"" }, beforeSend: function() { $("#product_id").html('&lt;option&gt; Loading ...&lt;/option&gt;'); $("#search").prop('disabled', true); // disable button }, success:function(data){ $("#product_id").html(''); $("#product_id").append(data); $("#search").prop('disabled', false); // enable button } }); }
type: Answer
downvote count: 0

http://stackoverflow.com/comment/115503446
has text: A good reason for having a new audio context is for changing sample rates. If we're capturing from an audio device, we need to match its sample rate. If we change the device, the sample rate can change.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25046735

http://stackoverflow.com/q/25059353
score: 1
tagged with: jquery
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/25059526
has answer: http://stackoverflow.com/a/25059526
has title: safari form validation works only in second button click, but works fine in IE 1st click itself
answer count: 2
upvote count: 1
tagged with: safari
has body: I am using below jquery for form validation, the below code works fine in IE9 but in safari sometime its working in second time button click only. For example, i am entring correct email and wrong password, it shows error message, then i corrected password and clicked button, the error was removed but form did not submit, then i clicked again the button, it is getting submitted. This is occuring only in safari. i am using safari 5.1 As well as i think single ready function is enough, but i am using 2 ready function, which one should i remove without affecting existing functionality. jQuery().ready(function domReady($) { $('#txtLogin_Id').removeClass('outLineRed'); $('#txtPassword').removeClass('outLineRed'); $('#spnLoginErr').hide(); $('#txtLogin_Id').watermark("Email Address"); $('#txtPassword').watermark("Password"); if ($('#lblLoginErr').val() != '') { $('#spnLoginErr').show(); $('#spnLoginErr').html($('#lblLoginErr').val()); $('#MsgSucc').attr("style", "background-color:White;!important;"); } else { $('#spnLoginErr').hide(); $('#MsgSucc').attr("style", "background-color:#dfe5e6;"); } $('#txtLogin_Id').blur(function () { if ($('#txtLogin_Id').val() == '') { $('#txtLogin_Id').addClass('outLineRed'); $('#spnLoginErr').show(); $('#spnLoginErr').html("Please enter email address."); $('#MsgSucc').attr("style", "background-color:White;"); $("html, body").animate({ scrollTop: 0 }, "slow"); return false; } else { $('#spnLoginErr').hide(); $('#MsgSucc').attr("style", "background-color:#dfe5e6;"); $('#txtLogin_Id').removeClass('outLineRed'); } } ); $('#txtPassword').blur(function () { if ($('#txtPassword').val() == '') { $('#txtPassword').addClass('outLineRed'); $('#spnLoginErr').show(); $('#spnLoginErr').html("Password has to be more than 6 characters"); $('#MsgSucc').attr("style", "background-color:White;"); $("html, body").animate({ scrollTop: 0 }, "slow"); return false; } else { $('#spnLoginErr').hide(); $('#MsgSucc').attr("style", "background-color:#dfe5e6;"); $('#txt…
has comment: http://stackoverflow.com/comment/39026446
has answer: http://stackoverflow.com/a/25115409
accepted answer: http://stackoverflow.com/a/25115409
type: AnsweredQuestion
downvote count: 0
tagged with: javascript

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

http://stackoverflow.com/comment/38861679
type: AnswerComment
has text: Thank you. It should have been obvious... but good to work through the code and specific problem nonetheless.
type: Comment
comment on: http://stackoverflow.com/a/24994900
score: 0

http://stackoverflow.com/comment/38881131
score: 0
comment on: http://stackoverflow.com/q/25004637
type: Comment
has text: Links won't help future readers.
type: QuestionComment

http://stackoverflow.com/comment/39001095
type: Comment
comment on: http://stackoverflow.com/q/25069113
has text: Yes, this is one of the things I wanted to find out, asking this question, thank you!
score: 0
type: QuestionComment

http://stackoverflow.com/a/24981638
score: 1
has comment: http://stackoverflow.com/comment/38836348
has body: Just remove the class on the resize event as well. jQuery $(window).on('resize',function(){ $("#menu-mobile").hide(); $('#menu-icon').removeClass('active'); }); or via classList API $(window).on('resize',function(){ $("#menu-mobile").hide(); document.querySelector('#menu-icon').classList.remove('active'); }); Also it's better to place your jquery.js before all other &lt;script&gt; tags as it may produce some errors.
answers question: http://stackoverflow.com/q/24981507
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24981507
type: Answer

http://stackoverflow.com/a/25012304
answers question: http://stackoverflow.com/q/25007129
has comment: http://stackoverflow.com/comment/38913728
type: Answer
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38953054
has comment: http://stackoverflow.com/comment/38945934
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25007129
has comment: http://stackoverflow.com/comment/38972144
has body: function animate() { var index = Math.floor((Math.random() * document.querySelectorAll('#mainContainer &gt; .imageHolder').length + 1)); var current = document.querySelector('.top'); var next = document.querySelector('.imageHolder:nth-of-type(' + index + ')'); current.className = "imageHolder"; next.className += "top"; } Should be able to handle and switch between any dynamically inserted images. Currently using: .imageHolder { display: none; } .top { display: inherit; } to switch the image is just a simple implementation. Here's the working fiddle: http://jsfiddle.net/e9dxN/1/ Alternative implementation: http://jsfiddle.net/e9dxN/6/

http://stackoverflow.com/comment/38802795
has text: @adeneo's answer is better, actually.
comment on: http://stackoverflow.com/a/24963952
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/24953210
tagged with: slider
has answer: http://stackoverflow.com/a/24985747
tagged with: animation
accepted answer: http://stackoverflow.com/a/24985747
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/24982640
downvote count: 1
type: Question
has title: Nexus 5 site - scroll slider inside device - how to do that?
answer count: 2
tagged with: javascript
tagged with: jquery
upvote count: 2
has answer: http://stackoverflow.com/a/24982640
tagged with: parallax
favorite count: 0
has body: I want to make the same effect as is on Nexus 5 site ( http://www.google.com/nexus/5/ ) - this with staying Nexus and changeable screens inside of it while I am scrolling (it's 4th section). My case is that I have same section on my site, but with an iPad in the center and text content on both sides and I want to change just images inside the iPad while I will be scrolling. Any ideas, please? Thanks a lot!

http://stackoverflow.com/q/24963093
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38801247
has comment: http://stackoverflow.com/comment/38801612
has comment: http://stackoverflow.com/comment/38801107
has comment: http://stackoverflow.com/comment/38801318
type: Question
has answer: http://stackoverflow.com/a/24964953
has comment: http://stackoverflow.com/comment/38804052
downvote count: 0
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/10820554
has answer: http://stackoverflow.com/a/24963299
has body: I want to extend the number class to have instance functions such as odd and even so I can do something like this: 2.odd() =&gt; false 2.even() =&gt; true 1.even() =&gt; false 1.odd() =&gt; true Extending classes is a good Ruby practise: "Ruby check if even number, float". Is the same true in JavaScript, or does it cause performance issues or some other problem? Anyway, I can't extend despite my best efforts: var NumberInstanceExtensions = { accuracy: function(){ return 'This is cool ' + this } } $.extend(Number.prototype,NumberInstanceExtensions); alert( $.type(5) ); //-&gt; number //alert( 5.accuracy() ); //-&gt; Uncaught SyntaxError: Unexpected token ILLEGAL http://jsfiddle.net/VLPTb/2/ How can I get this to work? The syntax error makes me think this isn't how JavaScript works on a fundamental level. Is my best bet extending the Math class and doing this instead: Math.odd(2) =&gt; false Math.even(2) =&gt; true Math.even(1) =&gt; false Math.odd(1) =&gt; true That seems far more inelegant than 2.odd().
answer count: 3
has title: Extend the number class
possible better answer: http://stackoverflow.com/a/24963287
favorite count: 0
has answer: http://stackoverflow.com/a/24963287
upvote count: 2
linked to: http://stackoverflow.com/q/18163475
accepted answer: http://stackoverflow.com/a/24963299
has comment: http://stackoverflow.com/comment/38802059
score: 2

http://stackoverflow.com/comment/38818958
comment on: http://stackoverflow.com/a/24972166
type: Comment
has text: If you are looking for faster implementations that the native Array.sort there is a nice post: http://blog.mgechev.com/2012/11/24/javascript-sorting-performance-quicksort-v8/
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39014305
has text: Dude i feel so stupid i totally erase that bit of css by mistake and didn´t noticed it. thanks a bunch!
comment on: http://stackoverflow.com/a/25070274
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25034279
has body: I decided to write something for Android using native browser and Canvas / JS. So i have an Android tablet with screen resolution 1536x2048. I checked window resolution with this code: alert(document.documentElement.clientWidth + 'x' + document.documentElement.clientHeight); so the result was 980x1080. Why? upd: in "full version mode" situation still the same
answer count: 0
has comment: http://stackoverflow.com/comment/38938534
has comment: http://stackoverflow.com/comment/38939124
type: Question
tagged with: javascript
tagged with: browser
score: 0
has comment: http://stackoverflow.com/comment/38938597
has comment: http://stackoverflow.com/comment/38935696
has comment: http://stackoverflow.com/comment/38935075
type: UnansweredQuestion
has title: android native browser does not support higher resolution?
tagged with: android
has comment: http://stackoverflow.com/comment/38938967

http://stackoverflow.com/comment/38779840
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24951662
has text: So you just want to show the hidden part of button.
score: 0

http://stackoverflow.com/a/25017112
has body: The simplest solution is to use a callback: function foo (callback) { callback(return_value); } foo(function (return_value) { console.log(return_value); }); DEMO
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25017055
downvote count: 0
answers question: http://stackoverflow.com/q/25017055
score: 4
type: AcceptedAnswer

http://stackoverflow.com/comment/38968397
comment on: http://stackoverflow.com/q/25051869
has text: You have to use slide.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38823487
has text: sorry, it's javascript:void(0)
comment on: http://stackoverflow.com/a/24975122
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25059798
downvote count: 0
answers question: http://stackoverflow.com/q/25058634
has comment: http://stackoverflow.com/comment/38983340
has body: I would do this in only CSS like so: Set the image to scaleX and scaleY 0 (or hide it in some other way) On $(window).load or $('document').ready add a class with keyframe animations Do whatever you need afterwards. Fiddle $(window).load(function(){ $('img.zoom').addClass('element-animation'); }); You can also listen to animation end events like so https://github.com/daneden/animate.css#usage That library (Animate.css) is also pretty handy and you might be able to find some useful effects in it.
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38983375
score: 1

http://stackoverflow.com/a/33307711
downvote count: 0
type: Answer
has body: The fix is here https://github.com/ckeditor/ckeditor-dev/pull/200 within ckEditor it will check for the existence of the iframe before clearCustomData is invoked. The reason it happens for you is that when the modal closes the iframe is removed before you are able to call destroy on the editor instance. Try/catch is the best workaround for now.
upvote count: 3
has comment: http://stackoverflow.com/comment/54414711
score: 3
answers question: http://stackoverflow.com/q/25034150

http://stackoverflow.com/comment/38775961
comment on: http://stackoverflow.com/q/24949511
score: 0
has text: You just need to do `form_id.submit()` instead of `$(form_id).submit()`
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25042958
tagged with: jquery
has title: AJAX form not submitting that gives error
tagged with: ajax
has answer: http://stackoverflow.com/a/25043452
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38951553
has comment: http://stackoverflow.com/comment/38958510
has comment: http://stackoverflow.com/comment/38951655
has comment: http://stackoverflow.com/comment/38951480
has comment: http://stackoverflow.com/comment/38951558
has comment: http://stackoverflow.com/comment/38952004
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38953498
has answer: http://stackoverflow.com/a/25043281
has comment: http://stackoverflow.com/comment/38951550
tagged with: php
has comment: http://stackoverflow.com/comment/38951513
has body: I have my AJAX code here $("#add-student").click(function(e) { e.preventDefault(); formData = $("#student-form").serialize(); if (cleanFormInput()) { sendTheInfo(formData); } else { shakeForm(); } }); function sendTheInfo(formData) { $.ajax({ type: "POST", url: "../classes/ajax/postNewStudent.php", data: formData, statusCode: { 404: function() { alert( "page not found" ); } }, success: function(formData) { console.log("New student submitted:\n" + formData); //clearForms(); }, error: function(result, sts, err) { console.warn("Connection error:\n" + err + " : " + sts); console.log(result); shakeForm(); }, complete: function() { console.log("Everything complete"); } }); } Always without fail outputs this error: Connection error: SyntaxError: Unexpected end of input : parsererror But still gives the complete message: Everything complete Update, PHP code here: require '../../core/init.php'; require '../../classes/Config.php'; header('Content-Type: application/json'); if (!empty($_POST)) { $id = $_POST["sid"]; $first = $_POST["first"]; $last = $_POST["last"]; $fav = "0"; $sql = "INSERT INTO `students` (`id`, `first`, `last`, `active`) VALUES ('{$id}', '{$first}', '{$last}', '{$fav}')"; $link = mysql_connect(Config::get('mysql/host'),Config::get('mysql/username'),Config::get('mysql/password')) or die("could not connect");; mysql_select_db(Config::get('mysql/db'), $link); $result = mysql_query($sql, $link); if ($result) { header('Content-Type: application/json'); $student_data = $id . $first . $last . $fav; echo json_encode($student_data); } } I'm a bit confused, am I doing my ajax set up wrong? Or is it something else in by backend code wrong? I'm using MySQL and jQuery 2.0.3 Updated code here: here
has comment: http://stackoverflow.com/comment/38951621
has comment: http://stackoverflow.com/comment/38951839
has comment: http://stackoverflow.com/comment/38951277
tagged with: mysql
has comment: http://stackoverflow.com/comment/38951452
has comment: http://stackoverflow.com/comment/38952172
has comment: http://stackoverflow.com/comment/38951970
type: Question
has comment: http://stackoverflow.com/comment/38952027
has comment: http://stackoverflow.com/comment/38951257
has comment: http://stackoverflow.com/comment/38953316
has comment: http://stackoverflow.com/comment/38952050
has answer: http://stackoverflow.com/a/25043234
tagged with: javascript
has comment: http://stackoverflow.com/comment/38951564

http://stackoverflow.com/comment/38904370
type: AnswerComment
score: 0
type: Comment
has text: I'd guess that the OP is attempting to mimic Java's `getName()` function (which returns the name of a class via reflection), but is confused about how "classes" are implemented in JS. I think you've given the best answer that could be given to such a question.
comment on: http://stackoverflow.com/a/25017890

http://stackoverflow.com/q/24949322
tagged with: node.js
has title: Azure mobile service javascript back end how to set and read cookies?
accepted answer: http://stackoverflow.com/a/24965007
tagged with: cookies
tagged with: authentication
tagged with: azure-mobile-services
downvote count: 0
tagged with: javascript
type: Question
type: AnsweredQuestion
has body: So I have this azure mobile service with node back end but I would need to store a cookie when a specific api has been called. I have my login api set up and working correctly and all I want now is to set a cookie, but I cannot find anything from the azure documentation regarding cookies. So basically how can I store a cookie from azure javascript back end and how can I access it later from table operations script etc. to check its validity? EDIT: I checked the Express api reference, which azure says that its request and response objects are from. But even when using response.cookie('token', 'value', {maxAge: 3600000}) I still cannot access it from the request object on the other api.
has answer: http://stackoverflow.com/a/24965007
score: 1
favorite count: 0
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/39213212
has text: The class of the plugin [cordova-screenshot-master](https://github.com/gitawego/cordova-screenshot/blob/master/src/android/Screenshot.java)
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25183074

http://stackoverflow.com/q/24926228
tagged with: http://stackoverflow.com/tag/html
has body: i'm fairly new to angularjs and i seem to have got myself in a twist of code and cant seem to figure this out. here is the code (angularjs) var siteOptimizeApp = angular.module('siteOptimizeApp', []); // ---- Controllers ---- siteOptimizeApp.controller('Formctrl',['$scope', '$http', function($scope, $http){ $scope.customer = customer; $scope.placeholderWrp = ''; $scope.inputWrp = 'hidden'; $scope.modal = 'modal'; $scope.customer.cancelfunc = 'customer.cancel()'; $scope.customer.edit = function(){ $scope.this.placeholderWrp = 'hidden'; $scope.this.inputWrp = ''; } $scope.customer.cancel = function(){ $scope.this.placeholderWrp = ''; $scope.this.inputWrp = 'hidden'; } $scope.customer.modal = function(){ } $scope.formSubmit = function(){ } }]); // ---- Directives (element) --- // remove-btn siteOptimizeApp.directive('removeBtn', function(){ return { restrict: 'E', //replace: true, scope: { customerInfo: '=info' }, template: ' ×Close ' } }); where customer is - customer = {"birthday":"0000-00-00","customersettings":null,"email":"j_email@gmail.com","fullname":"j_email","gender":"m","cid":"cust_D5C502813C62017","location":"localhost","logintype":"email","timeszone":null} and here is the html : Edit Profile Full Name: {{customer.fullname}} Edit As you can see is the custom directive that i have defined. When i pass in the 'info' attribute as 'modal' (.i.e 'info="modal"') it works fine and translates into the following html - × Close which is basically a bootstrap handled button for closing the modal. Here is where i'am stuck: Now how do i pass an ng-click to this custom directive for cases other then when the attr is 'info="modal"' (.i.e 'info="somethingelse") coz i want to be able to use this across the site and probably cancel or close different elements at different instances.
tagged with: twitter-bootstrap
type: UnansweredQuestion
type: Question
tagged with: javascript
has title: Angularjs passing ng-click to directive
score: 0
answer count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/24928740
tagged with: angularjs

http://stackoverflow.com/q/24963808
tagged with: javascript
has title: Line chart, show data label inside chart when data is less than min
has comment: http://stackoverflow.com/comment/38861577
score: 0
has comment: http://stackoverflow.com/comment/38803990
answer count: 1
accepted answer: http://stackoverflow.com/a/25003055
has body: I need to show the data label of all the points that are outside the limits. I've tried a few things but none works. In this example it should show the "-15" inside the graphic area. http://jsfiddle.net/fpanci/4u5zQ/ $(function () { $('#container').highcharts({ chart: { marginRight: 50 }, yAxis: { min: 0 }, series: [{ data: [29.9, 71.5, 106.4, 129.2, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, { dataLabels: { enabled: true, align: 'left', style: { fontWeight: 'bold' }, x: 3, y: 10, verticalAlign: 'middle', crop: false }, y: -15 }, 161.4, 54.4, 61.1 ] }] }); }); Thanks!
has comment: http://stackoverflow.com/comment/38861790
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38855583
has answer: http://stackoverflow.com/a/25003055
type: Question
tagged with: highcharts

http://stackoverflow.com/q/24914513
has comment: http://stackoverflow.com/comment/38709588
has title: Display google maps in iframe dynamically
linked to: http://stackoverflow.com/q/15388897
type: Question
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38710278
has comment: http://stackoverflow.com/comment/38709937
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24914674
linked to: http://stackoverflow.com/q/1300838
accepted answer: http://stackoverflow.com/a/24934734
has answer: http://stackoverflow.com/a/24914674
has body: I would like to dynamically create a "google maps" link in javascript and than set it as src for my iframe, but I don't know if it is not possible with google maps, because this doesn't work: document.getElementById('map_canvas').src='http://maps.google.com/maps/ms?ie=UTF8&amp;amp;msa=0&amp;amp;msid=209246852521822593612.0004feda304ac527ea40a&amp;amp;output=embed'; although, for example this works: document.getElementById('map_canvas').src='http://www.cnn.com'; This is my iframe: &lt;iframe id="map_canvas" name="map_canvas" width="100%" height="600px" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src=""&gt; &lt;/iframe&gt; Could you explain me, how is it possible to dynamically generate and display a google maps link in iframe ? Thank you for help!
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38709939
has answer: http://stackoverflow.com/a/24914717
has comment: http://stackoverflow.com/comment/38710043
has answer: http://stackoverflow.com/a/24934734
favorite count: 0
tagged with: iframe
has comment: http://stackoverflow.com/comment/38709900
answer count: 4
has answer: http://stackoverflow.com/a/24914687
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/q/24980729
favorite count: 0
type: Question
has body: I'm trying to click a button on a page using SlimerJS. On the SlimerJS documentation, I see sendEvent(eventType, arg1, arg2, button, modifier) which allows us to click on a given position by X and Y coordinates. (Doc here) So, I tried getting these X and Y of a button coordinates the following way: var webpage = require("webpage").create(); function clickButton(button) { var rect = button.getBoundingClientRect(); webpage.sendEvent('click',rect.left,rect.top,'left',0); } webpage.open(url).then(function(){ var button = webpage.evaluate(function(){ signInButton = document.querySelector("#signIn"); return signInButton; }); clickButton(button); }); This way, no error is thrown, but the button doesn't seem to get clicked. Is something wrong with this practice? Is there a better way? Is there a way to click a button or a link provided just it's ID or tag name?
upvote count: 2
linked to: http://stackoverflow.com/q/24859186
answer count: 1
has title: SlimerJS Click a link/button
type: UnansweredQuestion
score: 2
downvote count: 0
tagged with: javascript
tagged with: slimerjs
has answer: http://stackoverflow.com/a/24993539

http://stackoverflow.com/q/24989966
answer count: 3
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/24990047
accepted answer: http://stackoverflow.com/a/24989990
has answer: http://stackoverflow.com/a/24990299
type: AnsweredQuestion
upvote count: 2
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24989990
downvote count: 1
has title: jquery - creating nested json from flat json
type: Question
has body: Below is the JSON data. JSON : [{ "Code":"US-AL", "Name":"Alabama", "Population":4833722 }, { "Code":"US-AK", "Name":"Alaska", "Population":735132 }, { "Code":"US-AZ", "Name":"Arizona", "Population":6626624 }, { "Code":"US-AR", "Name":"Arkansas", "Population":2959373 }, { "Code":"US-CA", "Name":"California", "Population":38332521 }, { "Code":"US-CO", "Name":"Colorado", "Population":5268367 }, { "Code":"US-CT", "Name":"Connecticut", "Population":3596080 }] I wanted to convert that data to this format. [{ "US-AL": { "name" : "Alabama", "population" : 4833772 }, "US-AK": { "name" : "Alaska", "population" : 735132 } }] I tried with this function and separated the name and population from it. var ParentData = []; var ChildData = {"name": [], "population": []}; data.forEach(function(val, i) { ParentData.push(val.Code); ChildData.name.push(val.Name); ChildData.population.push(val.Population); }) But I'm not that expert in this. Just a learner and I don't know how to push to the parent data which gets aligned to it respectively. Any help will be very much helpful for me to achieve this. Thanks in advance.
has answer: http://stackoverflow.com/a/24990047
tagged with: javascript

http://stackoverflow.com/a/24996182
has comment: http://stackoverflow.com/comment/39130881
type: AcceptedAnswer
upvote count: 8
accepted answer of: http://stackoverflow.com/q/24955015
type: Answer
answers question: http://stackoverflow.com/q/24955015
score: 7
downvote count: 1
has body: It's not possible (using Javascript). There is some experimental support for user-initiated print events in modern browsers, but those are not cancelable ("simple events") so the entire page will still print even if you interject custom code to print the frame of interest. Given this limitation, your best bet is probably to offer users a large button that fires your custom frame printing function (see printContentFrameOnly below, fire it without arguments) and hope that they'll use the button instead of ctrl-p. If it would be possible, this would be the way to do it (based on this answer): // listener is a function, optionally accepting an event and // a function that prints the entire page addPrintEventListener = function (listener) { // IE 5.5+ support and HTML5 standard if ("onbeforeprint" in window) { window.addEventListener('beforeprint', listener); } // Chrome 9+, Firefox 6+, IE 10+, Opera 12.1+, Safari 5.1+ else if (window.matchMedia) { var mqList = window.matchMedia("print"); mqList.addListener(function (mql) { if (mql.matches) listener(); // no standard event anyway }); } // Your fallback method, only working for JS initiated printing // (but the easiest case because there is no need to cancel) else { (function (oldPrint) { window.print = function () { listener(undefined, oldPrint); } })(window.print); } } printContentFrameOnly = function (event) { if (event) event.preventDefault(); // not going to work window.frames['webcontent'].focus(); window.frames['webcontent'].print(); } addPrintEventListener(printContentFrameOnly);
has comment: http://stackoverflow.com/comment/39143492

http://stackoverflow.com/q/24965371
has title: How to correctly receive a JSON response from AJAX (Javascript to PHP)
tagged with: php
has answer: http://stackoverflow.com/a/24965738
type: UnansweredQuestion
tagged with: paypal
type: Question
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
has body: My script.php file sends a few variables (extracted from a HTML form) to my email.php file. This file then saves all such variables to a MYSQL database, and in return also collects an "Order ID Number" (collected from mysql_insert_id), shown below: $order_id = mysql_insert_id(); The $order_id is then passed back to script.php, which submits the product details to Paypal. Currently, I wish the Paypal's item name to read "Order ID: #$order_id". However, I can't seem to send all the variables over to script.php, and then get the order ID back correctly. I often receive a "Cannot read property 'order_id' of undefined" error in Google Chrome console, however now I'm triggering this piece of code from the JQuery 1.10.1 library (observed in Google Chrome console also) // Uppercase the type s.type = s.type.toUpperCase(); Which then results in the following error: Uncaught Type Error: Object 1 has no method "toUpperCase". Here's my code. I understand mysql is depreciated, but I'd like to get this implemented before I do any upgrades. ;) SCRIPT.PHP $('#submit').click(function(){ // Perform checks to ensure all dropdown selections have been selected. // Validations have been successful, now populate variable portions of the paypal form $('#emailBuyer').val($('#email_paypal').val()); var host = $(location).attr('host'); var protocol = $(location).attr('protocol'); var pathname = $(location).attr('pathname'); var returnPath = pathname.replace("removed","removed"); var cancelReturnPath = pathname.replace("removed","removed"); var returnPathUrl = protocol + "//" + host + returnPath + $('#email_paypal').val(); var cancelReturnPathUrl = protocol + "//" + host + cancelReturnPath + $('#email_paypal').val(); $('#returnPath').val(returnPathUrl); $('#cancelReturnPath').val(cancelReturnPathUrl); // Send the email. It needs to have the async=false as the form is tried to redirect to paypal before the email is sent! jQuery.ajaxSetup({async:false}); $.get( controllerDir + 'email.php', { emai…
answer count: 1
tagged with: ajax

http://stackoverflow.com/a/30705202
score: 3
has body: Change support3d = (asSupport !== null &amp;&amp; asSupport.length == 1); to support3d = (asSupport !== null &amp;&amp; asSupport.length &gt;= 1); https://github.com/OwlFonk/OwlCarousel/issues/515
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24911447
upvote count: 3

http://stackoverflow.com/q/24984057
possible better answer: http://stackoverflow.com/a/24984176
has answer: http://stackoverflow.com/a/24984176
type: Question
has comment: http://stackoverflow.com/comment/38843006
score: -1
accepted answer: http://stackoverflow.com/a/24984184
has comment: http://stackoverflow.com/comment/38840404
answer count: 2
downvote count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24984184
favorite count: 0
has title: Build vertical menu with sub-menus
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I'm building my own vertical menu in CSS3 & HTML5: I'm need devide first "item 1" into two buttons, the first is still "Item 1", the second is a arrow button, that will open/close hidden ul with sub-items. Something like that: 1st button - calls default action choosen from sub-tems. 2nd buton - gaves to user make own choose, what do now or what do always when 1st button pressed. How I can devide the first item into two that buttons? The HTML: Item 1 Sub-Item 1 Sub-Item 2 Sub-Item 3 Sub-Item 4 Item 2 Item 3 Item 4 The CSS: .WMenu { background: url("../images/WMenu/bg.png"); background-repeat: repeat-z; background-attachment: fixed; list-style-type: none; font-family: Verdana,Geneva,sans-serif; font-size: 12px; height: 100%; width: 200px; margin: 0 0 0 10px; padding: 0; } /*Выпадающее под-меню */ .WMenuPopup { list-style-type: none; } .WButton { background: #feffff; background: -moz-linear-gradient(top, #feffff 0%, #ddf1f9 35%, #a0d8ef 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#feffff), color-stop(35%,#ddf1f9), color-stop(100%,#a0d8ef)); background: -webkit-linear-gradient(top, #feffff 0%,#ddf1f9 35%,#a0d8ef 100%); background: -o-linear-gradient(top, #feffff 0%,#ddf1f9 35%,#a0d8ef 100%); background: -ms-linear-gradient(top, #feffff 0%,#ddf1f9 35%,#a0d8ef 100%); background: linear-gradient(to bottom, #feffff 0%,#ddf1f9 35%,#a0d8ef 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feffff', endColorstr='#a0d8ef',GradientType=0 ); padding: 4px; margin-right: 2px; margin-bottom: 2px; width: auto; height: auto; } .WButton:hover { cursor: pointer; background: #87e0fd; background: -moz-linear-gradient(top, #87e0fd 0%, #53cbf1 40%, #05abe0 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#87e0fd), color-stop(40%,#53cbf1), color-stop(100%,#05abe0)); background: -webkit-linear-gradient(top, #87e0fd 0%,#53cbf1 40%,#05abe0 100%); background: -o-linear-gradient(top, #87e0fd 0%,#53cbf1 40…
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/38840341

http://stackoverflow.com/q/25032539
type: Question
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38931488
has body: I have delegated to $(document) a click method for a dynamically-added element with a class of .popup-youtube. the only thing is, i just can't get the popup to work properly. Here's my script: $(this).on("click", ".popup-youtube", function(e){ // prevent default action e.preventDefault(); $(this).magnificPopup({ type: 'iframe', iframe: { markup: '&lt;div class="mfp-iframe-scaler"&gt;'+ '&lt;div class="mfp-close"&gt;&lt;/div&gt;'+ '&lt;iframe class="mfp-iframe" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;'+ '&lt;/div&gt;', // HTML markup of popup, `mfp-close` will be replaced by the close button patterns: { youtube: { index: 'youtube.com/', // String that detects type of video (in this case YouTube). Simply via url.indexOf(index). id: 'v=', // String that splits URL in a two parts, second part should be %id% // Or null - full URL will be returned // Or a function that should return %id%, for example: // id: function(url) { return 'parsed id'; } src: '//www.youtube.com/embed/%id%?autoplay=1' // URL that will be set as a source for iframe. }, vimeo: { index: 'vimeo.com/', id: '/', src: '//player.vimeo.com/video/%id%?autoplay=1' }, gmaps: { index: '//maps.google.', src: '%id%&amp;output=embed' } }, srcAction: 'iframe_src' } }); }); Anyone have any tips on this? your help would gladly be appreciated.
accepted answer: http://stackoverflow.com/a/25032663
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38931407
has title: MagnificPopup not working on first click using on()
type: AnsweredQuestion
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25032663
tagged with: magnific-popup

http://stackoverflow.com/comment/38995658
comment on: http://stackoverflow.com/q/25065957
score: 0
type: Comment
type: QuestionComment
has text: can't grasp the concept of closure easily, how do i do that?

http://stackoverflow.com/comment/38937098
score: 0
comment on: http://stackoverflow.com/a/25035632
type: Comment
has text: Assuming that this is user provided data, I don't think it would be wise to assume that the string only contains numbers... Unless there is some other validation method that was not mentioned by the OP.
type: AnswerComment

http://stackoverflow.com/comment/38746355
has text: Please provide your code, maybe it has his own watcher and you adding another watcher on that
score: 1
comment on: http://stackoverflow.com/q/24932707
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24955862
has title: Passing JSON to JsonResult not working while passing JSON object nor JSON.stringify
has answer: http://stackoverflow.com/a/24956342
favorite count: 0
type: UnansweredQuestion
upvote count: 1
type: Question
tagged with: c#
score: 1
tagged with: http://stackoverflow.com/tag/json
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have this class in my project: I made a JsonResult method in controller which has as parameter an object from this class: [HttpPost] public JsonResult NewAreaCode(AreaCode model) { return Json(true, JsonRequestBehavior.AllowGet); } I am trying to call this method in an Ajax request, I tried in two ways: var areaCode = $(dataContent).parent().parent().find("#City_idCity").attr("value"); var City_idCity = $(dataContent).parent().parent().find("#areaCode").attr("value"); var model = JSON.stringify({ "idAreaCode": "0", "areaCode": areaCode, "City_idCity": City_idCity }); $.ajax({ type: 'POST', url: '/Address/NewAreaCode', data: model, contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (data) { } }); function submitNewAreaCode(dataContent) { var areaCode = $(dataContent).parent().parent().find("#City_idCity").attr("value"); var City_idCity = $(dataContent).parent().parent().find("#areaCode").attr("value"); var model = { "idAreaCode": "0", "areaCode": areaCode, "City_idCity": City_idCity }; $.ajax({ type: 'POST', url: '/Address/NewAreaCode', data: model, contentType: 'application/json; charset=utf-8', dataType: 'json', success: function (data) { } }); } But I can't call the JSON method. In the first case, using JSON.stringify, I got the error that cannot convert Int32 to String. In the second case, passing object directly, I got the error "Invalid JSON primitive: idAreaCode" (or any of first parameter passed, it doesn't matter). I don't understand what's happening, because I made something similar in another case, but with a different class: I created a similar situation, changing the parameter of AreaCode to Country, I called the Ajax request with code below: function editCountrySubmit(element) { element = $(element).parent(); var divCountry = "#" + $(element).attr("id"); var div = $(divCountry).html(); var idCountry = divCountry.substring(divCountry.indexOf("-") + 1, divCountry.length); var country = $(divCountry + " #countryName").att…

http://stackoverflow.com/comment/38753012
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24937572
has text: Before going to eval you might check out the risks associated with using it: http://blogs.msdn.com/b/ericlippert/archive/2003/11/01/53329.aspx and http://stackoverflow.com/questions/197769/when-is-javascripts-eval-not-evil are good starting references

http://stackoverflow.com/comment/38817578
type: Comment
type: QuestionComment
has text: You can use `<?php $ipAddr = $_SERVER['SERVER_ADDR']; ?>`
comment on: http://stackoverflow.com/q/24971920
score: 0

http://stackoverflow.com/q/24964481
tagged with: variables
has body: There is a function that calculates and displays the difference of 2 time variables the user selects in separate drop down lists. The display is invoked when the paragraph tags are used in the form. Function below: &lt;script type='text/javascript'&gt;//&lt;![CDATA[ $(window).load(function () { $(document).ready(function () { function calculateTime() { //get values var valuestart = $("select[name='timestart']").val(); var valuestop = $("select[name='timestop']").val(); //create date format var timeStart = new Date("01/01/2007 " + valuestart).getHours(); var timeEnd = new Date("01/01/2007 " + valuestop).getHours(); var hourDiff = timeEnd - timeStart; $('p').html("Total Hours: " + hourDiff) } $("select").change(calculateTime); calculateTime(); }); });//]]&gt; &lt;/script&gt; The function works. However, I'm needing the "difference in time" value to be passed to an HTML input tag and displayed instead of simply being displayed when paragraph tags are used. Is there be a way to do this?
duplicate of: http://stackoverflow.com/q/10611170
tagged with: http://stackoverflow.com/tag/html
has title: How do you pass a JavaScript variable into an HTML input field for this particular case?
tagged with: return
has comment: http://stackoverflow.com/comment/38803980
score: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24964498
type: Question
linked to: http://stackoverflow.com/q/10611170
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/24941326
score: 1
upvote count: 1
type: Question
has body: I need to add a button to my sales order form where when you click the button it will trigger a script I created. Basically the button calculates and fills in fields based on what you put for earlier fields. Could I add a button through a workflow and link this script through the add button option? I also have no clue how to test this out on the sales order form I'm not even sure it works. Any advice would be great, thanks
tagged with: javascript
has answer: http://stackoverflow.com/a/24944305
answer count: 1
downvote count: 0
tagged with: button
tagged with: netsuite
tagged with: workflow
favorite count: 0
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24944305
has title: Trigger SuiteScript on workflow button NetSuite

http://stackoverflow.com/q/24917888
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24918208
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38716863
possible better answer: http://stackoverflow.com/a/24918208
accepted answer: http://stackoverflow.com/a/24918277
type: Question
has comment: http://stackoverflow.com/comment/38719240
has answer: http://stackoverflow.com/a/24918715
has title: jQuery - find all inputs, except the ones descending from div
tagged with: dom
has comment: http://stackoverflow.com/comment/38717005
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24918277
has body: Well I'm trying to write a validation jQuery plugin, but for that I need to find all inputs inside of a container, which is marked with an attribute. However, that container may have other sub-containers, also marked with attributes, and they may have their own inputs. I need to select all inputs, descendants of the parent container (accessed by $(this)) which are not descendants of the sub-containers. Is that possible? Some code to illustrate: &lt;div data-container&gt; &lt;input&gt; &lt;div class="form-group"&gt; &lt;input&gt; &lt;/div&gt; &lt;input&gt; &lt;div data-container&gt; &lt;input&gt; &lt;input&gt; &lt;input&gt; &lt;/div&gt; &lt;/div&gt; I want to select those first three inputs, and ignore the ones inside the children data-container. The one inside the form-group must be selected too.

http://stackoverflow.com/comment/38754226
comment on: http://stackoverflow.com/q/24938087
score: 0
type: Comment
type: QuestionComment
has text: @BrunoQuintanaFleitas It is...

http://stackoverflow.com/q/24992704
accepted answer: http://stackoverflow.com/a/24993843
has answer: http://stackoverflow.com/a/24993150
has comment: http://stackoverflow.com/comment/38858060
type: Question
has body: I am trying to open pop up screen I am getting this error : ** Error: Unknown provider: $modalProvider <- $modal at Error (native) at file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:2682:42 at Object.getService [as get] (file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:2810:39) at file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:2687:45 at getService (file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:2810:39) at invoke (file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:2828:13) at Object.instantiate (file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:2860:23) at $get (file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:4743:24) at file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:4322:17 at forEach (file:///C:/Users/asd/Desktop/angular/angularproject/angular.js:140:20) why I am getting this error ..here is my Html and js files ? Add Contend ** Here is my js file : var myApp = angular.module('plunker', ['ui.bootstrap']); myApp.directive('headerInfo', function(){ alert('dd') return { restrict: 'A', scope: { inner_htm: '=innerHtm' }, templateUrl:'dialog.html', link: function(scope, element, attrs) { console.log(scope.inner_html); console.log(element); console.log(element.html()); scope.inner_htm = element.html(); console.log(scope.inner_htm); } } }) myApp.controller('DialogDemoCtrl', function($scope, $modal, $log) { $scope.items = []; $scope.activeItem = { id:'', name: '', content: '' }; $scope.addItem = function () { $scope.activeItem.id = $scope.items.length + 1; $scope.items.push($scope.activeItem); $scope.activeItem = {}; /* reset active item*/ }; $scope.getId = function (item) { alert('ID: '+item.id); }; $scope.openPopupScreen = function () { alert('---') var modalInstance = $modal.open({ template: $scope.inner_text, controller: ModalInstanceCtrl }); }; }); here us Dialog.html × Add Element Name: Content Name: Add In List Clear close I don't know why I am getti…
answer count: 2
possible better answer: http://stackoverflow.com/a/24993150
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24993843
has comment: http://stackoverflow.com/comment/38858252
tagged with: angularjs
type: AnsweredQuestion
has title: why pop up screen is not open in Angular.js?

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

angular-ui-bootstrap
tags question: http://stackoverflow.com/q/25029173
tags question: http://stackoverflow.com/q/25023176
tags question: http://stackoverflow.com/q/25007757
tags question: http://stackoverflow.com/q/24952433
tags question: http://stackoverflow.com/q/24924581
type: Tag
tags question: http://stackoverflow.com/q/24987000
tags question: http://stackoverflow.com/q/24914699
tags question: http://stackoverflow.com/q/25041613
tag name: angular-ui-bootstrap
tags question: http://stackoverflow.com/q/25065321

http://stackoverflow.com/q/24945062
has comment: http://stackoverflow.com/comment/38777862
has title: getting extra + while serializing
has comment: http://stackoverflow.com/comment/38960121
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/38767641
type: Question
tagged with: jquery-ui
has body: I am serializing form data with jquery serialize var address = $('#formdata').serialize(); and then I do decodeURIComponent(address); so my address looks like this 1762+north+street it decodes it but instead of spaces it adds + . What can I do (instead of of course replace + with space, bad solution) to decode it properly thanks
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/38968994
has text: Exactly right. Just give it a different ID and use that ID
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25052153

http://stackoverflow.com/comment/38724565
has text: It's been uploaded, so you should be able to see the javascript.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24921989
score: 0

http://stackoverflow.com/q/24958349
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24958532
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38791752
has title: Visual Studio Bundle for SPA html index page
tagged with: javascript
tagged with: visual-studio-2012
has body: I'm trying to find a way to bundle scripts in Visual Studio. The catch is that I'm using an HTML file and not any ASPX files. It is a SPA running Angular. The index.html has about 30 JS files I would like to bundle. I tried using Web Essentials but it appears that that requires you to be running an ASPX page that compiles at run time? Anyways - it would be nice to do this inside VS, however if I can't then a 3rd party external bundling tool would be fine. Just looking for suggestions on the easiest way to accomplish this.
possible better answer: http://stackoverflow.com/a/29501215
answer count: 2
accepted answer: http://stackoverflow.com/a/24958532
has answer: http://stackoverflow.com/a/29501215
downvote count: 0
tagged with: bundle
tagged with: asp.net
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38791852

checkbox
tags question: http://stackoverflow.com/q/24914588
tags question: http://stackoverflow.com/q/24992725
tag name: checkbox
tags question: http://stackoverflow.com/q/24927577
tags question: http://stackoverflow.com/q/25037112
tags question: http://stackoverflow.com/q/24930465
tags question: http://stackoverflow.com/q/24994954
tags question: http://stackoverflow.com/q/24995074
tags question: http://stackoverflow.com/q/25065145
tags question: http://stackoverflow.com/q/25014911
tags question: http://stackoverflow.com/q/24965834
tags question: http://stackoverflow.com/q/25015948
tags question: http://stackoverflow.com/q/24979324
tags question: http://stackoverflow.com/q/24993978
tags question: http://stackoverflow.com/q/24933912
tags question: http://stackoverflow.com/q/25013805
tags question: http://stackoverflow.com/q/24924625
tags question: http://stackoverflow.com/q/25035006
tags question: http://stackoverflow.com/q/24924249
tags question: http://stackoverflow.com/q/25035321
tags question: http://stackoverflow.com/q/24929796
tags question: http://stackoverflow.com/q/24954115
tags question: http://stackoverflow.com/q/25029024
type: Tag
tags question: http://stackoverflow.com/q/25060499
tags question: http://stackoverflow.com/q/24931028
tags question: http://stackoverflow.com/q/24961216
tags question: http://stackoverflow.com/q/24943644
tags question: http://stackoverflow.com/q/25000604
tags question: http://stackoverflow.com/q/24936688

http://stackoverflow.com/comment/38759577
type: QuestionComment
score: 2
has text: It seems to originate from here: http://www.paulirish.com/2011/requestanimationframe-for-smart-animating/
comment on: http://stackoverflow.com/q/24940963
type: Comment

http://stackoverflow.com/comment/38866059
comment on: http://stackoverflow.com/q/24997792
type: Comment
has text: what is "The Developer Console" in this instance? .. in your browser?
type: QuestionComment
score: 0

http://stackoverflow.com/a/24965771
has comment: http://stackoverflow.com/comment/38873691
has comment: http://stackoverflow.com/comment/38873593
has comment: http://stackoverflow.com/comment/38873542
has comment: http://stackoverflow.com/comment/38835944
score: 0
answers question: http://stackoverflow.com/q/24962278
has comment: http://stackoverflow.com/comment/38871185
has comment: http://stackoverflow.com/comment/38873457
type: Answer
has comment: http://stackoverflow.com/comment/38840591
has body: Most of the time there is a way to do something you normally do in jQuery with Ember view hooks, actions, and events. An alternate approach would be to wrap that DOM node in a {{#view}} and then make use of the didInsertElement hook. For example, let's wrap it in {{#view App.SearchResultsView}}: &lt;div class="searchbarContainer" tabindex="0" bubbles=false&gt; {{input type="search" name="searchFor" class="searchTextField" placeholder="Search..." value=searchKey}} {{#if searchKeyNotNull}} {{#view App.SearchResultsView}} &lt;div class="searchResultsContainer box-shadow"&gt; &lt;!-- MORE HBS HERE --&gt; &lt;/div&gt; {{/view}} {{/if}} &lt;/div&gt; Now, let's define App.SearchResultsView: App.SearchResultsView = Ember.View.extend({ didInsertElement: function () { this.$('.searchResultsContainer').on('scroll', function (e) { // scrolling... }); } }); Hope that helps! Let me know if I can further explain anything.

http://stackoverflow.com/a/24953041
has comment: http://stackoverflow.com/comment/38782112
has body: UPDATE try this (you had an error in the script): function submitLogin() { username = $("#login-username").val(); password = $("#login-password").val(); $.ajax({ type: "POST", url: "login.php", data: "name=" + username + "&amp;pwd=" + password, success: function(html) { if (html == 'true') { //$("#add_err").html("right username or password"); window.location="dashboard.php"; } else { $("#error").css('display', 'inline', 'important'); $("#error").html("&lt;img src='images/alert.png' /&gt;Wrong username or password"); } }, beforeSend: function() { $("#error").css('display', 'inline', 'important'); $("#error").html("&lt;img src='images/ajax-loader.gif' /&gt; Loading...");//error was here } }); return false; }
score: 0
answers question: http://stackoverflow.com/q/24952887
type: Answer
has comment: http://stackoverflow.com/comment/38782014
has comment: http://stackoverflow.com/comment/38783741
has comment: http://stackoverflow.com/comment/38782140

http://stackoverflow.com/a/25047202
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25047126
answers question: http://stackoverflow.com/q/25047126
score: 1
has body: Your javascript isn't syntactically correct - function findMax(var x, var y) should just be function findMax(x, y). In general, if you write some javascript and nothing happens when you run it, it probably means something went wrong syntactically, and you should check your browser's Error Console. (In this case, it tells you that the function definition is where the error occurred, right on the first "var".)
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/24926930
downvote count: 0
answers question: http://stackoverflow.com/q/24926796
type: Answer
upvote count: 1
score: 1
has body: Set datatype to "json" and use data.id dataType Type: String The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html).

http://stackoverflow.com/a/25007873
upvote count: 2
has body: The target property of event objects points to the originator of the event; here, it’s the element that was the first target of the click, and that was apparently the &lt;span&gt;. If you want the element selected by .on(), jQuery provides it as this. $(document).on("click", "button", function(evt) { console.debug("got a click in", this); }); (Note that you don’t have to wait for $(document).ready when using delegation rooted in document.)
accepted answer of: http://stackoverflow.com/q/25007854
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25007854
score: 2

http://stackoverflow.com/comment/38755746
comment on: http://stackoverflow.com/q/24938260
type: Comment
type: QuestionComment
has text: Question is - what is the best way to do this with 1 function rather than one function for each audio file.
score: 0

http://stackoverflow.com/comment/69321937
has text: this behaviour has been changed in Ember 2.10, you cannot use it like that anymore.
type: Comment
score: 3
comment on: http://stackoverflow.com/a/30231452
type: AnswerComment

http://stackoverflow.com/q/25030789
has body: I wanted to build a accordion menu with drag and drop sortable capabilities, I could build it using bootstrap 3 + jQuery UI, but the problem is jQuery UI is conflicting with general operation of a bootstrap accordion. I'm very specific on using Bootstrap Accordion, but I need to resolve the problems produced by jQuery UI. Sometimes on sorting either one tab disappears When one tab is open and sorted, the closing is done only when the other tab is clicked. Improper arrangements of the sort order when tabs are open. I have consolidated it in a plnkr $(function(){ $( "#accordion" ).accordion().sortable({ connectWith: "#dropBag" }); $( "#dropBag" ).sortable({ connectWith: "#accordion" }); }); http://plnkr.co/edit/LpQuO9nfB4d5Nwhaj6my?p=preview Please Help.
linked to: http://stackoverflow.com/q/20424477
favorite count: 0
tagged with: accordion
tagged with: http://stackoverflow.com/tag/html
has title: jQuery UI + Bootstrap 3 sortable accordion not working properly
has comment: http://stackoverflow.com/comment/38929088
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
upvote count: 3
has answer: http://stackoverflow.com/a/25031447
type: Question
has comment: http://stackoverflow.com/comment/38929102
score: 3
has comment: http://stackoverflow.com/comment/38928842
tagged with: jquery-ui
accepted answer: http://stackoverflow.com/a/25031447
tagged with: javascript
has comment: http://stackoverflow.com/comment/38929005
has comment: http://stackoverflow.com/comment/38928770
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/38991556
comment on: http://stackoverflow.com/q/25064153
has text: Yes, I am well aware that JS uses prototypical inheritance. The notion of a class still exists I.e. objects that have the same prototype are considered to be of the same class.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39617335
comment on: http://stackoverflow.com/q/24971526
has text: I can confirm the below solution solves the problem.
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/24998975
downvote count: 0
has comment: http://stackoverflow.com/comment/38868179
accepted answer of: http://stackoverflow.com/q/24998875
has comment: http://stackoverflow.com/comment/38868592
type: Answer
upvote count: 1
score: 1
has body: Use jQuery's .on method as detailed here. Then your event will apply not only to any matching elements when it is defined but also matching elements that are added in the future via AJAX.
answers question: http://stackoverflow.com/q/24998875
type: AcceptedAnswer

http://stackoverflow.com/a/25003045
accepted answer of: http://stackoverflow.com/q/24983765
answers question: http://stackoverflow.com/q/24983765
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has body: So, here's a JavaScript implementation that is as simple as it gets. You're going to want to read up on jQuery, and specifically animations if you want to customize this even a little bit. Here is the working jsBin: http://jsbin.com/pozutidu/5/edit?html,js,output Essentially, the only important aspect of this is: bigImage.animate({opacity: .1 }, function() { $(this).attr('src', imageArray[imageIndex]) }); So what is happening here, is you're selected the Img, and animating it's opacity. Once the opacity has reached .1, the callback function takes the same element and relplaces the img.src. This gives off the appearance of an image fading in and out. References to look at: http://jquery.com/, http://api.jquery.com/animate/ before you can run this, you must include a link to the jQuery source file &lt; script src="http://code.jquery.com/jquery-2.1.0.min.js" >&lt; /script>
upvote count: 1

http://stackoverflow.com/q/24972591
type: Question
tagged with: node.js
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/38819549
has comment: http://stackoverflow.com/comment/38819354
linked to: http://stackoverflow.com/q/23114374
tagged with: javascript
type: UnansweredQuestion
has body: Going nuts trying to get past this. Should be trivial, but I'm obviously doing something stupid. Goal is to upload a file inside Express. In short request.files is coming back as undefined in my route handler : //modules ========================================== // ExpressJS 4.0 used for the middleware and web framework var express = require('express'); var bodyParser = require('body-parser'); var session = require('express-session'); var cookieParser = require('cookie-parser'); var flash = require('connect-flash'); var jsxml = require("node-jsxml"); var XMLWriter = require('xml-writer'); var request = require("request"); var fs = require('fs'); var app = express(); app.set('views', __dirname + '/views'); app.use(express.static(__dirname + '/public')); // Did I screw this up??! app.use(bodyParser({keepExtensions:true,uploadDir: __dirname + '/public/uploads'})); app.engine('html', require('ejs').renderFile); app.use(cookieParser('Ronaldinho')); app.use(session()); app.use(flash()); My file system: Here's the form where a file is submitted (via a plugin called DropZone): &lt;div id="dropzone"&gt; &lt;form action="/uploads" name="upload" class="dropzone" id="demo-upload" enctype="multipart/form-data" method="post"&gt; &lt;input type="file" name="theFile" /&gt; &lt;/form&gt; &lt;/div&gt; and the handler for the route: app.post('/uploads', function (request, response) { console.log('arrived'); console.log('1st TEST: ' + (request.files)); console.log('2nd TEST: ' + request.files.theFile.name); fs.readFile(request.files.theFile.path, function (err, data) { var newPath = "/home/path/to/your/directory/"+request.files.theFile.name; console.log (newPath); fs.writeFile(newPath, data, function (err) { res.send("hi"); }); }); }); I hit the function above every time I upload a file, but find that request.files is undefined. Here's the result on the console (I'm using Brackets - interesting to me that I never even see the second test hit the console window...): Any ideas what I'm …
has title: Node.js & Express file upload issue
tagged with: dropzone.js

http://stackoverflow.com/q/25047438
has body: So, I'm trying to dynamically create and download a csv in IE 9 , using just javascript. Currently, I use something like this: var oWin = window.open("about:blank", "_blank"); oWin.document.write(csvData); oWin.document.close(); var success = oWin.document.execCommand('SaveAs', true, 'MyDownload.csv'); oWin.close(); Unfortunately, if the system setting of 'hide extensions of known file types' in the file browser is checked, the extension doesn't appear in the download box, so it shows as MyDownload instead of MyDownload.csv and doesn't open correctly. Does anyone know a better way to go about this?
score: 2
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/49057825
favorite count: 0
type: Question
upvote count: 3
tagged with: internet-explorer-9
downvote count: 1
tagged with: export-to-csv
has title: Generating/downloading a csv in ie9
answer count: 0
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/24914416
has body: I am building a web application using dojox/app, and my config.json file looks like this: { "id": "app", "name": "app", "description": "Example dojox/app based Worklight app", "dependencies": [ "commonapp/app", "commonapp/BaseViewController", "dojo/store/Memory", "dojox/app/utils/mvcModel", "dojox/mvc/EditStoreRefListController", "dojo/store/Observable", "dojox/mobile/Button" ], "controllers": [ "dojox/app/controllers/Load", "dojox/app/controllers/Transition", "dojox/app/controllers/Layout", "dojox/app/controllers/HistoryHash"], "stores": { }, "models": { }, "defaultView": "MainTemplate", "defaultTransition": "slide", "views": { "MainTemplate": { "template": "commonapp/templates/MainTemplate.html", "controller": "commonapp/templates/MainTemplate.js", "nls": "commonapp/templates/nls/MainTemplate", "defaultView": "SampleView+HiddenMenu", "views": { "SampleView": { "template": "commonapp/sample/SampleView.html", "controller": "commonapp/sample/SampleView.js", "nls": "commonapp/sample/nls/SampleView", "constraint" : "center", }, "HiddenMenu": { "template": "commonapp/MenuItems/HiddenMenu.html", "controller": "commonapp/MenuItems/HiddenMenu.js", "nls": "commonapp/MenuItems/nls/HiddenMenu", "constraint" : "bottom" }, "ExpandedMenu": { "template": "commonapp/MenuItems/ExpandedMenu.html", "controller": "commonapp/MenuItems/ExpandedMenu.js", "nls": "commonapp/MenuItems/nls/ExpandedMenu", "constraint": "bottom" } } } } } The HiddenMenu and ExtendedMenu views only contain a button, that is used to toggle between each of these views. For example, HiddenMenu.html looks like: Label and HiddenMenu.js controller has the following code on the init method: on(this.view.dapMenuButton, "click", lang.hitch(this, function(e) { var transOpts = { target : "MainTemplate,ExpandedMenu", url : "#MainTemplate,ExpandedMenu" // this is optional if not set it will be created from target }; this.view.app.transitionToView(e.target,transOpts,e); })); The other one has similar code. The app loads corr…
type: Question
score: 0
tagged with: dojox.app
has title: Dojox/app: how to toggle between views correctly?
answer count: 1
tagged with: dojo
has answer: http://stackoverflow.com/a/24917675
tagged with: javascript
type: UnansweredQuestion
tagged with: ibm-mobilefirst

http://stackoverflow.com/q/24971177
favorite count: 0
has comment: http://stackoverflow.com/comment/38816017
accepted answer: http://stackoverflow.com/a/24971256
possible better answer: http://stackoverflow.com/a/71678584
answer count: 4
tagged with: node.js
type: AnsweredQuestion
upvote count: 36
has answer: http://stackoverflow.com/a/24971256
has answer: http://stackoverflow.com/a/24971243
has answer: http://stackoverflow.com/a/71678584
has answer: http://stackoverflow.com/a/78262919
has comment: http://stackoverflow.com/comment/38816063
type: Question
has comment: http://stackoverflow.com/comment/38816046
has body: i have problem with childNodes as below : Coffee Tea Coca Cola //childNodes.length = 7 but Coffee Tea Coca Cola //childNodes.length = 3 It seems each \n or textnode is considered a child ,how can i remove these from childNodes?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38816018
score: 35
has title: javascript check if child node is element or text node
has comment: http://stackoverflow.com/comment/38815926
downvote count: 1

http://stackoverflow.com/comment/38833767
type: Comment
has text: Just added the link, sorry for that!
comment on: http://stackoverflow.com/q/24979256
score: 0
type: QuestionComment

http://stackoverflow.com/q/24953572
type: UnansweredQuestion
score: 2
answer count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/80972128
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38783786
tagged with: iview-ui
downvote count: 0
has body: iview slider automatically decreases the .iview-caption div height after every slide and thats why my content cut last line. Please anybody Solve this problem. Here is Code:- Can’t decide if you hate your job or your boss more? Thinking of changing jobs? Register here for exciting new job opportunities with Staffing. Research shows that 78% of resumes are misleading. Want to find the other 22%? We’ve already done that for you.
has title: why iview slider automatic decrease height of iview-caption div after one slide
favorite count: 0

http://stackoverflow.com/q/24984916
type: AnsweredQuestion
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24985073
score: 0
has body: I want to know the height of the current view port or screen which is currently shown. That means if some of the part of the page is not shown due to overflowing, it should not include that. All of the following gave me same result, which includes the scrolling/non visible area of the page - $(document).height(); $(windows).height(); document.body.clientHeight; Can someone please let me know how can I know the height of the currently visible area of document in either JS or jQuery?
has title: Getting non scrolling height of the viewport
has answer: http://stackoverflow.com/a/24985073
type: Question

http://stackoverflow.com/comment/38848268
type: Comment
type: QuestionComment
has text: You can use javascript to convert. Try these [Convert BBcode jQuery](http://stackoverflow.com/questions/9210680/convert-bbcode-to-html-using-javascript-jquery) [BBCode to HTML](http://ufku.com/personal/bbc2html)
score: 0
comment on: http://stackoverflow.com/q/24988114

http://stackoverflow.com/comment/38958233
type: Comment
comment on: http://stackoverflow.com/a/25028457
type: AnswerComment
has text: With Browserify & Reactify now I get a blank page in browser, React isn't rendering: `browserify -t reactify app.js -o ../build/app-brow.js` My script tag is now: ` `
score: 0

http://stackoverflow.com/q/25025035
answer count: 1
tagged with: asynchronous
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25025803
has comment: http://stackoverflow.com/comment/38918161
type: Question
has title: Using q.js, does q.all execute immediate functions?
tagged with: javascript
tagged with: http://stackoverflow.com/tag/q
has body: Working with q.all, it seems the immediate functions in my array are not executing. The functions should each create a resolved promise, print it to console, and then return it. I'm seeing no console output, but Q.all seems satisfied and triggers 'then' with 2 null values. What's wrong with this? Thanks! var Q = require("q"); var p = Q('Q'); console.log('hi p='+ JSON.stringify(p.inspect())); return Q.all([ function(){ var a = Q('A'); console.log('thing A: '+JSON.stringify(a.inspect())); return a; }, function(){ var b= Q('B'); console.log('thing B: '+JSON.stringify(b.inspect())); return b; } ]).then( function(r){ console.log('A and B are done: '+JSON.stringify(r)); } )
score: 0

http://stackoverflow.com/a/24931947
score: 6
has comment: http://stackoverflow.com/comment/38742527
has comment: http://stackoverflow.com/comment/38743866
has comment: http://stackoverflow.com/comment/38741997
downvote count: 0
has comment: http://stackoverflow.com/comment/38742200
type: Answer
upvote count: 6
has body: You need and name on the input to work. &lt;input type="text" ng-model="name" ng-required="true" name='myName' ng-model='myName'/&gt; See my fiddle here http://jsfiddle.net/cmyworld/6Zjd3/1/
answers question: http://stackoverflow.com/q/24931873

http://stackoverflow.com/q/25066962
score: 0
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25067005
tagged with: mandrill
has body: Okay so, I'm trying to get the facebook name and email of a user (succeed in that), and then use mandrill to email me that info. But for some reason, can't seem to get the name and email address to pass into the params object. (I deleted a lot of the facebook login stuff to make it clearer) Help!! $(function() { function getCurrentUserInfo() { FB.api('/me', function(userInfo) { console.log(userInfo.name + ': ' + userInfo.email); temp = userInfo.email; name = userInfo.name; var needed = { "name": userInfo.name, "email": userInfo.email } function log(obj) { $('#response').text(JSON.stringify(obj)); } var m = new mandrill.Mandrill('key'); // create a variable for the API call parameters var params = { "message": { "from_email":"emailf", "to":[{"email":"emailg"}], "subject": "New email", "html": "*|NAME|* has the email *|EMAIL|* ", "autotext": "true", "track_opens": "true", "track_clicks": "true", "merge_vars": [ { "rcpt": "emailrep", "vars": [ { "name": "NAME", "content": "needed["name"]" }, { "name": "EMAIL", "content": "needed["email"]" } ] } ] } };
answer count: 1
tagged with: javascript
has title: Javascript passing variables
accepted answer: http://stackoverflow.com/a/25067005

http://stackoverflow.com/a/25012942
score: 2
accepted answer of: http://stackoverflow.com/q/25012029
downvote count: 0
answers question: http://stackoverflow.com/q/25012029
type: AcceptedAnswer
upvote count: 2
type: Answer
has body: As it seems the open-method doesn't update the position of the infowindow, you'll need to do it on your own(e.g. by binding the position of the infowindow to the position of the marker): infowindow.unbind('position'); if(infowindow.getPosition() != this.getPosition()) { infowindow.bindTo('position',this,'position'); infowindow.open(map,this); } else { infowindow.close(); infowindow.setPosition(null); } Demo: http://jsfiddle.net/aBg3N/ Another solution(but this solution relies on a undocumented property anchor): if(infowindow.get('anchor') != this) { infowindow.open(map,this); } else { infowindow.close(); } Demo: http://jsfiddle.net/AZC3z/ Both solutions will work with draggable markers and also when you use the same infowindow for multiple markers

http://stackoverflow.com/a/24939244
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24938235
has comment: http://stackoverflow.com/comment/38762962
has body: You should use this to get the maximum scrolleable value: $(document).height() - $(window).height() You get the entire web height and substract the window height (the height that you can see on your window), so the rest of it is what is left to scroll
answers question: http://stackoverflow.com/q/24938235
has comment: http://stackoverflow.com/comment/38763780
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38759645
type: Answer
score: 2

http://stackoverflow.com/q/24917380
linked to: http://stackoverflow.com/q/11721863
type: Question
has comment: http://stackoverflow.com/comment/38715491
tagged with: javascript
score: 0
tagged with: angularjs
answer count: 0
type: UnansweredQuestion
has body: I'm working on a solution that implements code from the following Stackoverflow post but I'm not able to access the variable. The code is... {{item}} Collect Then in the controller I have the following: $scope.getFilteredItems = function(){ var items = $scope.filteredItems; } But in the Angular controller, I can't access the variable $scope.filteredItems, why is that?
has comment: http://stackoverflow.com/comment/38715299
has title: Can't access array in $scope

http://stackoverflow.com/comment/38756177
type: Comment
has text: As long as you have the same Style-sheet file for all your "routes" the media queries should work on every "route". If you are using SPA and want to throw an event as soon as the "route" changes, you should take a look into the API of your framework it probably exposes such an event. Another way to go would be to use `setInterval`and check whether `window.location` has changed and throw the event yourself.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24939114

http://stackoverflow.com/a/27145803
downvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/52009474
has comment: http://stackoverflow.com/comment/115324544
upvote count: 1
has comment: http://stackoverflow.com/comment/52860867
answers question: http://stackoverflow.com/q/24991151
has body: It's not possible to get the headers for the request of the CURRENT page. This has been asked several times on SO. However, you can make a new request and retrieve the headers of that request. That way you are able to get the Basic Auth headers, base64 decode that string and then you have the username (and also the password). Decoding base64 in javascript can be done using the following function as suggested by @michael in the comments. window.atob("base64encodedString");
score: 0
has comment: http://stackoverflow.com/comment/115246092

camanjs
type: Tag
tags question: http://stackoverflow.com/q/24914902
tags question: http://stackoverflow.com/q/24994596
tag name: camanjs
tags question: http://stackoverflow.com/q/24971471

http://stackoverflow.com/a/24944365
score: 1
accepted answer of: http://stackoverflow.com/q/24943255
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: Try this library: http://jsbase64.codeplex.com/releases/view/89265. It is fast and seems to be reliable; it actually has a test suite. I tested it in IE8 mode using the HTML below and it worked well. I also created a JSBin (JSBin doesn't support IE8) with the library inlined here: http://jsbin.com/faxawa/1/edit?js,console. There is also a long StackOverflow thread on various base64 libraries that is worth looking at here: Base64 encoding and decoding in client-side Javascript. JS Bin
downvote count: 0
answers question: http://stackoverflow.com/q/24943255

http://stackoverflow.com/q/25001137
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38872712
has comment: http://stackoverflow.com/comment/38872372
has body: I am having problem modifying an attribute of an HTML element using jQuery attr command. I have a script that inserts an SVG element with a child element that has the attribute stdDeviation. You can see that the D letter is capitalized. When I try to get the attribute using $("#myparentdiv feGaussianBlur").attr("stdDeviation"), The attribute can't be retrieved because the attribute is not found. I try to set the stdDeviation attribute to lowercase in the code, but when I try to access it with lowercase, it shows in Internet Explorer 11 (debugging on this browser), that the attribute with the D as uppercase instead of lower case. When I try to write the attribute, it put a second attribute with a lower case, so I get to have two of those attributes, one with a lowercase D and one with uppercase. I don't know which to blame, jQuery or IE11 and can't seem to solve this. Any idea? The Code (after setting the attribute): &lt;div id="some_id_1"&gt; &lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&gt; &lt;defs&gt; &lt;filter id="t3"&gt; &lt;feGaussianBlur stdDeviation="0" stddeviation="39" /&gt; &lt;/filter&gt; &lt;/defs&gt; &lt;image filter="url(&amp;quot;#t3&amp;quot;)" x="0" y="0" width="350.048px" height="768.75px" xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="images/test1.png" /&gt; &lt;/svg&gt; &lt;/div&gt; Trying to access it from code: $("#some_id_1 " + "feGaussianBlur").attr("stdDeviation", radius); What it does: sets the attribute as lowercase instead of what I've wrote with uppercase. You can see that it shows twice after the update.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38873043
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/38872650
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19129298
score: 3
upvote count: 3
tagged with: internet-explorer-11
has comment: http://stackoverflow.com/comment/38872270
has answer: http://stackoverflow.com/a/25001244
type: Question
has comment: http://stackoverflow.com/comment/38872700
has comment: http://stackoverflow.com/comment/38872657
has comment: http://stackoverflow.com/comment/38872986
has title: Can't access an attribute
has comment: http://stackoverflow.com/comment/38872335
downvote count: 0

http://stackoverflow.com/comment/38899256
comment on: http://stackoverflow.com/q/25015051
has text: what is scrolling problem. i couldn't find it .can you explain more please
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25035195
has comment: http://stackoverflow.com/comment/38936701
type: Question
has comment: http://stackoverflow.com/comment/38936538
has comment: http://stackoverflow.com/comment/38936438
score: 0
has comment: http://stackoverflow.com/comment/38937598
linked to: http://stackoverflow.com/q/10927722
has comment: http://stackoverflow.com/comment/38936484
has comment: http://stackoverflow.com/comment/38936871
has comment: http://stackoverflow.com/comment/38936166
has title: Get value from .not result
has body: Below code returns the 'not' of two lists arrays : var original = "test1,test2,test3" var updated = "test1,test2,test4,test5" var originalArray = original.split(','); var updatedArray = updated.split(','); console.log(originalArray.length) console.log(updatedArray.length) console.log($(originalArray).not(updatedArray)) console.log($(updatedArray).not(originalArray)) fiddle : http://jsfiddle.net/zhHfG/8/ The value of console.log($(updatedArray).not(originalArray)) is : ["test4", "test5", prevObject: jQuery.fn.jQuery.init[4], context: undefined, selector: ".not(test1,test2,test3)", constructor: function, init: function…] How can the values "test4", "test5" be accessed ? I could access them using array accessors [0],[1] but is there a cleaner way since the amount of returned values is variable ?
has comment: http://stackoverflow.com/comment/38943892
answer count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion

http://stackoverflow.com/comment/113083443
has text: The article in the first link has moved to [https://robdodson.me/shadow-dom-javascript/](https://robdodson.me/shadow-dom-javascript/)
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25053376
type: AnswerComment

http://stackoverflow.com/comment/74567443
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24936457
has text: Regarding `useCapture`, the following snippet is from the [Mozilla docs](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Parameters): "indicates that events of this type will be dispatched to the registered listener, before being dispatched to any EventTarget beneath it in the DOM tree."
score: 0

http://stackoverflow.com/q/24925461
has body: I use this code: svg.selectAll(".dot") .data(data) .enter().append("circle") .attr("class", "dot") .attr("r", function(d) { return domainOnlyScale(parseFloat(d.Size)+0.01); } ) .attr("cx", function(d) {return x(d.x+(Math.random() * 0.25) - 0.125); }) .attr("cy", function(d) { return y(d.y+(Math.random() * 0.25) - 0.125); }) .style("fill", function(d) { return color(d.color); }) .style("stroke-width", "1px") .style("stroke", function(d) { return strokecolor(d.color); }); And everything works. All data points show up. Now I change this part of the code to: console.log(data); // Shows all data points! var groupings = svg.selectAll("g") .data(data) .enter() .append("g") .attr("transform", function(d){return "translate("+(x(d.x+(Math.random() * 0.25) - 0.125))+","+y(d.y+(Math.random() * 0.25) - 0.125)+")"}); //used console.log here) groupings.append("circle") .attr("class", "dot") .attr("r", function(d) { return domainOnlyScale(parseFloat(d.size)+0.01); } ) .style("fill", function(d) { return color(d.color); }) .style("stroke-width", "1px") .style("stroke", function(d) { return strokecolor(d.color); }); groupings.append("text") .attr("class", "bubbletext") .attr("dx", function(d){ return -4 }) .attr("dy", function(d){ return +5 }) .text( function(d) { return d.category.substring(0,1); } ); I used another console.log inside the function of the transform of the groupings-creation, and the data is already filtered there. From a few tries it seems as if the first ~15 entries are missing. Thanks in advance!
tagged with: arrays
has title: Data missing when using group-element as opposed to dots
has answer: http://stackoverflow.com/a/24929511
tagged with: javascript
has comment: http://stackoverflow.com/comment/38735982
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/38736553
type: Question
tagged with: d3.js
accepted answer: http://stackoverflow.com/a/24929511
answer count: 1
score: 0

http://stackoverflow.com/comment/38808799
type: QuestionComment
comment on: http://stackoverflow.com/q/24967204
has text: It's possible if you can browse to the directory and then scrape the output to find the file names and such that you want. Without exposing the directory to the browser, it will require server-side stuff.
score: 0
type: Comment

http://stackoverflow.com/comment/43298862
score: 0
has text: Your "here" link which presumably contains the answer shows only `java.lang.NullPointerException`. BTW: link-only answers are not welcome practice. One of the reasons is that if the linked site goes down the answer becomes value-less and void. Discussion: http://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers
type: AnswerComment
comment on: http://stackoverflow.com/a/24916735
type: Comment

http://stackoverflow.com/a/25050483
answers question: http://stackoverflow.com/q/25049958
type: Answer
score: 0
has body: Using regExps is really, really easier! Use the regExp /[0-9\-]/g to check if the text contains only the characters you want, and if it doesn't show the error msg. $(document).ready(function () { $("#quantity").keypress(function (e) { var text = this.value; if (text.match(/[0-9\-]/g).join('') != text) { $("#errmsg").html("Digits Only").show().fadeOut("slow"); return false; } }); });

http://stackoverflow.com/a/24999797
downvote count: 0
answers question: http://stackoverflow.com/q/24999493
score: 3
has comment: http://stackoverflow.com/comment/38889884
type: AcceptedAnswer
upvote count: 3
has comment: http://stackoverflow.com/comment/38870419
type: Answer
has body: You haven't initiliazed flash in your middleware in app.js. Adding app.use(flash) before passport middleware should fix the problem. See connect-flash #usage for more info.
has comment: http://stackoverflow.com/comment/38889900
accepted answer of: http://stackoverflow.com/q/24999493

http://stackoverflow.com/comment/38910893
type: QuestionComment
has text: Selects have a fairly obvious change event that you can use. But with inputs you need to be clearer/more specific, as there are many logical events to hook into depending on the exact functionality you need.
comment on: http://stackoverflow.com/q/25021236
score: 0
type: Comment

http://stackoverflow.com/q/25036852
downvote count: 0
favorite count: 0
tagged with: selenium-ide
has title: Supporting custom Selenium IDE commands in a formatter
tagged with: python
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: selenium
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/27787220
has body: I have managed to add custom commands to Selenium IDE, but am having difficulties supporting these in a format, namely, an extended version of the Python WebDriver format. In the script generated when exporting to my custom format, I get the following for the commands I've added: # ERROR: Caught exception [unknown command [finalPrice]] I've added this command to user-extensions.js as follows: Selenium.prototype.doFinalPrice = function (locator) { return ''; } CommandBuilders.add('action', function (window) { var result = { command: 'finalPrice', target: this.getRecorder(window).clickedElementLocators, execute: function () { return; }, getDefinition: function () { return true; } }; return result; }) and extended the standard Python WebDriver format.js with the following: WDAPI.Driver.prototype.finalPrice = function (locatorType, locator) { return ["#PRICE", locatorType, locator].join('|'); }; SeleniumWebDriverAdaptor.prototype.finalPrice = function () { var locator = this._elementLocator(this.rawArgs[0]); var driver = new WDAPI.Driver(); return driver.finalPrice(locator.type, locator.string); } Has anyone managed to successfully do this and, if so, can you point out where I'm going wrong? As I've said, the command itself in Selenium IDE works fine, it's only the exporting to my custom format that fails. Any help would be much appreciated.
answer count: 1

http://stackoverflow.com/comment/38928696
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25030985
type: QuestionComment
has text: Try `jquery.cookie.js`

http://stackoverflow.com/comment/38985787
type: Comment
type: QuestionComment
has text: Well, considering that I don't know what you modified...
comment on: http://stackoverflow.com/q/25060578
score: 0

http://stackoverflow.com/a/24937331
accepted answer of: http://stackoverflow.com/q/24936664
answers question: http://stackoverflow.com/q/24936664
has comment: http://stackoverflow.com/comment/38771046
score: 0
has body: I am not sure what you mean by back-end. I am assuming that you are asking how do you know if some other action has changes your model object, value etc. Here is some pseudo example.. scope.$watch('lastLatency', function (val) {... you got your new value here ....} In this example "lastLatency" value is being watched to take action.
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38754539
type: Answer

http://stackoverflow.com/a/24997982
score: 0
type: AcceptedAnswer
type: Answer
has body: You are using incompatible versions of jquery and jqueryui. The .delegate() function was only added in jquery 1.4.2. (see here) The latest jqueryui version requires jquery 1.6+ (see here).
accepted answer of: http://stackoverflow.com/q/24997863
answers question: http://stackoverflow.com/q/24997863

http://stackoverflow.com/tag/svg
tags question: http://stackoverflow.com/q/24990020
tags question: http://stackoverflow.com/q/24925461
tags question: http://stackoverflow.com/q/24968825
tags question: http://stackoverflow.com/q/24942012
tags question: http://stackoverflow.com/q/25023264
tags question: http://stackoverflow.com/q/24997889
tags question: http://stackoverflow.com/q/24970479
tags question: http://stackoverflow.com/q/25055711
tags question: http://stackoverflow.com/q/24982675
tags question: http://stackoverflow.com/q/24915252
tags question: http://stackoverflow.com/q/25046999
tags question: http://stackoverflow.com/q/25007543
tags question: http://stackoverflow.com/q/24933619
tags question: http://stackoverflow.com/q/24982898
tags question: http://stackoverflow.com/q/25060741
tags question: http://stackoverflow.com/q/24928539
tags question: http://stackoverflow.com/q/25064050
tags question: http://stackoverflow.com/q/25039471
tags question: http://stackoverflow.com/q/25062223
tags question: http://stackoverflow.com/q/24968418
tags question: http://stackoverflow.com/q/24992162
tags question: http://stackoverflow.com/q/24913733
tag name: svg
tags question: http://stackoverflow.com/q/25007466
tags question: http://stackoverflow.com/q/24993189
tags question: http://stackoverflow.com/q/24975256
tags question: http://stackoverflow.com/q/24920186
tags question: http://stackoverflow.com/q/24995674
tags question: http://stackoverflow.com/q/24940885
tags question: http://stackoverflow.com/q/24947508
tags question: http://stackoverflow.com/q/24988765
tags question: http://stackoverflow.com/q/25063405
tags question: http://stackoverflow.com/q/24909261
tags question: http://stackoverflow.com/q/24913599
tags question: http://stackoverflow.com/q/25012434
tags question: http://stackoverflow.com/q/25015947
tags question: http://stackoverflow.com/q/25001137
tags question: http://stackoverflow.com/q/24936131
tags question: http://stackoverflow.com/q/25065896
tags question: http://stackoverflow.com/q/25017827
tags question: http://stackoverflow.com/q/24975475
tags question: http://stackoverflow.com/q/25023887
tags question: http://stackoverflow.com/q/25062902
tags question: http://stackoverflow.com/q/24913270
tags question: http://stackoverflow.com/q/25013379
tags question: http://stackoverflow.com/q/24981757
tags question: http://stackoverflow.com/q/24980067
tags question: http://stackoverflow.com/q/25003585
tags question: http://stackoverflow.com/q/25037780
tags question: http://stackoverflow.com/q/24973856
tags question: http://stackoverflow.com/q/24951484
tags question: http://stackoverflow.com/q/25024404
tags question: http://stackoverflow.com/q/25047791
tags question: http://stackoverflow.com/q/24939491
tags question: http://stackoverflow.com/q/24974142
tags question: http://stackoverflow.com/q/25041190
tags question: http://stackoverflow.com/q/25069531
tags question: http://stackoverflow.com/q/25059078
tags question: http://stackoverflow.com/q/24910730
type: Tag

http://stackoverflow.com/comment/38859800
type: QuestionComment
comment on: http://stackoverflow.com/q/24993426
has text: The above code works in jfiddle. Is there anything else Joomla related that may be causing a problem?
score: 0
type: Comment

http://stackoverflow.com/q/24919975
score: 0
tagged with: stream
tagged with: file
answer count: 1
tagged with: node.js
type: UnansweredQuestion
has title: Externally Modifying a File Breaks Writable Streams in node.js
has body: I've got a simple logging tool to write log data to disk, it works like this: Use fs.createWriteStream to create a writable stream using the flags 'a' for appending. This creates or opens the file for me to write data to. Use writeStream.write() to write data to my log file. This works perfectly, except for in these two cases: I open the log file while my application is running, change something, and save the log file. I delete the log file while the application is running. Expected behavior is to recreate the file and keep logging away. In both cases I can still call writeStream.write() with no error. Inspecting my writeStream object after I either modify or delete the log file while the application is running shows the writeStream.writable property to be true. Each time I call writeStream.write() the writelen property increases which leads me to believe the writeStream thinks that everything is OK, even though it is not. My questions: Why does modifying and saving my log file externally cause writeStream.write() to stop writing data to my file? How do I fix it? Why does deleting my log file externally cause writeStream.write() to stop writing data to my file? How do I fix it?
tagged with: javascript
type: Question
has answer: http://stackoverflow.com/a/24928014

http://stackoverflow.com/comment/38943849
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25038642
has text: You didn't post any usable code and your english is very bad. Its hard to understand what you need. Made a better question, be more specific in your needs.

http://stackoverflow.com/comment/39011748
score: 0
type: Comment
has text: I already fixed it with arr.map() here: [Pass a variable to a function from inside an ajax call](http://stackoverflow.com/a/25068606) but thanks for your help
type: AnswerComment
comment on: http://stackoverflow.com/a/25064125

http://stackoverflow.com/q/24929931
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/38741900
linked to: http://stackoverflow.com/q/30473933
favorite count: 0
has body: &lt;script type="text/javascript"&gt; $(function() { $.ajax({ type: "POST", url: "BillnAmount", cache: false, dataType: 'json', success: function(data) { console.log(data); var data = { labels: ["January", "February", "March", "April", "May", "June", "July"], datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", strokeColor: "rgba(220,220,220,1)", pointColor: "rgba(220,220,220,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(220,220,220,1)", data: [65, 59, 80, 81, 56, 55, 40] }, { label: "My Second dataset", fillColor: "rgba(151,187,205,0.2)", strokeColor: "rgba(151,187,205,1)", pointColor: "rgba(151,187,205,1)", pointStrokeColor: "#fff", pointHighlightFill: "#fff", pointHighlightStroke: "rgba(151,187,205,1)", data: [28, 48, 40, 19, 86, 27, 90] } ] }; var ctx = $("#myChart").get(0).getContext("2d"); var myNewChart = new Chart(ctx); var myLineChart = new Chart(ctx).Line(data); } }); }); &lt;/script&gt; I am calling a url with ajax and getting its response in json format. Inside ajax call I am drawing Line chart with Chart.js which is working properly. Now I want to change above chart value with json response data my json response value is {"billDetails": [{"invoiceDate":"2014-07-24T00:00:00","totalAmount":1031.00,"totalBills":1}, {"invoiceDate":"2014-07-15T00:00:00","totalAmount":7281.00,"totalBills":3}, {"invoiceDate":"2014-07-12T00:00:00","totalAmount":14841.00,"totalBills":7}, {"invoiceDate":"2014-07-11T00:00:00","totalAmount":1294.00,"totalBills":3}, {"invoiceDate":"2014-07-10T00:00:00","totalAmount":674.00,"totalBills":3}, {"invoiceDate":"2014-07-09T00:00:00","totalAmount":2.00,"totalBills":1}, {"totalAmount":114.00,"totalBills":10}]} What changes should I do so it must display data from json response Edit: I tried this var data1; $.each(data.billDetails, function(i, value) { data1 = { labels: data.billDetails[i].invoiceDate, datasets: [ { label: "My First dataset", fillColor: "rgba(220,220,220,0.2)", …
tagged with: ajax
accepted answer: http://stackoverflow.com/a/24973605
possible better answer: http://stackoverflow.com/a/32405884
has title: Drawing line chart in chart.js with json response
has answer: http://stackoverflow.com/a/32405884
has comment: http://stackoverflow.com/comment/38745605
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38777359
tagged with: chart.js
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 4
answer count: 2
has answer: http://stackoverflow.com/a/24973605
has comment: http://stackoverflow.com/comment/38777396

http://stackoverflow.com/a/25044601
answers question: http://stackoverflow.com/q/25044452
has comment: http://stackoverflow.com/comment/38954853
has comment: http://stackoverflow.com/comment/38954608
upvote count: 2
has comment: http://stackoverflow.com/comment/38954664
has body: Yes, there is a much better way: var currentLocation = $(".click")[0].id; $(".click").on("dblclick", function() { if (this.id != currentLocation) { badAnswer = true; } });
score: 2
has comment: http://stackoverflow.com/comment/38954757
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25044452
type: Answer

http://stackoverflow.com/comment/38762881
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24942412
type: QuestionComment
has text: Thanks guys, was an unrelated issue

http://stackoverflow.com/comment/38757128
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24939458
type: Comment
has text: Why do you have to do this? What's the point? The functions don't seem to have anything to do with each other.

http://stackoverflow.com/comment/38859714
comment on: http://stackoverflow.com/a/24994307
type: AnswerComment
score: 0
type: Comment
has text: @Novocaine88 pls check my demo If you not satisfied other answer

http://stackoverflow.com/q/24986572
has comment: http://stackoverflow.com/comment/38861738
type: Question
has comment: http://stackoverflow.com/comment/38845237
has title: Is there a name/term for a static method that calls all instance methods of the same name?
accepted answer: http://stackoverflow.com/a/24986617
tagged with: oop
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38845406
has comment: http://stackoverflow.com/comment/38845207
has body: Given the following code, is there a name/term for a static method that calls an instance method of the same name for each existing instance? Is this a common practice in any programming languages? The use case is being able to make one function call and ensure all instances are affected without having to duplicate the code for the method. Note: this is just example code to illustrate the question window.MyClass = (function(){ var _instances = []; function MyClass( name ){ _instances.push( this ); this.name = name; } MyClass.prototype.myMethod = function( arg ) { console.log( this ); console.log( arg ); }; // This public static method calls the instance method of the same name for each instance MyClass.myMethod = function(){ var i = _instances.length; while( i-- ){ var instance = _instances[i]; instance.myMethod.apply( instance, arguments ); } }; return MyClass; })(); a = new MyClass('a'); b = new MyClass('b'); MyClass.myMethod( true ); console.log('--------------------------------------------------------------------------------'); a.myMethod(false); b.myMethod(false); http://jsfiddle.net/bryandowning/7sr87/
has comment: http://stackoverflow.com/comment/38845470
has comment: http://stackoverflow.com/comment/38845215
possible better answer: http://stackoverflow.com/a/24986735
tagged with: javascript
has answer: http://stackoverflow.com/a/24986735
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24986617
downvote count: 0
has comment: http://stackoverflow.com/comment/38845187
score: 1
has answer: http://stackoverflow.com/a/24986864
favorite count: 0

http://stackoverflow.com/comment/38703179
comment on: http://stackoverflow.com/q/24909235
type: Comment
has text: Thanks, was just a simple syntax error in the JSON file :)
score: 0
type: QuestionComment

http://stackoverflow.com/a/25015205
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25014448
answers question: http://stackoverflow.com/q/25014448
type: Answer
has body: DefinitelyTyped is the place to look for typescript definition files: https://github.com/borisyankov/DefinitelyTyped/tree/master/node You can use your favorite package manager to get it and all of the DefinitelyTyped deffinitions are available in NuGet. There are a quite a few specific NPM modules on there too, but some you will have to define yourself. In VS2013 when you add a deffinition file (*.d.ts) then it will be available from the IntelliSense.
score: 1

http://stackoverflow.com/comment/38872306
type: Comment
has text: Why does it work in jsfiddle though... The official api seems to suggest it works with display. http://api.jquery.com/visible-selector/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24999353

http://stackoverflow.com/q/24943704
has comment: http://stackoverflow.com/comment/38795074
answer count: 2
has body: I'm trying to improve the accessibility of the applications I write. I'm also learning more about ember. As an exercise, I'm working with the ember-js todoMVC demo app (code for the app is here) to add features that assist users of screen readers. One thing I'd like to learn how to do is trigger editing of a todo item from the keyboard. The &lt;label&gt; element that holds the title of the item could be focused and then go into edit mode with a press of the Enter/Return key. In the demo, only a double-click on the &lt;label&gt; will open the item for editing. This behavior is handled by an action helper, which I understand is used specifically for making elements clickable. Here's the part of the template in question. I've elided features of the code to remove unrelated logic: {{#each itemController="todo"}} &lt;li ... &gt; ... {{input type="checkbox" checked=isCompleted class="toggle"}} &lt;label {{action "editTodo" on="doubleClick"}}&gt;{{title}}&lt;/label&gt; ... &lt;/li&gt; {{/each}} "Don't use the action helper" would seem to be the place to start. But what's the best way to handle each item now? As the itemController="todo" in the each helper denotes, there is a TodoController (which extends ObjectController) that defines an editTodo function. I'd like to have a keyPress event trigger that function. (For now, we can disregard the inspection of the event to capture only the Enter/Retrun key.) I've added tabindex="0" to the label element, and it appears I can focus it with my keyboard. I've tried adding a keyPress function to the TodoController's actions hash, but it is not triggered when I press keys. I think this is because there isn't really a View for each item--the ArrayController for the todos and the template seem to be handling the display of the todo items between themselves. I've done a lot of reading today, and it seems like I may need to specify a View for each item, possibly using a ContainerView and specifying its itemViewClass property, so that I …
tagged with: javascript
linked to: http://stackoverflow.com/q/16499742
tagged with: accessibility
upvote count: 1
tagged with: ember.js
has comment: http://stackoverflow.com/comment/38800371
has comment: http://stackoverflow.com/comment/38765705
favorite count: 0
has answer: http://stackoverflow.com/a/24945240
has title: How do I capture keyPress events on an item in a list with ember.js?
has comment: http://stackoverflow.com/comment/38766750
accepted answer: http://stackoverflow.com/a/25068266
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25068266
possible better answer: http://stackoverflow.com/a/24945240
type: Question

http://stackoverflow.com/q/25047126
score: -1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38959826
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/25047175
type: Question
has answer: http://stackoverflow.com/a/25047202
has answer: http://stackoverflow.com/a/25047144
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25047202
has body: I am bit unclear in understanding why this below piece of code is not showing the message box, http://jsfiddle.net/KendoDev/p8Mk2/ function findMax(var x, var y) { //alert("x is:" + x + " y is: " +y); var max = 0; if(x&gt;y) max = x; else max = y; alert("max is: " + max); return max; } var c=4,d=9; var m = findMax(c,d);
has answer: http://stackoverflow.com/a/25047145
possible better answer: http://stackoverflow.com/a/25047174
favorite count: 0
has title: Passing arguments in a javascript function is not working
has comment: http://stackoverflow.com/comment/38960443
has answer: http://stackoverflow.com/a/25047174
answer count: 5

http://stackoverflow.com/q/24911834
has comment: http://stackoverflow.com/comment/38705801
answer count: 1
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38705273
type: Question
has comment: http://stackoverflow.com/comment/38725288
has title: D3 Zooming in graph
tagged with: javascript
has comment: http://stackoverflow.com/comment/38707950
has answer: http://stackoverflow.com/a/28207929
has comment: http://stackoverflow.com/comment/38706050
tagged with: zooming
has body: i have tried using D3.zoom behavior in my scatterplot graph. But the problem i am having now is that, i can only zoom my graph ONLY when i mouseover my DOT. Any reasons why? I want it to be able to zoom in anywhere as long as my mouse is pointing inside the graph. And also, my X axis doesn't stays at the bottom... it gets zoomed in as well Is it possible to just let the X Axis stay constant at the bottom? here are my codes... var margin = {top: 30, right: 20, bottom: 30, left: 50}, width = 650 - margin.left - margin.right, height = 400 - margin.top - margin.bottom; var parseDate = d3.time.format("%Y-%m-%dT%H:%M:%S").parse; var x = d3.time.scale().range([0, width]); var y = d3.scale.linear().range([height, 0]); var zoom = d3.behavior.zoom() .scaleExtent([0.95, 10]) .on("zoom", zoomed); var drag = d3.behavior.drag() .origin(function(d) { return d; }) .on("dragstart", dragstarted) .on("drag", dragged) .on("dragend", dragended); var xAxis = d3.svg.axis().scale(x) .orient("bottom").ticks(5); var valueline = d3.svg.line() .x(function(d) { return x(d.ArtDateTime); }) .y(function(d) { return y(d.Ranking); }); var svg = d3.select(".graph") .append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom) .append("g") .attr("transform", "translate(" + margin.left + "," + margin.top + ")") .call(zoom); function zoomed() { svg.attr("transform", "translate(" + d3.event.translate + ")scale(" + d3.event.scale + ")"); svg.selectAll("g") .attr("width", width) .attr("height", height); } function make_x_axis() { return d3.svg.axis() .scale(x) .orient("bottom") .ticks(4) } function make_y_axis() { return d3.svg.axis() .scale(y) .orient("left") .ticks(4) } function dragstarted(d) { d3.event.sourceEvent.stopPropagation(); d3.select(this).classed("dragging", true); } function dragged(d) { d3.select(this).attr("cx", d.x = d3.event.x).attr("cy", d.y = d3.event.y); } function dragended(d) { d3.select(this).classed("dragging", false); } d3.…
score: 0

http://stackoverflow.com/q/24982344
upvote count: 1
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: Get a row of images to slide horizontally when clicked using AngularJS and CSS
answer count: 0
downvote count: 0
has body: If I have an unordered list of images, with only 3 being shown at a time, how can use animations to achieve a horizontal scrolling effect? I'd rather not use jQuery or other 3rd party plugins if possible
score: 1
has comment: http://stackoverflow.com/comment/38837658
type: Question
tagged with: javascript

http://stackoverflow.com/a/25017783
type: Answer
answers question: http://stackoverflow.com/q/25017088
score: 0
has body: There is something in angular called Directive, which is exactly to create reusable components. it's the solution you are looking for, directive can be reuse in different modules. Check angular directive documentation https://docs.angularjs.org/guide/directive

http://stackoverflow.com/a/25040312
score: 0
answers question: http://stackoverflow.com/q/25039427
has comment: http://stackoverflow.com/comment/38948727
has comment: http://stackoverflow.com/comment/38946395
type: Answer
has comment: http://stackoverflow.com/comment/38948518
has comment: http://stackoverflow.com/comment/38968658
has comment: http://stackoverflow.com/comment/38948698
has comment: http://stackoverflow.com/comment/38947279
has body: You can use a custom formatter for that, that both ceils the number value and suffixes. For example: // Custom formatter that ceils all number values and suffixes .00$ function myCurrencyFormatter (cellvalue, options, rowObject) { if(cellvalue == undefined) return "0.00$"; else return Math.ceil(cellvalue) + ".00$"; } { label: "Sunm", name:'f4', index:'f4', width:120, search: false, // Uses the custom formatter formatter: myCurrencyFormatter, } You can try it out here: http://jsfiddle.net/Mowday/NH498/

http://stackoverflow.com/a/25040563
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25040337
answers question: http://stackoverflow.com/q/25040337
has comment: http://stackoverflow.com/comment/38967955
has comment: http://stackoverflow.com/comment/38967880
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38967648
has body: This should do the job: var images = $('#carousel img'); var count = images.length; var loaded = 0; images.each(function() { var image = new Image(); image.onload = function() { loaded += 1; if (loaded == count) { //all images loaded } } image.src = $(this).attr('src'); });
type: Answer

http://stackoverflow.com/a/24912080
answers question: http://stackoverflow.com/q/24911341
type: Answer
has body: It turns out I had fillets defined somewhere else. So I changed the name of the variable and it works: var fillet_array = []; function fillet_change(thumb, cid, sku, width, selected_matte) { if (typeof(selected_matte) === "undefined") { selected_matte = fillet_selected_matte; //console.log("fillet_selected_matte: "+ fillet_selected_matte); } if (typeof(width) === "undefined") { width = .31; } if (mattes_selected_type == 15) //letter mattes { alert("Fillets can only be applied to rectangular openings. Your current layout does not contain any rectangular openings, fillet was not applied"); return; } var img = new Image(); img.src = SITE_URL + '/system/components/compimg/' + thumb + '/pattern'; img.onload = function() { img.width = width * ppi; img.height = width * ppi; $( document ).ready(function() { $("div[id^='opening_']").each(function(i) //for each div that has an id of opening_(number) { //Set the values in the array with the width and height switch(selected_matte) { case "fillet_matte_layer_bottom": moulding_matte_canvas_width[i] = $("#opening_" + i).width(); moulding_matte_canvas_height[i] = $("#opening_" + i).height(); index = 2; break; case "fillet_matte_layer_middle": moulding_matte_canvas_width[i] = $("#opening_" + i).width() + 10; moulding_matte_canvas_height[i] = $("#opening_" + i).height() + 10; index = 1; break; case "fillet_matte_layer_top": if (mattes_default_selected == true) { moulding_matte_canvas_width[i] = $("#opening_" + i).width() + 22; moulding_matte_canvas_height[i] = $("#opening_" + i).height() + 22; } else { moulding_matte_canvas_width[i] = $("#opening_" + i).width(); moulding_matte_canvas_height[i] = $("#opening_" + i).height(); } index = 0; break; } var fillet_xml = " " + thumb + " " + width + " " + cid + " " + sku + " "; var fillet = { index: index, imgsrc: thumb, width: width, cid: cid, sku: sku }; fillet_array.push(fillet); mattes_mattes_xml = mattes_get_mattes_xml().replace(" ", " " + fillet_xml + " "); common_get_order_xml(); mouldi…
score: 0

http://stackoverflow.com/q/24981671
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38835501
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24981814
has comment: http://stackoverflow.com/comment/38835564
has title: Creating expandable list to show rest of content
tagged with: php
has body: I have a sidebar on my site that displays categories in this format. Category1 Category2 Category3 Category4 Category5 However I have around 50 that I need to display. Instead of having my sidebar stretch very far down and look out of place I was wanting to display the top 10 and then provide a button that allows the sidebar to expand to show the rest. So on default it shows 10 but if the button is clicked it will expand and I will be able to see all 50. I am almost certain this will use some jQuery however I don't know where to start with this. Here is the function that gets the categories from the database. function load_categories() { global $db; $query = $db-&gt;write_query(' SELECT c.*, COUNT(n.id) AS count FROM ' . TABLE_PREFIX . 'newscategories c LEFT JOIN ' . TABLE_PREFIX . 'news n ON FIND_IN_SET (c.cid, n.cid) GROUP BY c.cid ORDER BY count DESC '); while ($cat = $db-&gt;fetch_array($query)) { $categories[$cat['cid']] = array( 'name' =&gt; $cat['name'], 'count' =&gt; $cat['count'] ); } return $categories; } Here is the bit of PHP code that will output the categories each on a new line. if ($all_categories) { foreach ($all_categories as $cid =&gt; $arr) { $sidebar .= '&lt;a href="index.php?action=sort&amp;cid=' . $cid . '"&gt;' . $arr['name'] . ' (' . $arr['count'] . ')&lt;/a&gt;&lt;br /&gt;'; } } else { $sidebar = 'There are no categories yet'; }
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24981795
has comment: http://stackoverflow.com/comment/38835643
answer count: 2
has answer: http://stackoverflow.com/a/24981795
possible better answer: http://stackoverflow.com/a/24981814

angularjs
tags question: http://stackoverflow.com/q/24985226
tags question: http://stackoverflow.com/q/25055199
tags question: http://stackoverflow.com/q/25000004
tags question: http://stackoverflow.com/q/24938215
tags question: http://stackoverflow.com/q/25066025
tags question: http://stackoverflow.com/q/24941297
tags question: http://stackoverflow.com/q/24940554
tags question: http://stackoverflow.com/q/24947946
tags question: http://stackoverflow.com/q/24912426
tags question: http://stackoverflow.com/q/24933472
tags question: http://stackoverflow.com/q/25026174
tags question: http://stackoverflow.com/q/25032118
tags question: http://stackoverflow.com/q/24943162
tags question: http://stackoverflow.com/q/24916788
tags question: http://stackoverflow.com/q/25030688
tags question: http://stackoverflow.com/q/24924465
tags question: http://stackoverflow.com/q/25041446
tags question: http://stackoverflow.com/q/24929584
tags question: http://stackoverflow.com/q/25018970
tags question: http://stackoverflow.com/q/24933951
tags question: http://stackoverflow.com/q/24927784
tags question: http://stackoverflow.com/q/24942969
tags question: http://stackoverflow.com/q/24964014
tags question: http://stackoverflow.com/q/25066005
tags question: http://stackoverflow.com/q/25052325
tags question: http://stackoverflow.com/q/24922311
tags question: http://stackoverflow.com/q/24912182
tags question: http://stackoverflow.com/q/24974767
tags question: http://stackoverflow.com/q/25066578
tags question: http://stackoverflow.com/q/24975587
tags question: http://stackoverflow.com/q/24942412
tags question: http://stackoverflow.com/q/24945276
tags question: http://stackoverflow.com/q/24987000
tags question: http://stackoverflow.com/q/25017088
tags question: http://stackoverflow.com/q/25062394
tags question: http://stackoverflow.com/q/24910341
tags question: http://stackoverflow.com/q/25059448
tags question: http://stackoverflow.com/q/25004671
tags question: http://stackoverflow.com/q/25042764
tags question: http://stackoverflow.com/q/25047340
tags question: http://stackoverflow.com/q/25005231
tags question: http://stackoverflow.com/q/25049468
tags question: http://stackoverflow.com/q/24977814
tags question: http://stackoverflow.com/q/24994837
tags question: http://stackoverflow.com/q/24929233
tags question: http://stackoverflow.com/q/25037291
tags question: http://stackoverflow.com/q/25042946
tags question: http://stackoverflow.com/q/24981322
tags question: http://stackoverflow.com/q/24990456
tags question: http://stackoverflow.com/q/24931873
tags question: http://stackoverflow.com/q/25039243
tags question: http://stackoverflow.com/q/25010244
tags question: http://stackoverflow.com/q/24974142
tags question: http://stackoverflow.com/q/24963731
tags question: http://stackoverflow.com/q/25056344
tags question: http://stackoverflow.com/q/25028268
tags question: http://stackoverflow.com/q/24960336
tags question: http://stackoverflow.com/q/24944787
tags question: http://stackoverflow.com/q/24977471
tags question: http://stackoverflow.com/q/24932913
tags question: http://stackoverflow.com/q/24923178
tags question: http://stackoverflow.com/q/25018152
tags question: http://stackoverflow.com/q/25003772
tags question: http://stackoverflow.com/q/25018293
tags question: http://stackoverflow.com/q/24961938
tags question: http://stackoverflow.com/q/25034630
tags question: http://stackoverflow.com/q/24985623
tags question: http://stackoverflow.com/q/24972601
tags question: http://stackoverflow.com/q/24997749
tags question: http://stackoverflow.com/q/25003695
tags question: http://stackoverflow.com/q/25055878
tags question: http://stackoverflow.com/q/25021396
tags question: http://stackoverflow.com/q/25067963
tags question: http://stackoverflow.com/q/24994533
tags question: http://stackoverflow.com/q/25060602
tags question: http://stackoverflow.com/q/24989367
tags question: http://stackoverflow.com/q/25017885
tags question: http://stackoverflow.com/q/24910730
type: Tag
tags question: http://stackoverflow.com/q/25049953

http://stackoverflow.com/comment/38877332
comment on: http://stackoverflow.com/a/25003719
has text: @JuanMendes: I realized that as soon as I posted that comment lol. My hands were faster than my brain. Interesting solution, @lonut!
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25020379
tagged with: python
favorite count: 0
possible better answer: http://stackoverflow.com/a/25020521
upvote count: 1
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38910447
has answer: http://stackoverflow.com/a/25020521
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/25020466
downvote count: 0
tagged with: javascript
tagged with: flask
has body: I'm using the following code: var oDiv = document.createElement ("DIV"); oDiv.innerHTML='&lt;img src="{{ url_for(\'static\', filename=\'images/bubble4.png\') }}"&gt;' to try and insert an image from my javascript file into my html file. As you can see, I'm using flask. The innerHtml seems to be working because the broken image links do appear. I think the problem is coming from all of the different double and single quotes in flask's url_for syntax, but I can't figure out how to properly escape them. If I manually add the img tag to my HTML, the image shows up just fine. Any thoughts?
has answer: http://stackoverflow.com/a/25020466
has title: Trouble Using JavaScript to Insert HTML Img Tag
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25051869
upvote count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25052955
favorite count: 0
has title: Best approach in sliding image and appending some room for content
has comment: http://stackoverflow.com/comment/38968484
tagged with: css
has answer: http://stackoverflow.com/a/25051978
has body: I'm working with a jquery and I have this image that is the main problem. I googled it but came up with nothing. Here is my content for example. And when the guy(in the picture above) is being click I want it to slide to the left side and will looked like this. Please see image below. So what I'm thinking is 1. using addClass and removeClass using jquery or 2. just use jquery .slide or toggle function? If there's a solution as such how could it be done? Since I only know is using addClass tho. And also what I'm planning is when the image exceeds 800px then the girl(in the image) will be send to back of the guy image.
downvote count: 0
has comment: http://stackoverflow.com/comment/38969279
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25052116
type: Question
score: 1
has comment: http://stackoverflow.com/comment/38968397
answer count: 3

http://stackoverflow.com/a/25007632
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24987854
has body: It seems a bug of HB to determine the type of {{this}}. Workaround is, you can change the {{this}} to {{./this}}
answers question: http://stackoverflow.com/q/24987854
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38998256
type: Comment
comment on: http://stackoverflow.com/a/25066858
score: 0
type: AnswerComment
has text: This will not work if clicked multiple pages right? because the initial url has to been updated as well?

http://stackoverflow.com/q/24977210
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24977227
answer count: 1
has body: I need to replace the commas in each &lt;li&gt; value with a period. I have no idea what's wrong with my code. I checked the console, but nothing... $('#stats li').each(function () { $(this).text().replace(/,/g, '.'); }); This code should target each &lt;li&gt; in &lt;ul id="stats"&gt;. Then it should replace each , in each &lt;li&gt; and replace it with a . I also tried this: $('#stats li').each(function () { var comma = /,/g; if(comma.test($this)) { $(this).replace(comma, '.'); } }); And I tried this: $('#stats li').each(function () { var stats = []; stats.push($(this).text()); stats.replace(/,/g, '.'); console.log(stats); }); Here is the Fiddle.
favorite count: 0
has answer: http://stackoverflow.com/a/24977227
type: AnsweredQuestion
score: 2
duplicate of: http://stackoverflow.com/q/17039262
upvote count: 3
downvote count: 1
linked to: http://stackoverflow.com/q/17039262
has comment: http://stackoverflow.com/comment/38827394
type: Question
has comment: http://stackoverflow.com/comment/38827373
has comment: http://stackoverflow.com/comment/38827410
has title: Replace comma with period jQuery
tagged with: javascript

http://stackoverflow.com/q/24933678
has body: I have some URLs that are encoded by encodeURI() or encodeURIComponent(). Some parts of it may not be encoded too. You can see some examples: www.yazlm.com/üı www.yazlm.com/ı%C4%C1%FD http://www.yazlm.com/abc%def%E2%80%99 www.yazlm.com/привет http://www.abcyazlm.com/i?i=http%3A%2F%2Fwww How can I write a function to compare two URLs are either same or not. For example consider that four URLs: First one's path is encoded by encodeURI() Second one's path is encoded by encodeURIComponent() Third one is not encoded Fourth one's path's some parts are encoded and some parts are not. (www.url.com/encoded/plain) I want to detect that they are all same.
type: Question
has title: How to detect which JavaScript function used at URI for encoding and how to encode not encoded URI parts?
tagged with: urlencode
has comment: http://stackoverflow.com/comment/38750490
score: 0
has comment: http://stackoverflow.com/comment/38750325
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38749843
tagged with: urldecode
answer count: 0
has comment: http://stackoverflow.com/comment/38750256

http://stackoverflow.com/comment/38748338
type: AnswerComment
has text: Thanks @Slimshadddyyy - Cant get this to work.. If I change the text from "Choose an Option..." to "Choose a Product..." Still the old msg Choose an Option comes up in the drop box.. I have refreshed cache & indexes.. Maybe a different file is actioning the function.. ? I added the '$$('#attribute525 option')[1].selected = true;' - still lookin at this
score: 0
comment on: http://stackoverflow.com/a/24933910
type: Comment

node.js
tags question: http://stackoverflow.com/q/25023893
tags question: http://stackoverflow.com/q/24938491
tags question: http://stackoverflow.com/q/24985962
tags question: http://stackoverflow.com/q/24964626
tags question: http://stackoverflow.com/q/24931234
tags question: http://stackoverflow.com/q/24984299
tags question: http://stackoverflow.com/q/25023118
tags question: http://stackoverflow.com/q/24958714
tags question: http://stackoverflow.com/q/24947262
tags question: http://stackoverflow.com/q/25051864
tags question: http://stackoverflow.com/q/25025311
tags question: http://stackoverflow.com/q/24942278
tags question: http://stackoverflow.com/q/24951637
tags question: http://stackoverflow.com/q/25003225
tags question: http://stackoverflow.com/q/25050930
tags question: http://stackoverflow.com/q/24942911
tags question: http://stackoverflow.com/q/25013735
tags question: http://stackoverflow.com/q/24999493
tags question: http://stackoverflow.com/q/24986962
tags question: http://stackoverflow.com/q/24971650
tags question: http://stackoverflow.com/q/24943060
tags question: http://stackoverflow.com/q/24968767
tags question: http://stackoverflow.com/q/25045131
tags question: http://stackoverflow.com/q/25001789
tags question: http://stackoverflow.com/q/25007779
tags question: http://stackoverflow.com/q/25011079
tags question: http://stackoverflow.com/q/24952467
tags question: http://stackoverflow.com/q/25037690
tags question: http://stackoverflow.com/q/25064669
tags question: http://stackoverflow.com/q/24978927
tags question: http://stackoverflow.com/q/24934986
tags question: http://stackoverflow.com/q/24946176
tags question: http://stackoverflow.com/q/25035019
tags question: http://stackoverflow.com/q/24921560
tags question: http://stackoverflow.com/q/24999031
tags question: http://stackoverflow.com/q/24913706
tags question: http://stackoverflow.com/q/25039916
tags question: http://stackoverflow.com/q/25014872
tags question: http://stackoverflow.com/q/24988626
tags question: http://stackoverflow.com/q/25009596
tags question: http://stackoverflow.com/q/24976655
tags question: http://stackoverflow.com/q/25035967
tags question: http://stackoverflow.com/q/25049383
tags question: http://stackoverflow.com/q/24976808
tags question: http://stackoverflow.com/q/25063868
tags question: http://stackoverflow.com/q/25020364
tags question: http://stackoverflow.com/q/25048730
tags question: http://stackoverflow.com/q/24957147
tags question: http://stackoverflow.com/q/24975530
tags question: http://stackoverflow.com/q/24951269
tags question: http://stackoverflow.com/q/25013421
tags question: http://stackoverflow.com/q/25040420
tags question: http://stackoverflow.com/q/24982179
tags question: http://stackoverflow.com/q/24945704
tags question: http://stackoverflow.com/q/24956159
tags question: http://stackoverflow.com/q/25002023
tags question: http://stackoverflow.com/q/24965897
tags question: http://stackoverflow.com/q/24985590
tags question: http://stackoverflow.com/q/25069299
tags question: http://stackoverflow.com/q/25015441
tags question: http://stackoverflow.com/q/25001175
tags question: http://stackoverflow.com/q/24970087
tags question: http://stackoverflow.com/q/24956231
tags question: http://stackoverflow.com/q/25064094
tags question: http://stackoverflow.com/q/24912408
tags question: http://stackoverflow.com/q/25001898
tags question: http://stackoverflow.com/q/24977180
tags question: http://stackoverflow.com/q/24918809
tags question: http://stackoverflow.com/q/24962663
tags question: http://stackoverflow.com/q/25045805
tags question: http://stackoverflow.com/q/25053505
tags question: http://stackoverflow.com/q/24916763
tags question: http://stackoverflow.com/q/24919975
tags question: http://stackoverflow.com/q/24933728
tags question: http://stackoverflow.com/q/24976950
tags question: http://stackoverflow.com/q/24932616
tags question: http://stackoverflow.com/q/24971177
tags question: http://stackoverflow.com/q/24985826
tags question: http://stackoverflow.com/q/24957259
tags question: http://stackoverflow.com/q/24964636

http://stackoverflow.com/q/24965870
has title: Can I add new properties to event that is triggered from code
downvote count: 0
has comment: http://stackoverflow.com/comment/38806312
score: 1
type: Question
answer count: 2
has body: in this demo if you click on #s2 the append will execute twice, but if you click on the button which triggers a click on #s2 the append will execute just once, because I can't add new properties to the event when it is triggered from code it. Is this intended behavior? (I know that if I use e.originalEvent.handled instead of e.handled it works the same both ways) http://jsbin.com/tirufoqa/1/edit click s1 click s2 $('div').on('click', 'span', function(e){ if(e.handled) return; e.handled = 1; $(this).append("*"); }); $('button').click(function(){ $('#s2').click(); });
has answer: http://stackoverflow.com/a/24966735
has answer: http://stackoverflow.com/a/24966580
has comment: http://stackoverflow.com/comment/39979569
tagged with: javascript
tagged with: event-handling
tagged with: jquery
has comment: http://stackoverflow.com/comment/38806246
upvote count: 1
has comment: http://stackoverflow.com/comment/38806303
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/25055472
score: -1
has comment: http://stackoverflow.com/comment/38974951
has body: You need to make a css and give media = "print", something like this: &lt;link rel="your path" media="print"&gt; /* define these properties into css file: */ .noprint{display: none;} .print{display: block;} It will work.
downvote count: 1
has comment: http://stackoverflow.com/comment/38974940
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/25055359

http://stackoverflow.com/q/24937904
upvote count: 0
has title: Absolutely position elements inside a fixed position container
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38753907
favorite count: 0
has answer: http://stackoverflow.com/a/24938002
has comment: http://stackoverflow.com/comment/38753686
has answer: http://stackoverflow.com/a/24938150
tagged with: http://stackoverflow.com/tag/html
tagged with: css
possible better answer: http://stackoverflow.com/a/24938002
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38754553
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24938150
has body: Is it possible to absolutely position elements inside a fixed position container? For example: I want to be able to move, using jQuery, the container div to the left and right (and it's children along with it), but this obviously doesn't work (moving the container's left property does not affect the children). I tried something like this: ...but it doesn't work. I know I could ultimately just drop the container and animate each of the fixed position children at the same time, but I'd really prefer not to. I'll probably end up adding more children later, and that would mean managing the animations/movements of each one (now that I think of it, I could just add a class to each child, and have jQuery animate the left property of all occurances of that class, but I'd still prefer to resolve my initial problem if possible). Hacks are welcome!
score: -1
has comment: http://stackoverflow.com/comment/38754075
answer count: 2

http://stackoverflow.com/comment/38796929
has text: Have you tried anything yourself?
comment on: http://stackoverflow.com/q/24961071
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/38705297
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24911860
score: 1
has text: Put quotes around the class attribute. ` Change `

http://stackoverflow.com/q/24920186
tagged with: http://stackoverflow.com/tag/svg
has comment: http://stackoverflow.com/comment/39217078
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24945004
upvote count: 1
tagged with: stylesheet
tagged with: dom
has comment: http://stackoverflow.com/comment/38724312
type: Question
has body: I tried to add a style sheet to an SVG element, like this: var theSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg"); var theStyle = document.createElementNS("http://www.w3.org/2000/svg", "style"); theSvg.appendChild(theStyle); console.log("theStyle.sheet=", theStyle.sheet); // undefined, try adding svg to DOM document.body.appendChild(theSvg); console.log("theStyle.sheet=", theStyle.sheet); // still undefined What am I supposed to do to get to the sheet node there in theStyle? There is a fiddle here: http://jsfiddle.net/XaV7D/2/
has comment: http://stackoverflow.com/comment/38722475
tagged with: javascript
has title: How do I create a style sheet for an SVG element?
has answer: http://stackoverflow.com/a/59053655
answer count: 3
linked to: http://stackoverflow.com/q/21323751
possible better answer: http://stackoverflow.com/a/24920251
downvote count: 0
has comment: http://stackoverflow.com/comment/39226674
has answer: http://stackoverflow.com/a/24920251
has answer: http://stackoverflow.com/a/24945004
favorite count: 0

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

http://stackoverflow.com/comment/38932148
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25032549
type: Comment
has text: As per @YuryTarabanko answer, empty promise is unnecessary: ["If a single argument is passed to jQuery.when and it is not a Deferred or a Promise, it will be treated as a resolved Deferred and any doneCallbacks attached will be executed immediately."](https://api.jquery.com/jQuery.when/). I suppose it works for the multi-argument case too.

http://stackoverflow.com/a/25036188
has comment: http://stackoverflow.com/comment/38939478
type: Answer
has body: Give id= "mymodal" to the div. Then in script create a click function and call this div by id : $("#mymodal").show(); The modal shows with its content.
score: -1
downvote count: 2
answers question: http://stackoverflow.com/q/25036059
upvote count: 1

http://stackoverflow.com/comment/38802253
comment on: http://stackoverflow.com/q/24963557
score: 0
type: QuestionComment
type: Comment
has text: How can I offer reputation?

http://stackoverflow.com/q/24965163
accepted answer: http://stackoverflow.com/a/24998093
has body: I've been working with particle systems in Three.js for a couple weeks now. I started out using an Object3D and adding my own Vector3s and MeshBasicMaterials (and other materials like Phong and Lambert) then someone turned me on to the built-in ParticleSystem object and the BasicParticleMaterial because it could be tagged for sorting and may have other advantages. However, now through some further research I'm finding these may be deprecated (ParticleSystem, BasicParticleMaterial) and perhaps it is now PointCloud and PointCloudMaterial. Along the way I discovered that BasicParticleMaterial could support only one texture for all the particles, and I need to used multiple textures so my questions are: What are the current Object and Material for a particle system in Three.js? Does it support multiple textures (a variety of images for the particles)? If the current particle system doesn't support multiple textures, I'm considering going back to an Object3D with custom materials and geometry. Is there a more suitable choice I might be missing? UPDATE My specific task is to make several hundred abstract figures each composed of multiple particle clouds (10+) and each of those particle clouds composed of 400+ particles. The particles are different hand drawn sketch marks so that when many varied marks are present in each cloud the whole figure appears hand drawn. All the marks lightly pulse from the center as if blown by a light wind. I am looking for the most efficient material and object for this task that can also handle multiple textures so the particles can be different hatch marks. For example, below is a single particle cloud (each abstract figure would be composed of a variety of differently shaped clouds like this), however this cloud is composed of only a single kind of hatch mark and I would like to mix a variety of marks as particles.
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38805226
tagged with: javascript
has comment: http://stackoverflow.com/comment/38865521
has title: Object and Material for a particle system in Three.js?
has comment: http://stackoverflow.com/comment/38865824
answer count: 1
downvote count: 0
tagged with: opengl-es
favorite count: 0
tagged with: three.js
tagged with: particle-system
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24998093

http://stackoverflow.com/a/24974746
has body: A possible implementation in query could be: $(document).ready(function(){ $(".myCheckboxClass").bind('click', function(){ $(this).css('background-color', 'red'); }); }); You can basically do the same in js, just check the proper syntax. The key thing is the "this" selection of the clicked element.
type: Answer
score: 2
downvote count: 0
upvote count: 2
answers question: http://stackoverflow.com/q/24974683

http://stackoverflow.com/comment/42387635
type: AnswerComment
type: Comment
has text: @sabithpocker: Depends on what you mean by "scope," because a lot of people misuse the word. In JavaScript, the scope of a function is defined entirely by where the function is created. So if you pass an actual *function* into `setTimeout`, it runs in the scope it was created in. Example: http://jsbin.com/hatexu/1/edit Sometimes people use "scope" incorrectly to refer to the value of `this` within the function. All functions called via `setTimeout` are called with `this` referring to the global object (the window, on browsers).
comment on: http://stackoverflow.com/a/25003310
score: 1

http://stackoverflow.com/a/25027417
has comment: http://stackoverflow.com/comment/38922758
has comment: http://stackoverflow.com/comment/38922917
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25026702
type: Answer
answers question: http://stackoverflow.com/q/25026702
score: 2
upvote count: 2
has body: The problem is that the content of the select is transcluded (see below). If you inspect the elements that are output you don't even see the option tags you defined inside. As you're just using a string you should use a pre-linking function where you add the correct option in via javascript. The following code should do the trick (Forked Plunk). link: { pre: function(scope, element, attrs){ if(attrs.allowBlank === 'true') element.append('&lt;option value=""&gt;&lt;/option&gt;'); else if(attrs.allowBlank &amp;&amp; attrs.allowBlank !== '') element.append('&lt;option value=""&gt;' + attrs.allowBlank + '&lt;/option&gt;'); } } EDIT The select does not 'transclude' it's contents, as @lightswitch05 pointed out the select directive grabs the first child with value="" as the empty node (source ref). Then later it clears out the contents of the select and dynamically adds in the relevant &lt;option&gt; tags (source ref)
has comment: http://stackoverflow.com/comment/38922538

http://stackoverflow.com/comment/38714280
comment on: http://stackoverflow.com/q/24916792
score: 0
type: Comment
type: QuestionComment
has text: How about using anchors? I mean something like `example.com/home#anchor`.

http://stackoverflow.com/q/24953697
answer count: 1
downvote count: 1
tagged with: lodash
favorite count: 0
has comment: http://stackoverflow.com/comment/38783480
has comment: http://stackoverflow.com/comment/38783820
upvote count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24954405
score: 3
has comment: http://stackoverflow.com/comment/38783639
has comment: http://stackoverflow.com/comment/38783531
has title: iterating through array of nested objects with javascript/lodash
type: Question
has answer: http://stackoverflow.com/a/24954405
tagged with: algorithm
has comment: http://stackoverflow.com/comment/38783868
tagged with: javascript
has body: I have an array of objects that represents a nested navigation list. [ { name: 'one', link: 'blah/blah', pages: [ { name: 'one A' link: 'blah/blah', pages: [] }, { name: 'one B' link: 'blah/blah', pages: [] }, { name: 'one C' link: null, pages: [ { name: 'one C I' link: 'blah/blah', pages: [] } ] } ] } ] The first level of objects can have a link and pages the nested objects will either have a link or pages. I can't assume a limit to the depth of the nesting. I need an object for each state that includes its name, its link if it exists and all of its parents. My current solution does not account for deeper than 3 levels of nesting and adding support for each layer is laborious. I also need to be able to search the resulting array of objects to get their link later on if that makes a difference to the solution. I need a javascript solution but can also (and would like to) use the functions contained in the lodash library

http://stackoverflow.com/q/24923134
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24945297
tagged with: django-templates
type: UnansweredQuestion
has title: Morris.js displaying incorrect line graph with Django template array
tagged with: django
tagged with: python
has body: I recently heard of Morris.js and attempted to include a line graph in a website I was working on. However, whenever I feed elements from my dates array to the data component of Morris.line(), the graph fails to display properly and instead displays a bunch of weird dates. The relevant snippet of my JS code is shown here: Morris.Line({ element: 'line', data: [ { d: {{ dates.0 }}, v: {{ polar.0 }}}, { d: {{ dates.1 }}, v: {{ polar.1 }}}, { d: {{ dates.2 }}, v: {{ polar.2 }}}, { d: {{ dates.3 }}, v: {{ polar.3 }}}, { d: {{ dates.4 }}, v: {{ polar.4 }}}, ], xkey: 'd', ykeys: ['v'], labels: ['Polarity'] }); And the result can be seen here: https://i.sstatic.net/T98FO.png The dates that were supplied to the line graph were simply '2005', '2006', '2007', '2008', and '2009', in order to test the functionality of the graph. How can I fix this?
type: Question
tagged with: morris.js
tagged with: javascript

http://stackoverflow.com/comment/38998878
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25044850
type: Comment
has text: I’ve found one ugly solution. You can external api with callback other than `JSON_CALLBACK`. And (this is ugly part) you must create global method with the same name as callback. In that global method you can handle response.

http://stackoverflow.com/comment/38732322
score: 0
type: Comment
has text: @abhi yes, with this solution every controller makes it's own request. But you can use the `cache: true` option to cache the result. So the second controller will load the data from the cache. see the Caching section in the docs here: https://docs.angularjs.org/api/ng/service/$http
comment on: http://stackoverflow.com/a/24920605
type: AnswerComment

http://stackoverflow.com/comment/38731551
comment on: http://stackoverflow.com/a/24926116
score: 1
type: AnswerComment
has text: The problem in your solution is all the time the underline will be visible on normal mode. I mean mouse out.
type: Comment

http://stackoverflow.com/comment/38945350
has text: Iv'e been sat this afternoon scratching my head over a similar issue, in that bootstrap.js can't access any elements in the shadow dom, because internally inside it's code, when it tries to manipulate things, it uses the full 'document....' dom syntax. I clicked you where using JQ, but because you where referencing the shadow dom correctly It didn't occur to me that could be your problem.
comment on: http://stackoverflow.com/a/25039465
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38967682
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25051575
has text: you forgot to add EOS(end of statement) in your `alert(e.target.id)`
score: 0

http://stackoverflow.com/comment/39022270
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25032432
type: AnswerComment
has text: then use `comment.split(' ').length` for number of words in single comment

http://stackoverflow.com/a/40374606
score: -1
answers question: http://stackoverflow.com/q/25035296
upvote count: 0
has body: I tried the following code but observed that it did not provide any scroller for responsive devices. Hence decided to customise the JQGRID stylesheet: $(window).on("resize", function () { var $grid = $("#list"), newWidth = $grid.closest(".ui-jqgrid").parent().width(); $grid.jqGrid("setGridWidth", newWidth, true); }); Please find my hack for making JQ Grid properly responsive /**** JQ grid responsiveness ***/ #gview_jqgrid, div#myPager {width:100% !important;height:100% !important;} .ui-jqgrid-hdiv, .ui-jqgrid-htable {width:100% !important;height:100% !important;} .ui-jqgrid-bdiv, #jqgrid {width:100% !important;height:100% !important;} .ui-jqgrid .ui-jqgrid-hbox {padding-right:0 !important;} .ui-jqgrid tr.jqgrow td { white-space: pre-wrap !important;} div#gbox_jqgrid { width: 100% !important; overflow-x: scroll; margin-bottom: 80px !important;} Add this to the custom stylesheet &amp; get set to view the JQGrid fully responsive! Any other suggestions will be most welcomed. Try it out &amp; Enjoy!
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/68025096
has comment: http://stackoverflow.com/comment/103881153

splice
tags question: http://stackoverflow.com/q/24930737
tag name: splice
type: Tag

http://stackoverflow.com/comment/38827058
type: Comment
comment on: http://stackoverflow.com/q/24976961
score: 0
has text: The "why" is important to understand the question well enough to give you an informed response. There are probably better ways to accomplish whatever you're trying to achieve. IMHO...
type: QuestionComment

php
tags question: http://stackoverflow.com/q/25053639
tags question: http://stackoverflow.com/q/25017588
tags question: http://stackoverflow.com/q/25043791
tags question: http://stackoverflow.com/q/24946749
tags question: http://stackoverflow.com/q/25049380
tags question: http://stackoverflow.com/q/24993561
tags question: http://stackoverflow.com/q/24932034
tags question: http://stackoverflow.com/q/24976372
tags question: http://stackoverflow.com/q/25057053
tags question: http://stackoverflow.com/q/24911860
tags question: http://stackoverflow.com/q/24953613
tags question: http://stackoverflow.com/q/25057164
tags question: http://stackoverflow.com/q/25067593
tags question: http://stackoverflow.com/q/25016190
tags question: http://stackoverflow.com/q/24918030
tags question: http://stackoverflow.com/q/24967815
tags question: http://stackoverflow.com/q/25001445
tags question: http://stackoverflow.com/q/25040338
tags question: http://stackoverflow.com/q/24984649
tags question: http://stackoverflow.com/q/25016118
tags question: http://stackoverflow.com/q/25014984
tags question: http://stackoverflow.com/q/25006813
tags question: http://stackoverflow.com/q/24984889
tags question: http://stackoverflow.com/q/24971127
tags question: http://stackoverflow.com/q/25060308
tags question: http://stackoverflow.com/q/24993276
tags question: http://stackoverflow.com/q/25000120
tags question: http://stackoverflow.com/q/25027616
tags question: http://stackoverflow.com/q/24939358
tags question: http://stackoverflow.com/q/24957115
tags question: http://stackoverflow.com/q/25015714
tags question: http://stackoverflow.com/q/24935132
tags question: http://stackoverflow.com/q/24942248
tags question: http://stackoverflow.com/q/24913502
tags question: http://stackoverflow.com/q/24914832
tags question: http://stackoverflow.com/q/25044548
tags question: http://stackoverflow.com/q/25028542
tags question: http://stackoverflow.com/q/25045745
tags question: http://stackoverflow.com/q/25058521
tags question: http://stackoverflow.com/q/25049773
tags question: http://stackoverflow.com/q/24915525
tags question: http://stackoverflow.com/q/25039187
tags question: http://stackoverflow.com/q/24949709
tags question: http://stackoverflow.com/q/25002008
tags question: http://stackoverflow.com/q/25062371
tags question: http://stackoverflow.com/q/24961545
tags question: http://stackoverflow.com/q/24946832
tags question: http://stackoverflow.com/q/24962711
tags question: http://stackoverflow.com/q/25062649
tags question: http://stackoverflow.com/q/25034083
tags question: http://stackoverflow.com/q/24969473
tags question: http://stackoverflow.com/q/25022293
tags question: http://stackoverflow.com/q/24951222
tags question: http://stackoverflow.com/q/25016381
tags question: http://stackoverflow.com/q/24910775
tags question: http://stackoverflow.com/q/24918576
tags question: http://stackoverflow.com/q/25026663
tags question: http://stackoverflow.com/q/24994766
tags question: http://stackoverflow.com/q/24922460
tags question: http://stackoverflow.com/q/25046548
tags question: http://stackoverflow.com/q/25007571
tags question: http://stackoverflow.com/q/24979376
tags question: http://stackoverflow.com/q/24955965
tags question: http://stackoverflow.com/q/24975084
tags question: http://stackoverflow.com/q/24958273
tags question: http://stackoverflow.com/q/24982893
tags question: http://stackoverflow.com/q/24959266
tags question: http://stackoverflow.com/q/24972148
tags question: http://stackoverflow.com/q/25039378
tags question: http://stackoverflow.com/q/25060471
tags question: http://stackoverflow.com/q/24971518
tags question: http://stackoverflow.com/q/24925338
tags question: http://stackoverflow.com/q/25067266
tags question: http://stackoverflow.com/q/25010326
tags question: http://stackoverflow.com/q/25027104
tags question: http://stackoverflow.com/q/24911902
tags question: http://stackoverflow.com/q/25033263
tags question: http://stackoverflow.com/q/24985981
tags question: http://stackoverflow.com/q/24949511
tags question: http://stackoverflow.com/q/25009766

http://stackoverflow.com/comment/38997307
type: QuestionComment
has text: What is AjaxResponseBuilder ?
comment on: http://stackoverflow.com/q/25067124
score: 0
type: Comment

http://stackoverflow.com/a/25010251
score: 0
type: Answer
has body: ALUMNOS
answers question: http://stackoverflow.com/q/25010008

http://stackoverflow.com/comment/38811617
comment on: http://stackoverflow.com/q/24960108
score: 0
type: QuestionComment
has text: Try merging your geometry for better performance. Each mesh means an extra draw call for the GPU. If you want to apply different colors to lines, you might use vertex colors if you decide to merge the geometry.
type: Comment

http://stackoverflow.com/a/24996611
type: Answer
answers question: http://stackoverflow.com/q/24996470
has body: Anatomy of event tracking
score: 0

backbone.js
tags question: http://stackoverflow.com/q/25020567
tags question: http://stackoverflow.com/q/25059549
tags question: http://stackoverflow.com/q/24956038
tags question: http://stackoverflow.com/q/25037723
tags question: http://stackoverflow.com/q/25059128
tags question: http://stackoverflow.com/q/24979353
tags question: http://stackoverflow.com/q/25029479
tags question: http://stackoverflow.com/q/24979007
tags question: http://stackoverflow.com/q/25014977
tags question: http://stackoverflow.com/q/24993288
tags question: http://stackoverflow.com/q/24925102
tags question: http://stackoverflow.com/q/24917157
tags question: http://stackoverflow.com/q/25035516
tags question: http://stackoverflow.com/q/24958417
tags question: http://stackoverflow.com/q/24941795
tags question: http://stackoverflow.com/q/24987854
tags question: http://stackoverflow.com/q/25002690
tags question: http://stackoverflow.com/q/24968268
tags question: http://stackoverflow.com/q/24984083
tags question: http://stackoverflow.com/q/24996910
tags question: http://stackoverflow.com/q/24921099
tags question: http://stackoverflow.com/q/25055641
tags question: http://stackoverflow.com/q/24955164
tags question: http://stackoverflow.com/q/24936645
tags question: http://stackoverflow.com/q/24961271
tags question: http://stackoverflow.com/q/25063005
tags question: http://stackoverflow.com/q/24921122
tags question: http://stackoverflow.com/q/24940639
tags question: http://stackoverflow.com/q/24920870
tags question: http://stackoverflow.com/q/24928309
tags question: http://stackoverflow.com/q/24976097
tags question: http://stackoverflow.com/q/24967874
tags question: http://stackoverflow.com/q/25038885
tags question: http://stackoverflow.com/q/24959703
tags question: http://stackoverflow.com/q/24955318
tags question: http://stackoverflow.com/q/25015176
tags question: http://stackoverflow.com/q/24986815
tags question: http://stackoverflow.com/q/24949980
tags question: http://stackoverflow.com/q/24909393
tags question: http://stackoverflow.com/q/24966254
tags question: http://stackoverflow.com/q/24918809
tags question: http://stackoverflow.com/q/24992295
tags question: http://stackoverflow.com/q/25027468
tags question: http://stackoverflow.com/q/24952502
tags question: http://stackoverflow.com/q/24990081
tags question: http://stackoverflow.com/q/24931758
tags question: http://stackoverflow.com/q/24974854
tags question: http://stackoverflow.com/q/24912734
tags question: http://stackoverflow.com/q/24913703
tags question: http://stackoverflow.com/q/24963326
tags question: http://stackoverflow.com/q/24966733
tags question: http://stackoverflow.com/q/24964155
tags question: http://stackoverflow.com/q/25051640
tags question: http://stackoverflow.com/q/25022263
tags question: http://stackoverflow.com/q/24999194
tags question: http://stackoverflow.com/q/24919452
type: Tag
tags question: http://stackoverflow.com/q/24918888
tags question: http://stackoverflow.com/q/24941520
tags question: http://stackoverflow.com/q/24995268
tags question: http://stackoverflow.com/q/24984903
tags question: http://stackoverflow.com/q/24963160
tags question: http://stackoverflow.com/q/24995815
tags question: http://stackoverflow.com/q/25039815
tags question: http://stackoverflow.com/q/24935541
tags question: http://stackoverflow.com/q/24929471
tag name: backbone.js

http://stackoverflow.com/comment/38850457
type: QuestionComment
comment on: http://stackoverflow.com/q/24970017
score: 0
has text: i mean can you pls share what code you have tried in a fiddle
type: Comment

http://stackoverflow.com/q/24913341
has answer: http://stackoverflow.com/a/24913527
linked to: http://stackoverflow.com/q/7718935
tagged with: widget
type: UnansweredQuestion
type: Question
tagged with: failover
answer count: 1
tagged with: javascript
has title: Abort javascript loading on network error
score: 0
has body: We run our application on partners websites using widgets under async iframes. One of our servers is unreachable from some networks, and some users are claiming about continuous "Loading from our.domain.com ...", causing direct interference on user experience. It is possible to abort resource loading when network error occurs? Our environment cannot depends of any external lib (like jquery, zepto, ...). Our code is written in raw javascript. We tried to remove javascript element after some timeout, like described on some resources here on SO, but no one works. Here, is one snippet of testing code. This removes &lt;script&gt; element after 1s if it is not ready. setTimeout( function(){ //Check if it is ready using a control var if (! contextControl.isReady){ // Not Ready var trgt = document.getElementById("element-id"); //force element drop trgt.parentNode.removeChild(trgt); } }, 1000 ); It removes javascript element effectively, but doesn't abort resource loading. There is some effective way to abort this resource loading?

http://stackoverflow.com/q/24910584
has comment: http://stackoverflow.com/comment/38701686
has title: Javascript, check if array contains a function
has answer: http://stackoverflow.com/a/24910636
has body: I'm pushing some anonymous functions into an array this way: myArray.push(function(){ /* some cool code here */}); myArray.push(function(){ /* some cooler code here */}); Then I execute all functions doing while (myArray.length) { myArray.shift().call();} The question is: how can I check if a function is already into myArray? I Tried to do a comparison using toSource() but it does not work... Any idea? Thanks in advance.
has comment: http://stackoverflow.com/comment/38701654
type: AnsweredQuestion
tagged with: function
accepted answer: http://stackoverflow.com/a/24910626
tagged with: arrays
possible better answer: http://stackoverflow.com/a/24910636
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/24910626
has answer: http://stackoverflow.com/a/24910686
has comment: http://stackoverflow.com/comment/38706853
answer count: 3

http://stackoverflow.com/a/24936338
score: 3
has comment: http://stackoverflow.com/comment/38750863
accepted answer of: http://stackoverflow.com/q/24936280
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38751066
answers question: http://stackoverflow.com/q/24936280
has comment: http://stackoverflow.com/comment/38751337
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/38750963
has body: This : else ($('#right option:selected').val() !==$("#chosen").val()) { $('#remove').removeAttr('disabled'); } is equivalent to else { $('#right option:selected').val() !==$("#chosen").val(); // this does nothing } $('#remove').removeAttr('disabled'); You probably wanted if($('#right option:selected').val() === $("#chosen").val()){ $('#remove').attr('disabled' ,'disabled'); } else { $('#remove').removeAttr('disabled'); } or better : $('#remove').prop( 'disabled', $('#right option:selected').val() === $("#chosen").val() ); And I suppose the first test should have '#right option:selected' (note the space).

http://stackoverflow.com/q/24930129
tagged with: php
has comment: http://stackoverflow.com/comment/38738832
type: Question
tagged with: javascript
tagged with: jquery
tagged with: slim
tagged with: ajax
score: 0
has body: I am working on a ajax to call the slimframework API and post data to the DB. But ajax PUT do not work? I keep getting a 404 in ajax . This works &lt;form action="http://myapi.com/api/key/514315/push" method="post"&gt; &lt;input type="input" name="test" value="test"&gt; &lt;input type="submit" value="Submit"/&gt; Trying in Ajax, this oes not work : returns 404 when sending data, as if you accessed API without sending a put request. &lt;script type="text/javascript"&gt; var Data = [ { "Name" : 'Home', "Description" : "This is a test description", "Keywords" : "Keyword One, Two, Threeh", "Menu" : 1, "Parent" : 0 }, { "Name" : 'About', "Description" : "This is a About description", "Keywords" : "Keyword One, Two, Threeh", "Menu" : 2, "Parent" : 0 } ]; var rootURL = "http://myapi.com/api/key/514315/push"; $.each(Data, function(key, value) { $.ajax({ type: 'POST', contentType: 'application/json', url: rootURL, dataType: "json", data: Data[key], success: function(data, textStatus, jqXHR){ alert('Article Added'); }, error: function(jqXHR, textStatus, errorThrown){ alert('Add Article error: ' + textStatus); } }); }); PHP $app-&gt;post('/key/:key/push', function ($key) { $app = new \Slim\Slim(); $body = $app-&gt;request-&gt;getBody(); $singleRequest = $app-&gt;request-&gt;params('test'); echo "&lt;pre&gt;"; print_r($body); echo "&lt;/pre&gt;"; echo "&lt;hr&gt;"; echo "&lt;pre&gt;"; print_r($singleRequest); echo "&lt;/pre&gt;"; }); $app-&gt;run(); Any Ideas?
answer count: 1
has comment: http://stackoverflow.com/comment/38739087
has title: Ajax Slim Framework
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24930866

http://stackoverflow.com/comment/38964939
score: 0
type: AnswerComment
type: Comment
has text: Everything in JavaScript is pass by value. Always.
comment on: http://stackoverflow.com/a/25045204

http://stackoverflow.com/q/25054906
type: Question
has comment: http://stackoverflow.com/comment/38974076
has comment: http://stackoverflow.com/comment/38974371
has answer: http://stackoverflow.com/a/25098828
has comment: http://stackoverflow.com/comment/39055273
has comment: http://stackoverflow.com/comment/39212734
has comment: http://stackoverflow.com/comment/39197326
answer count: 1
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
has comment: http://stackoverflow.com/comment/38975384
linked to: http://stackoverflow.com/q/25032189
favorite count: 0
has body: I have a menu menu structure which show three level of menu but menu doesnt function properly when when i click over different level 3 menus to open or collapse the menu. Example http://jsfiddle.net/Ed9nk/21/ Parent One have multi level of menus Example you follow this sequence you will notice the problem Step 1: Hover over Parent One > Click on Child One Step 2: Click on Child Two or Child Three menu and hover over the Grand Child x menu you will notice that Green box changes the postion. Step 3: Now if you will click on Child One of Parent One to collapse this menu &amp; then hover over Grand Child xx of Child Two or Child Three menu you will notice that Green box shows up correctly. Green box keeps change position i want it to show on top of the div . I am not sure what is causing this Jquery Code $('.dropdown .has-panel ul').hide(function () { }); $('.dropdown .has-panel').css('display', 'none'); //$('.dropdown .has-panel').css('height','0px'); $('.dropdown .has-panel').parent().click(function () { $('.dropdown .has-panel').css('display', 'block'); //$("ul", this).show("normal"); $("ul", this).toggle("normal"); }); CSS which is use to position the green box always at top ul.nav &gt; li &gt; .dropdown.has-panel li:nth-child(1) &gt; .dropdown.has-panel .dd-panel { margin-top: -10px; background-color:green !important; } ul.nav &gt; li &gt; .dropdown.has-panel li:nth-child(2) &gt; .dropdown.has-panel .dd-panel { margin-top: -54px; background-color:green !important; } ul.nav &gt; li &gt; .dropdown.has-panel li:nth-child(3) &gt; .dropdown.has-panel .dd-panel { margin-top: -154px; background-color:green !important; } I would appreciate help in this regard. UPDATE: For now i have found temporary work around i have found it hard to automatically calculate the margin-top position for the green box when one randomly click on the menus and hover over level 3 menus. manual margin which i have specified only works if one clicks in sequence for first time Hover Parent One &gt;…
has comment: http://stackoverflow.com/comment/38975280
has comment: http://stackoverflow.com/comment/38974935
tagged with: http://stackoverflow.com/tag/html
has title: Collapsible menu changes position of the element
tagged with: css
has comment: http://stackoverflow.com/comment/39210792
has comment: http://stackoverflow.com/comment/38974161
score: 2
has comment: http://stackoverflow.com/comment/38973849
upvote count: 3
type: UnansweredQuestion
downvote count: 1
has comment: http://stackoverflow.com/comment/39291833

http://stackoverflow.com/comment/38967944
type: QuestionComment
has text: the first,second of key will disable the the second and third of condition
score: 0
comment on: http://stackoverflow.com/q/25051713
type: Comment

http://stackoverflow.com/q/25039353
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38944629
has comment: http://stackoverflow.com/comment/38944465
has comment: http://stackoverflow.com/comment/38945022
accepted answer: http://stackoverflow.com/a/25039956
has comment: http://stackoverflow.com/comment/38945082
has comment: http://stackoverflow.com/comment/38944428
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/38944753
has answer: http://stackoverflow.com/a/25040025
has answer: http://stackoverflow.com/a/25039956
score: 0
upvote count: 1
has answer: http://stackoverflow.com/a/25039696
downvote count: 1
tagged with: arrays
tagged with: javascript
favorite count: 0
tagged with: angularjs
has title: Check if an element exists in a object
has comment: http://stackoverflow.com/comment/38944925
possible better answer: http://stackoverflow.com/a/25039477
has body: I have a set of radio buttons, when a radio button is selected the element is pushed into an object. Then I need to take the value of the elements in the object and then push them into an array, if they are not already in the array. My problem is that I keep getting duplicates or more in my array of each of the values with this function because I am not checking correctly if they exists. How can I check if the element already exists in my array and then exclude it from being added? _this.selected = {}; _this.selectedArray = []; //loop through the object angular.forEach(_this.selected, function ( item ){ //if it is not the first time the array is getting data loop through the array if(_this.selectedArray.length &gt; 0) { _this.selectedArray.forEach(function (node){ //check to see if the item already exists-- this is where it is failing //and running the loop too many times if(node.id !== item.id){ _this.selectedArray.push(item); } }); } else { _this.selectedArray.push(share); } });
answer count: 4
has comment: http://stackoverflow.com/comment/38944520
has answer: http://stackoverflow.com/a/25039477

http://stackoverflow.com/a/24910336
has body: to show the css to default checked you have to add the css 'class' or 'id' by default to the pre checked radio button and its respective href tag.
downvote count: 0
answers question: http://stackoverflow.com/q/24910215
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/q/24975567
has answer: http://stackoverflow.com/a/24975782
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
answer count: 2
has answer: http://stackoverflow.com/a/24975660
has body: what i'm trying to do seems pretty simple. keyword seems. haha. I'm trying to make text that changes back and forth between two languages. Kind of like a GIF type animation (tried that didn't like how it looked) I know flash would be the better option but I don't have those capabilities so i've turned to javascript- but my experience there isn't too great either. here's my HTML Welcome-Select your language Bienvenido-Elegí tu idioma Then I thought I could take that along with the following CSS .welcome { font-size:18px; font-weight:bold; font-family:Century Gothic; color:White; margin-top:5px; margin-bottom:30px; position:relative; } #welcomediv { display:block; position:relative; top:45%; height:30px; overflow:hidden; } I did that thinking that I could use jquery to move the elements up and down and then they'd go out of view and get what i'm looking for. I want it to go up and out as the other one is sliding back into place. I achieved that. But just couldn't make it loop. $(document).ready(function () { $("#welcome").delay(3000).animate({ bottom: '30px' }, 1000); $("#bienvenido").delay(3000).animate({ bottom: '45px' }, 1000); }); This is how I did it. Now I know this probably isn't the best way to go about this so any and all help is greatly appreciated!! How would I simply make it loop? Or should I change it up totally?
has comment: http://stackoverflow.com/comment/38824771
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
has title: Make changing text on loop in Jquery

http://stackoverflow.com/a/24915564
has comment: http://stackoverflow.com/comment/38711671
has body: Not sure if there is ONE correct way, but you can call $location.path() on success. request.success(function(){ $location.path('your path'); }); To view the added comment (which apparently is what you want), you could use : request.success(function(response){ $scope.comments.push(response.data); }); Your content would refresh automatically on the page, if you're using angular expressions and a ng-repeat.
score: 5
answers question: http://stackoverflow.com/q/24915468
upvote count: 5
downvote count: 0
has comment: http://stackoverflow.com/comment/38711798
type: Answer

http://stackoverflow.com/a/24923109
has comment: http://stackoverflow.com/comment/38751102
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24922884
answers question: http://stackoverflow.com/q/24922884
upvote count: 1
has body: Another solution that doesn't leave empty &lt;ul&gt;'s I also like to build up all my html and add it to the DOM once, instead of adding lots of little snippets. function get_list( a, str ) { str += '&lt;ul&gt;'; for (var i = 0; i &lt; a.length; i++) { str += '&lt;li&gt;' + a[i].name; if (a[i].group &amp;&amp; a[i].group.length) str += get_list( a[i].group, '' ); str += '&lt;/li&gt;'; } str += '&lt;/ul&gt;'; return str; } $(".mod-list").append(get_list( mods.group, '')); http://jsfiddle.net/aj9TC/8/
score: 1

http://stackoverflow.com/a/24976126
has comment: http://stackoverflow.com/comment/38845367
answers question: http://stackoverflow.com/q/24976013
type: Answer
has body: Please try with the below code snippet. Test Apple Orange Watermelon Strawberry Total By Row Row1 Row2 Row3
score: 0

http://stackoverflow.com/q/24955468
type: Question
accepted answer: http://stackoverflow.com/a/24955727
tagged with: http://stackoverflow.com/tag/html
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38789507
tagged with: internet-explorer
has title: Postage calculator not outputting in IE
has answer: http://stackoverflow.com/a/24955727
tagged with: javascript
has body: I'm having a bit of trouble with a postage calculator I've created via Javascript, it should take a quantity and create a variable which is that multiplied by a defined number (i.e. postage cost) and then output the total (sum of all variables). It's working perfectly in all browsers except IE, which leads me to believe that the issue lies not with the JavaScript, but perhaps the HTML. I thought I'd narrowed the issue down to the &lt;output&gt; tag, but I've tried swapping this out with a &lt;span&gt; and yet the problem persists: &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function calculate() { var let1 = document.getElementById('let1').value; var let1f = let1 * 0.12; var let2 = document.getElementById('let2').value; var let2f = let2 * 0.16; var ll1 = document.getElementById('ll1').value; var ll1f = ll1 * 0.17; var ll2 = document.getElementById('ll2').value; var ll2f = ll2 * 0.12; var sp01 = document.getElementById('sp01').value; var sp01f = sp01 * 0.30; var sp02 = document.getElementById('sp02').value; var sp02f = sp02 * 0.30; var sp11 = document.getElementById('sp11').value; var sp11f = sp11 * 0.30; var sp12 = document.getElementById('sp12').value; var sp12f = sp12 * 0.30; var mp01 = document.getElementById('mp01').value; var mp01f = mp01 * 0.85; var mp02 = document.getElementById('mp02').value; var mp02f = mp02 * 0.80; var mp11 = document.getElementById('mp11').value; var mp11f = mp11 * 1.4; var mp12 = document.getElementById('mp12').value; var mp12f = mp12 * 1.15; var result = document.getElementById('result'); result.value = parseFloat(let1f + let2f + ll1f + ll2f + sp01f +sp02f + sp11f +sp12f +mp01f + mp02f + mp11f + mp12f).toFixed(2); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="calculator"&gt; &lt;ul class="column" id="column1"&gt; &lt;li class="topbar" id="format"&gt;Format&lt;/li&gt; &lt;li&gt;Letters&lt;/li&gt; &lt;li&gt;Large Letters&lt;/li&gt; &lt;li&gt;Small Parcel (0-1kg)&lt;/li&gt; &lt;li&gt;Small Parcel (1-2kg)&lt…
type: AnsweredQuestion
downvote count: 0
score: 1
favorite count: 0

http://stackoverflow.com/a/25056944
answers question: http://stackoverflow.com/q/25056909
downvote count: 0
has body: Your js filename is kinetic-v5.1.0.min.js but you are including kinetic-v5.1.0.min2.js And type="application/javascript"
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/59271034
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25065192
has text: Commenting to say this still works and you're a life saver!
score: 0

http://stackoverflow.com/comment/38858233
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24989990
has text: @UnknownUser What do you mean? What we've created - and looks like you wanted - is an *object literal*, not an array. You can either wrap it into an array (getting something like the one in your question), or push it to an existing array, of course.

http://stackoverflow.com/q/25043474
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25043700
favorite count: 0
has title: Changing brightness filter
tagged with: css
type: AnsweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38952602
has answer: http://stackoverflow.com/a/25043541
accepted answer: http://stackoverflow.com/a/25043541
has comment: http://stackoverflow.com/comment/38952820
type: Question
has body: I am trying to use jQuery to change the brightness filter css property of some of the images on my page, but I get the following error in the console: "Error in parsing value for 'filter'. Declaration dropped." Here is the code I am using: function changeBrightness() { $("#myImg").css({ "filter" : "brightness(50%)", "-webkit-filter" : "brightness(50%)", "-moz-filter" : "brightness(50%)", "-o-filter" : "brightness(50%)", "-ms-filter" : "brightness(50%)" }); } I also tried other formats of the above, just to see if it would work, but they produce the same error: function changeBrightness() { var brightness = "brightness(50%)"; $("#myImg") .css("filter",brightness) .css("webkitFilter",brightness) .css("mozFilter",brightness) .css("oFilter",brightness) .css("msFilter",brightness); } And I tried this general format as well, hoping jQuery would take care of the prefixes: function changeBrightness() { $("#myImg").css("filter", "brightness(50%)"); } The changeBrightness function is called when I click a button, and it should change the brightness of an image with the id "myImg" to 50%. I am using Firefox 24.7. Is the filter property for CSS3 just not functional in firefox (or any other browsers)?
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25043700
linked to: http://stackoverflow.com/q/11325732
upvote count: 2

http://stackoverflow.com/a/25056604
type: Answer
score: 2
downvote count: 0
has body: The first problem is very easy to solve. The editing form (Add and Edit) includes only the information about editable columns. So you need include editable: true property in every column of colModel which you want to allow the user to edit. It's important to understand that there are default value for every known property of colModel. I recommend you to examine the last ("Default") column of the table on the place of the documentation. You will find that default value of align is "left", so you can remove align: "left" from all colModel items. In the same way you can see that default value of editable property is false. It way the reason why you had empty editing form. If you need to set editable: true to more as the half of columns of colModel I would recommend you to use cmTemplate option of jqGrid (see the answer for more details). After including cmTemplate: {editable: true} option for example you will need to include editable: false in all columns which you want don't make editable. All other columns will be editable. If you need to include some column information in Add/Edit form, but don't permit the user to edit it you can use editable: true together with editoptions: {readonly: "readonly"} or editoptions: {disabled: "disabled"}. The option will include the information in the edit form, but set additional readonly="readonly" or disabled="disabled" attribute on the corresponding editing field. One can add additional "ui-state-disabled" class on such filed like described in the answer. In the way you can make some fields editable, but only for example in Add dialog and hold it disabled/readonly in Edit dialog. Don't forget to use recreateForm: true option. To make editing successful it's very important to fill rowid of the grid correctly. If you have column with name: "id" or if some column have key: true property then the corresponding value will be used as rowid. The information which will be send to the server is described here (about Edit), here (about Add…
has comment: http://stackoverflow.com/comment/39021313
accepted answer of: http://stackoverflow.com/q/25055477
answers question: http://stackoverflow.com/q/25055477
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/a/25050597
has comment: http://stackoverflow.com/comment/38965774
has comment: http://stackoverflow.com/comment/38965788
has comment: http://stackoverflow.com/comment/38965822
has comment: http://stackoverflow.com/comment/38966085
downvote count: 0
has comment: http://stackoverflow.com/comment/38965844
type: Answer
answers question: http://stackoverflow.com/q/25050556
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38965794
has comment: http://stackoverflow.com/comment/38966001
has comment: http://stackoverflow.com/comment/38965752
has body: Since qtest looks like an array, its index starts from 0 to length - 1 so when j is length the value of qtest[j] will be undefined. So change the loop as for (j = 0; j&lt; qtest.length; j++) { // }
has comment: http://stackoverflow.com/comment/38965986
has comment: http://stackoverflow.com/comment/38965965
has comment: http://stackoverflow.com/comment/38965802

http://stackoverflow.com/q/25030993
type: AnsweredQuestion
type: Question
has title: Sending 'this' to js function from file upload element
has answer: http://stackoverflow.com/a/25031103
tagged with: javascript
has answer: http://stackoverflow.com/a/25031117
score: 0
answer count: 3
has body: I'm doing an image upload. onClick of one visible button, it triggers the hidden input form (it is hidden because it is ugly), which asks user to pick a file. When the choice is made, it triggers onChange="imagePreview(this);" function, which then works with 'this' element. function imagePreview (this) { var files = this.files; var file = files[0]; ... } What I'm trying to do is get rid of the insertion of onChange="imagePreview(this);" in the html element, so I need to somehow call this element from the javascript or jQuery. Can someone give me a hint on that.
possible better answer: http://stackoverflow.com/a/25031102
accepted answer: http://stackoverflow.com/a/25031117
has answer: http://stackoverflow.com/a/25031102
has comment: http://stackoverflow.com/comment/38928714

http://stackoverflow.com/comment/38830084
type: Comment
has text: I don't know a library that does that for you. Since this is quite a specific case I guess you will have to parse the .js file yourself. I hope it comes in an easy to read form.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24978198

http://stackoverflow.com/comment/38756820
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24939347
has text: OP, as others have posted the JS function you're looking for is `setTimeout`.
score: 0

http://stackoverflow.com/comment/38989923
type: Comment
has text: me also make sense that part.
score: 0
comment on: http://stackoverflow.com/q/25063468
type: QuestionComment

http://stackoverflow.com/q/24949432
has title: angular js modal popup call factory function
type: Question
has answer: http://stackoverflow.com/a/24950345
tagged with: javascript
score: 0
tagged with: modal-dialog
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38776198
has body: I am trying to call factory function in my modal popup but it gives error Here is my factory .factory('PartnerFactory', ['$http', '$rootScope', function ($http, $rootScope) { var currentPartner; var partners = []; var currentClient; var currentSite return { savePartner: function (partnerData) { console.log("In Save Partner"); console.log(partnerData); var url = "/api/Partner/CreatePartner"; var dataToPost = { Name: partnerData.Name, Description: partnerData.Description, Address1: partnerData.Address1 } ////$("#spinner").show(); $http.post(url, dataToPost) .success(function (data) { }) .error(function (data) { // return $scope.showInfoOnSubmit = !0, $scope.revert() }) }, getPartners: function () { var url = "/api/Partner/GetAllPartners"; return $http.get(url).then(function (response) { partners = response.data; $rootScope.$broadcast('handleSharedPartners', partners); return partners; }) } }; }]) Modal dialog .controller("PartnerModalCtrl", ["$scope","$http", "$modalInstance", "items", '$routeParams','PartnerFactory', function ($scope, $http, $modalInstance,$routeParams, PartnerFactory) { $scope.test = function (partnerData) { console.log("Test"); console.log(partnerData); return this.PartnerFactory.currentPartner(); }, $scope.ok = function () { $modalInstance.close(); }, $scope.cancel = function () { $modalInstance.dismiss("cancel") }, $scope.addPartner = function (partnerData) { console.log(partnerData); return PartnerFactory.savePartner(partnerData); }; }]) I get error as addPartner is not a defined function

http://stackoverflow.com/a/24945111
has body: You could do this: The thumbnails: The popup styles: #popUp{ width:500px; height: 500px; position: absolute; top:0; right:0; bottom:0; left:0; margin:auto; background:#ffffff; display:none; } Popup HTML Prev Next jQuery var index = 0; var imageCount = $('.thumb').length $(document).ready(function(){ $('.thumb').click(function(){ index = $('.thumb').index($(this)); var src = $(this).attr('data-src'); $('.popImg').attr('src', src); $('#popUp').fadeIn(); }); $('.next').click(function(e){ e.preventDefault(); if (index < imageCount){ index += 1; } var nextElement= $('.thumb')[index]; var src = $(nextElement).attr('data-src'); $('.popImg').attr('src', src); }); $('.prev').click(function(e){ e.preventDefault(); if(index > 0){ index -= 1; } var nextElement= $('.thumb')[index]; var src = $(nextElement).attr('data-src'); $('.popImg').attr('src', src); }); });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24944722
has comment: http://stackoverflow.com/comment/38790859

http://stackoverflow.com/a/24963073
has comment: http://stackoverflow.com/comment/38801040
accepted answer of: http://stackoverflow.com/q/24963024
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38801207
has body: That won't be possible if you do not prepend your base path with JavaScript or when the links are rendered server-side. Prefixing the links with a / means look from the root, which is "http://www.domain.com". EDIT : Check the base element on W3Schools. It will add a base path for all relatives URLs in the document. EDIT 2 : If you are already on /adress/, @Adeneo's suggestion will obviously work.
type: AcceptedAnswer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24963024
has comment: http://stackoverflow.com/comment/38801378

http://stackoverflow.com/comment/38844086
type: Comment
has text: @uglycat5 Can you point to any reference to back that statement? I've worked on a product that shipped with Rhinojs embedded and `load` worked fine for us.
comment on: http://stackoverflow.com/a/24965702
score: 0
type: AnswerComment

http://stackoverflow.com/q/25047340
type: UnansweredQuestion
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/38960071
downvote count: 0
has answer: http://stackoverflow.com/a/25047634
has comment: http://stackoverflow.com/comment/38959987
tagged with: javascript
score: 4
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25047455
has comment: http://stackoverflow.com/comment/38960047
has title: Get original file name + line number in exceptions thrown in Angular controllers?
has body: If I have an error in an Angular controller, I get a stack trace which looks something like this: TypeError: undefined is not a function at new &lt;anonymous&gt; (…/dist/script.js:854:5) at invoke (…/dist/base-script.js:13441:17) at Object.instantiate (…/dist/base-script.js:13452:23) at …/dist/base-script.js:16789:28 at …/dist/base-script.js:16159:34 at forEach (…/dist/base-script.js:9709:20) at nodeLinkFn (…/dist/base-script.js:16146:11) at compositeLinkFn (…/dist/base-script.js:15582:13) at publicLinkFn (…/dist/base-script.js:15477:30) at link (…/dist/base-script.js:30282:38) &lt;div ng-include="activeTab" class="ng-scope"&gt; Where script.js and script-base.js are minified scripts. How can I figure out which real line of source code is causing the problem? Note that I am compiling source maps and they are working correctly when a "native" error is thrown (ie, Chrome can correctly show me original source lines when Angular does not intercept errors).

http://stackoverflow.com/comment/38878700
type: Comment
has text: Hmm. I am getting the error `TypeError: $(...).sibling is not a function`
comment on: http://stackoverflow.com/a/25004266
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38759544
score: 0
type: AnswerComment
has text: i fixed that..see my answer.
type: Comment
comment on: http://stackoverflow.com/a/24940176

http://stackoverflow.com/a/25062216
type: Answer
has body: $( "#txthour" ).keyup(function() { if($( "#txthour" ).val() &gt; 12) { $( "#txthour" ).val("12"); } }); http://jsfiddle.net/5tjdL/
score: 0
answers question: http://stackoverflow.com/q/25059837

http://stackoverflow.com/comment/38739771
type: Comment
comment on: http://stackoverflow.com/a/24930187
score: 0
type: AnswerComment
has text: In Chrome console, you have to select the inner frame first (upper left pulldown arrow) instead of the outer html page

http://stackoverflow.com/a/24975114
answers question: http://stackoverflow.com/q/24975036
has body: I think what you are doing wrong is the way you call the function. Try this instead onclick="toggleDiv('pure-form')" using both single and double quotes
has comment: http://stackoverflow.com/comment/38824181
has comment: http://stackoverflow.com/comment/38828275
has comment: http://stackoverflow.com/comment/38823463
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38831420
has comment: http://stackoverflow.com/comment/38823553
score: 0
has comment: http://stackoverflow.com/comment/38823688
accepted answer of: http://stackoverflow.com/q/24975036
type: Answer

http://stackoverflow.com/comment/38984678
has text: There are many ones, like having only one string (yes, you can have a multi-line string literal in JS), using jquery DOM functions, using a template, etc.
comment on: http://stackoverflow.com/q/25060710
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/38853859
comment on: http://stackoverflow.com/q/24991108
has text: try triggering click event on page load
score: 0
type: QuestionComment
type: Comment

google-visualization
tags question: http://stackoverflow.com/q/25057165
tags question: http://stackoverflow.com/q/25008009
tags question: http://stackoverflow.com/q/24988415
tags question: http://stackoverflow.com/q/25050579
type: Tag
tags question: http://stackoverflow.com/q/24911646
tags question: http://stackoverflow.com/q/24927145
tags question: http://stackoverflow.com/q/24991697
tags question: http://stackoverflow.com/q/24941109
tag name: google-visualization
tags question: http://stackoverflow.com/q/24996127
tags question: http://stackoverflow.com/q/24913145
tags question: http://stackoverflow.com/q/24924006
tags question: http://stackoverflow.com/q/24958243
tags question: http://stackoverflow.com/q/24929767
tags question: http://stackoverflow.com/q/24926240
tags question: http://stackoverflow.com/q/25047752
tags question: http://stackoverflow.com/q/25039607
tags question: http://stackoverflow.com/q/25042874

http://stackoverflow.com/comment/38836471
comment on: http://stackoverflow.com/a/24970748
type: AnswerComment
score: 0
has text: Glad it worked out! Just remember that this will be very hard for your chart if you get a lot of data.
type: Comment

http://stackoverflow.com/a/25125598
has comment: http://stackoverflow.com/comment/39194033
type: Answer
has comment: http://stackoverflow.com/comment/39188492
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25023365
has body: Just tested OpenTokRTC chat (built 100% with OpenTok) on firefox and chrome, they seem to be working Here's the sample code of how OpenTokRTC is using signaling for chat: https://github.com/opentok/OpenTokRTC/blob/master/public/js/room.js#L297
has comment: http://stackoverflow.com/comment/39185981
upvote count: 1
has comment: http://stackoverflow.com/comment/39186478

http://stackoverflow.com/comment/38770381
score: 0
comment on: http://stackoverflow.com/q/24946599
has text: By not using buttons! `echo 'TEST';`.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24946083
has title: Scale floating divs not relative to their parent without position:absolute
type: AnsweredQuestion
has body: I got dis: ".each_one" is every single little div displayed except for the "category_container" which is the one that is parent of all "each_one" divs. I want to scale each_ones using percentages relatively to the height of the screen, yet i want to make the category_container div only scale to successfully contain all each_ones (like it does right now) In other words, i just wanna make each child div somewhat bigger in height. How do i do it?
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24946233
tagged with: javascript
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/24946233
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/38837797
comment on: http://stackoverflow.com/q/24982710
score: 0
type: Comment
type: QuestionComment
has text: programming is not about copy and paste! at first try to figure out what the available code does and then secondly try to adapt it to your problem.

http://stackoverflow.com/comment/38912203
comment on: http://stackoverflow.com/a/25011220
score: 0
type: AnswerComment
has text: The problem is that in Chrome emulation it is impossible to scroll the iScroll scroller after `embedly()` has been executed. Note that there's also a Chrome scroller which can be clicked and dragged down, but that is to be ignored.
type: Comment

http://stackoverflow.com/a/25020561
answers question: http://stackoverflow.com/q/25020495
has body: get first text area value and apply substring function. textAreaValue = document.getElementById("display_main").value then apply substring function on value then again set modify value to textarea.
type: Answer
score: 0

http://stackoverflow.com/q/25038264
has body: Is there any way I can hook an element onclick event to a variable? If I change the variable, will the onclick event be updated too? Why isn't it so? When I'm writing a frame, sometimes I have some buttons in different parts of the page, but these buttons hook to a same event function. When I want to change the event function, I have to change all these button's events! Can I do something like this? var publicFunc = function(){console.log('aaa');}, button1 = document.getElementById('button1'), button2 = document.getElementById('button2'); button1.onclick = publicFunc; button2.onclick = publicFunc; //i hope when i change publicFunc, all onclick event change publicFunc = function(){console.log('bbb');}; //how to tell all the buttons this event function has changed?! //i hope button1.onclick now is "function(){console.log('bbb');};" //but of course it's "function(){console.log('aaa');};" //is there any smart way to change it to "bbb"??? The first thought came to me is to find a way to use a pointer in Javascript like in C/C++, but after hard search, I find few information about that.
tagged with: events
favorite count: 0
score: -1
has comment: http://stackoverflow.com/comment/38943274
has comment: http://stackoverflow.com/comment/38942392
accepted answer: http://stackoverflow.com/a/25038405
has comment: http://stackoverflow.com/comment/38944186
has comment: http://stackoverflow.com/comment/38942792
has comment: http://stackoverflow.com/comment/38942135
type: AnsweredQuestion
upvote count: 3
has title: Can I use pointers in Javascript?
tagged with: hook
has comment: http://stackoverflow.com/comment/38942711
possible better answer: http://stackoverflow.com/a/25038414
has answer: http://stackoverflow.com/a/25038414
has comment: http://stackoverflow.com/comment/38942848
type: Question
has comment: http://stackoverflow.com/comment/38942216
has answer: http://stackoverflow.com/a/25038405
tagged with: javascript
tagged with: pointers
answer count: 2
has comment: http://stackoverflow.com/comment/38942567
downvote count: 4

http://stackoverflow.com/a/25062761
type: Answer
accepted answer of: http://stackoverflow.com/q/25062365
has comment: http://stackoverflow.com/comment/86248716
has body: In this case, you need something to run that javascript code for you. One option here would be to use selenium: from pandas.io.html import read_html from selenium import webdriver driver = webdriver.Firefox() driver.get('http://www1.nyse.com/about/listed/IPO_Index.html') table = driver.find_element_by_xpath('//div[@class="sp5"]/table//table/..') table_html = table.get_attribute('innerHTML') df = read_html(table_html)[0] print df driver.close() prints: 0 1 2 3 0 Name Symbol NaT NaN 1 Performance Sports Group Ltd. PSG 2014-06-20 NaN 2 Century Communities, Inc. CCS 2014-06-18 NaN 3 Foresight Energy Partners LP FELP 2014-06-18 NaN ... 79 EGShares TCW EM Long Term Investment Grade Bon... LEMF 2014-01-08 NaN 80 EGShares TCW EM Short Term Investment Grade Bo... SEMF 2014-01-08 NaN [81 rows x 4 columns]
has comment: http://stackoverflow.com/comment/122152861
downvote count: 0
type: AcceptedAnswer
score: 8
answers question: http://stackoverflow.com/q/25062365
upvote count: 8

css
tags question: http://stackoverflow.com/q/25065882
tags question: http://stackoverflow.com/q/24971940
tags question: http://stackoverflow.com/q/25050636
tags question: http://stackoverflow.com/q/24960484
tags question: http://stackoverflow.com/q/25037894
tags question: http://stackoverflow.com/q/25051016
tags question: http://stackoverflow.com/q/25035151
tags question: http://stackoverflow.com/q/24930316
tags question: http://stackoverflow.com/q/24973159
tags question: http://stackoverflow.com/q/24923891
tags question: http://stackoverflow.com/q/24933712
tags question: http://stackoverflow.com/q/24910468
tags question: http://stackoverflow.com/q/24943132
tags question: http://stackoverflow.com/q/24994267
tags question: http://stackoverflow.com/q/25057257
tags question: http://stackoverflow.com/q/24972468
tags question: http://stackoverflow.com/q/24924648
tags question: http://stackoverflow.com/q/24914995
tags question: http://stackoverflow.com/q/24969930
tags question: http://stackoverflow.com/q/24969777
tags question: http://stackoverflow.com/q/24921934
tags question: http://stackoverflow.com/q/25044543
tags question: http://stackoverflow.com/q/24996910
tags question: http://stackoverflow.com/q/25065837
tags question: http://stackoverflow.com/q/25009534
tags question: http://stackoverflow.com/q/25035013
tags question: http://stackoverflow.com/q/24954607
tags question: http://stackoverflow.com/q/24998107
tags question: http://stackoverflow.com/q/24992162
tags question: http://stackoverflow.com/q/24967585
tags question: http://stackoverflow.com/q/24984212
tags question: http://stackoverflow.com/q/24909819
tags question: http://stackoverflow.com/q/24976616
tags question: http://stackoverflow.com/q/24988412
tags question: http://stackoverflow.com/q/24949048
tags question: http://stackoverflow.com/q/25052092
tags question: http://stackoverflow.com/q/24943273
tags question: http://stackoverflow.com/q/25061817
tags question: http://stackoverflow.com/q/25043788
tags question: http://stackoverflow.com/q/25063949
tags question: http://stackoverflow.com/q/25066110
tags question: http://stackoverflow.com/q/25035101
tags question: http://stackoverflow.com/q/25007129
tags question: http://stackoverflow.com/q/25037332
tags question: http://stackoverflow.com/q/24951644
tags question: http://stackoverflow.com/q/25001477
tags question: http://stackoverflow.com/q/24997604
tags question: http://stackoverflow.com/q/24917200
tags question: http://stackoverflow.com/q/24963506
tags question: http://stackoverflow.com/q/24982853
tags question: http://stackoverflow.com/q/24988379
tags question: http://stackoverflow.com/q/24911675
tags question: http://stackoverflow.com/q/24969616
tags question: http://stackoverflow.com/q/24909628
tags question: http://stackoverflow.com/q/24950997
tags question: http://stackoverflow.com/q/24938087
tags question: http://stackoverflow.com/q/24980253
tags question: http://stackoverflow.com/q/25050798
tags question: http://stackoverflow.com/q/25016714
tags question: http://stackoverflow.com/q/25027547
tags question: http://stackoverflow.com/q/25032905
tags question: http://stackoverflow.com/q/24949980
tags question: http://stackoverflow.com/q/24968682
tags question: http://stackoverflow.com/q/25033114
tags question: http://stackoverflow.com/q/25035075
tags question: http://stackoverflow.com/q/24996320
tags question: http://stackoverflow.com/q/25027992
tags question: http://stackoverflow.com/q/24976039
tags question: http://stackoverflow.com/q/24909235
tags question: http://stackoverflow.com/q/24947025
tags question: http://stackoverflow.com/q/25044754
tags question: http://stackoverflow.com/q/24925853
tags question: http://stackoverflow.com/q/25018812
tags question: http://stackoverflow.com/q/24928486
tags question: http://stackoverflow.com/q/25038562
tags question: http://stackoverflow.com/q/25023030
tags question: http://stackoverflow.com/q/25026659
tags question: http://stackoverflow.com/q/24932493
tags question: http://stackoverflow.com/q/25023272
tags question: http://stackoverflow.com/q/25035296

http://stackoverflow.com/q/25043597
accepted answer: http://stackoverflow.com/a/25044850
tagged with: angularjs
upvote count: 2
has title: JSONP not working in AngularJS as expected
downvote count: 1
type: AnsweredQuestion
score: 1
type: Question
tagged with: jsonp
has answer: http://stackoverflow.com/a/25044850
answer count: 1
tagged with: javascript
has body: The first commented $scope.url which I took from angular documentation works fine, similarly I am trying to invoke another public url which gives me back the response but always goes to error callback. Both the URLs are in public domain, so please feel free to try. $scope.method = 'JSONP'; // URL 1: Working // $scope.url = 'https://angularjs.org/greet.php?callback=JSON_CALLBACK&amp;name=Super%20Hero'; // URL 2: Not working (Getting response with status 200OK but going to error callback) $scope.url= 'http://apps.nlm.nih.gov/medlineplus/services/mpconnect_service.cfm?callback=JSON_CALLBACK&amp;mainSearchCriteria.v.cs=2.16.840.1.113883.6.96&amp;mainSearchCriteria.v.c=41381004&amp;knowledgeResponseType=application/javascript'; $scope.fetch = function() { $scope.code = null; $scope.response = null; $http({method: $scope.method, url: $scope.url, cache: $templateCache}). success(function(data, status) { console.log(data); console.log(status); }). error(function(data, status) { console.log(data); console.log(status); }); };
favorite count: 0

http://stackoverflow.com/a/24949571
has comment: http://stackoverflow.com/comment/38776993
answers question: http://stackoverflow.com/q/24948781
type: Answer
has comment: http://stackoverflow.com/comment/38776872
downvote count: 0
has comment: http://stackoverflow.com/comment/38777483
score: 1
has body: Yes, you can do what you're asking. A $resource will return an object/array that has a $promise property. You can use this promise to know when the server request succeeds/fails. In the success/fail handler, you do $rootScope.$broadcast() as needed. Here's a service that uses the query() method of a $resource to do this: EDIT Here is the full service implementation. Note you can skin this cat many ways, so these are just some example ideas. myApp.service( 'Book', function($rootScope, $resource ) { var myResource = $resource('/books/:id', { id: '@id' } ); var books; var service = { // this function broadcasts the result getBooks: function() { myResource.query( function(response) { $rootScope.$broadcast('it.worked', response); }, function(error) { $rootScope.$broadcast('it.failed', error); } ); }, // this function returns the $resource and also keeps a copy // so someone else may get the data with getBooksResult() getBooks2: function() { books = myResource.query(); books.$promise( function(response) { // if you still need to broadcast... $rootScope.$broadcast('it.worked'); }, function(error) { $rootScope.$broadcast('it.failed'); } ); return books; }, getBookResult: function() { return books; } } return service; }); Should you do this? I don't see a lot of harm in doing this, but you should at least give it some thought. You are going to $broadcast() an event from the top of your application's scope hierarchy down to every other scope in your app. This will likely send the event to scopes that don't care at all about the event. Keep in mind that there are could be many scopes in your app (created by controllers/directives). Probably not a big deal in most cases. The nice thing about $resource is that it returns you an empty object, that is later filled in with the server response. So often times you don't need resort to broadcasting the result :) Views that use the resource's return value will update automagically. And controller's that need the value (or error) can us…
has comment: http://stackoverflow.com/comment/38779094
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24948781

http://stackoverflow.com/comment/38847190
type: Comment
comment on: http://stackoverflow.com/q/24987536
score: 0
has text: approach is very strange, why are you trying to bypass events on checkboxes themselves? Making it more difficult for yourself. ` ` will pass events though even if you hide the actual checkbox
type: QuestionComment

http://stackoverflow.com/a/24997094
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24939613
accepted answer of: http://stackoverflow.com/q/24939613
type: Answer
downvote count: 0
score: 1
has body: It turns out POC is not used any more. The AppId will be sent to you Via email. Note that in the Android SDK-Helper you have to fill in the App token in the userId section in order to log in. Hopefully this will benefit other people with the same confusion in the future!
upvote count: 1

http://stackoverflow.com/q/25004555
has comment: http://stackoverflow.com/comment/38885099
tagged with: fieldset
type: Question
has comment: http://stackoverflow.com/comment/38879103
tagged with: javascript
tagged with: jquery
tagged with: border
score: 0
has body: example http://jsfiddle.net/fuZ4L/ I am trying to get the border width of a fieldset using: $("fieldset").css("borderWidth") and it works fine in chrome and opera but ie and firefox return a blank string. Is there another way to get the default border width of a fieldset or is this an error in jQuery?
has title: get default fieldset border width cross browser
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/5904380
has comment: http://stackoverflow.com/comment/38886369
duplicate of: http://stackoverflow.com/q/5904380

http://stackoverflow.com/q/25006762
score: 0
has answer: http://stackoverflow.com/a/25011928
tagged with: javascript
type: UnansweredQuestion
tagged with: random
has body: I tried to pick up data with random some like below but it seem picked up only a first one in database. Template.miniSudoku.helpers({ playGame: function(){ var result = MiniSudoku.find({},{random:{$gte:Math.random()},limit:1}); if (result === null) { var result = MiniSudoku.find({},{random:{$lte:Math.random()},limit:1}); } return result; } });
tagged with: meteor
type: Question
has title: How to Meteor.js random pickup data?
answer count: 1

http://stackoverflow.com/comment/38855092
has text: Where should I implement this function?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24991958
type: Comment

http://stackoverflow.com/a/24972657
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24972572
upvote count: 2
has body: you need to declare a function in the event that when this event occurs call this function, currently the method inside event is called on page load as your way of calling is not right: do like this: $(document).on('click', 'a[href="#list"]', function(){ opentab('list') }); $(document).on('click', 'a[href="#add"]', function(){ opentab('add') }); UPDATED FIDDLE

http://stackoverflow.com/a/24990201
has comment: http://stackoverflow.com/comment/45765713
type: AcceptedAnswer
has body: When loading HTML from pjax, i added a 'data-js' attribute to the div, which contained the name of the function to call upon successfully loading HTML. Then it was just a matter of using the 'pjax:success' event to call the function.
has comment: http://stackoverflow.com/comment/84149607
accepted answer of: http://stackoverflow.com/q/24927369
type: Answer
has comment: http://stackoverflow.com/comment/45757400
score: 1
has comment: http://stackoverflow.com/comment/40547028
upvote count: 1
has comment: http://stackoverflow.com/comment/40549397
has comment: http://stackoverflow.com/comment/46057242
downvote count: 0
has comment: http://stackoverflow.com/comment/84005847
answers question: http://stackoverflow.com/q/24927369

http://stackoverflow.com/comment/38952897
type: Comment
score: 0
has text: Hi ForgetfulFellow. I tried that but it tells me `TypeError: Cannot set property 'name' of undefined` and so I tried `console.log(firebaseObj[0]);` and it gave me an `undefined`
type: AnswerComment
comment on: http://stackoverflow.com/a/25043429

http://stackoverflow.com/q/24917500
has body: What's possible to load content by url from browser when someone comming from somewhere? I don't want use ng-view with ngRoute. Look here http://kangaroom.net/ when you search e.g. Glasgow - you should see new url in the browser. They don't have any ng-view in DOM. But when you put link directly into browser: http://kangaroom.net/room/search?exp=Glasgow&amp;lat=55.864237&amp;lon=-4.251805999999988&amp;countryId=76 you should see the same result. What it's possible?
favorite count: 0
has comment: http://stackoverflow.com/comment/38715725
tagged with: angularjs
has answer: http://stackoverflow.com/a/24962096
tagged with: url-routing
has title: AngularJS enter url directly into browser
score: 1
accepted answer: http://stackoverflow.com/a/24962096
has answer: http://stackoverflow.com/a/24919664
upvote count: 1
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24919664
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/38715520
downvote count: 0

http://stackoverflow.com/comment/38841676
has text: [].slice.call(document.getElementsByTagName("*")).map(function(a){return a.tagName;}).filter(function(a,b,c){return c.indexOf(a)==b;}).sort(); will show all in-use...
comment on: http://stackoverflow.com/q/24984713
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25051477
tagged with: jquery
has comment: http://stackoverflow.com/comment/38967615
score: 0
has answer: http://stackoverflow.com/a/27517887
tagged with: flickr
has comment: http://stackoverflow.com/comment/38967770
has comment: http://stackoverflow.com/comment/38967663
has title: Image Currently Unavailable from Flickr
has comment: http://stackoverflow.com/comment/38967572
has comment: http://stackoverflow.com/comment/38967341
has comment: http://stackoverflow.com/comment/38967635
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38967496
has comment: http://stackoverflow.com/comment/38970297
tagged with: http://stackoverflow.com/tag/json
type: Question
has body: In my Firefox OS app i use Flickr API to show relevant images, My URL for the call is like this. https://api.flickr.com/services/rest/?method=flickr.photos.search&amp;api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&amp;lat=42.86366&amp;lon=-75.91438&amp;radius=3&amp;format=json&amp;nojsoncallback=1 and i use created a function to call the flicker api for the images. This is the function where i create the URL with the api key and latitude and longitude for the api call function displayObject(id) { console.log('In diaplayObject()'); var objectStore = db.transaction(dbTable).objectStore(dbTable); objectStore.openCursor().onsuccess = function(event) { var cursor = event.target.result; if (cursor) { if (cursor.value.ID == id) { var lat = cursor.value.Lat; var lon = cursor.value.Lon; showPosOnMap (lat, lon); // create the URL var url = 'https://api.flickr.com/services/rest/?method=flickr.photos.search'; url += '&amp;api_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; url += '&amp;lat=' + lat + ''; url += '&amp;lon=' + lon + ''; url += '&amp;radius=3'; url += '&amp;format=json&amp;nojsoncallback=1'; $.getJSON(url, jsonFlickrFeed); return; } cursor.continue(); } else { $('#detailsTitle').html('No DATA'); } }; } This function gets the JSON object received from flickr. This function displays the thumbnails of the images in a jquery mobile grid. function jsonFlickrFeed (data) { console.log(data); var output = ''; // http://farm{farmId}.staticflickr.com/{server-id}/{id}_{secret}{size}.jpg for (var i = 0; i &lt; data.photos.photo.length; i++) { // generate thumbnail link var linkThumb = ''; linkThumb += 'http://farm' + data.photos.photo[i].farm + '.staticflickr.com/' + data.photos.photo[i].server + '/' + data.photos.photo[i].id + '_' + data.photos.photo[i].secret + '_s.jpg'; // generate Full image link var linkFull = ''; linkFull += 'http://farm' + data.photos.photo[i].farm + '.staticflickr.com/' + data.photos.photo[i].server + '/' + data.photos.photo[i].id + '_' + data.photos.photo[i].sec…
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38724142
has text: I still don't think I understand. Is the data in the array static or does it change? If it's not dynamic, why not just save the array to a .js file and include it? And what do you mean by "it is doing all the calculations in the run function every single time". Every time the page is loaded?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24921292

http://stackoverflow.com/comment/38787883
score: 0
type: Comment
has text: That question adresses encoding the string. I want to encode an integer.
comment on: http://stackoverflow.com/q/24953453
type: QuestionComment

http://stackoverflow.com/comment/38854286
score: 0
type: Comment
type: QuestionComment
has text: I don't know express provide this facility, but your problem looks similar to https://stackoverflow.com/questions/24817213/pass-a-variable-to-view-in-every-request-node-js-express/24817305#24817305. have a look on this
comment on: http://stackoverflow.com/q/24991385

http://stackoverflow.com/comment/38943585
type: QuestionComment
comment on: http://stackoverflow.com/q/25038769
has text: i get pretty much ~1336 for the second log every time, using latest chrome on mac
score: 0
type: Comment

http://stackoverflow.com/q/24965439
tagged with: javascript
type: UnansweredQuestion
tagged with: visualization
answer count: 0
downvote count: 0
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/39724252
has comment: http://stackoverflow.com/comment/39724380
type: Question
upvote count: 1
has title: Google analytics embed API: Line graph of single metric split by dimension
tagged with: google-analytics
has comment: http://stackoverflow.com/comment/39724565
has body: I am looking in to Google Analytics' Embed API (https://developers.google.com/analytics/devguides/reporting/embed/v1/), and it looks very useful, however, one thing I can't figure out how to do is create a Line Graph with multiple lines, one for each value of a dimension, on some metric. For example I would like to graph sessions over time (ga:date for dimension, and ga:sessions as metric), but have a seperate line for each source (ga:source dimension). I could split and graph the data myself (either using google's visualization library, or a third party library), but this seems like a common use case, and I was surprised that I couldn't find an easy way to do it. Am I missing anything? Is there a way to generate this kind of line graph?

http://stackoverflow.com/q/24968825
tagged with: jquery-svg
score: 0
type: Question
has body: Here is the code for finding the svg image center point and shows dots, but am getting error that el is null.Can anyone tell whats the mistake.Shall i add js library here. <path d="M75 0 L56 105 L225 200 Z" />
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24968947
has title: Getting issues in svg center point
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: http://stackoverflow.com/tag/svg
has answer: http://stackoverflow.com/a/24968947
type: AnsweredQuestion

http://stackoverflow.com/q/24972729
has comment: http://stackoverflow.com/comment/38820188
tagged with: javascript
tagged with: callback
has comment: http://stackoverflow.com/comment/38830559
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38835804
has comment: http://stackoverflow.com/comment/53806507
has body: I must return to the validate function de OK of the debugReturn event but I don't know how because is asynchronous. I need a way to return true or false to the validate function. Sorry for my english :S $('.num-pad').keyboard({ layout: 'num', validate: function(keyboard, value, isClosing) { var data = $(keyboard['el']).attr('id').split('_'); var var_index = data[data.length - 1]; var var_name = data[0]; for (var i = 1; i &lt; data.length - 1; i++) { var_name += '_'; var_name += data[i]; } socket.emit('debugVar', { var_value: value, var_name: var_name , var_index: var_index }); socket.on('debugReturn', function(msg) { if (msg == 1) { $('.ui-keyboard input').css('box-shadow', 'inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)'); return true; } else { $('.ui-keyboard input').css('box-shadow', 'inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(255,0,0,.6)'); return false; } }); } });
has title: How can I wait for return of socketIO event?
accepted answer: http://stackoverflow.com/a/24999130
type: AnsweredQuestion
tagged with: synchronous
linked to: http://stackoverflow.com/q/13549734
has answer: http://stackoverflow.com/a/24999130
has comment: http://stackoverflow.com/comment/38819320
tagged with: socket.io
type: Question
has comment: http://stackoverflow.com/comment/38819859

http://stackoverflow.com/q/24994294
has answer: http://stackoverflow.com/a/24994781
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24994781
has answer: http://stackoverflow.com/a/24994807
score: 0
tagged with: css
has comment: http://stackoverflow.com/comment/38859384
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38859619
accepted answer: http://stackoverflow.com/a/24994807
type: Question
has comment: http://stackoverflow.com/comment/38859835
has title: Change value of webkit filter every seconds
has body: I try to change the webkit filter value of element every seconds with this code: $(document).ready(function () { console.log("ready!"); function setOpacity() { var regExp = /\(([^)]+)\)/; var str = regExp.exec($(".content").css("-webkit-filter")); var currentValue = str[0].substring(1).slice(0, -1); console.log(currentValue); $(".content").css("-webkit-filter", "opacity(" + parseFloat(currentValue) + 0.01 + " %) grayscale(70%);"); } var t = setInterval(setOpacity, 1000); }); But the code doesn't work. Where did I make a mistake?

http://stackoverflow.com/a/24911427
downvote count: 0
type: AcceptedAnswer
has body: This isn't doing what you think it's doing: $(".delete_result").on("click", function( e ){ This is invoking the selector ".delete_result" once, identifying the elements which exist at that time, and attaching the click handler to those elements. Handlers are attached to elements, not to selectors. So any elements added to the page after this code executes won't have click handlers attached to them. Instead, you're looking to do this: $(document).on("click", ".delete_result", function( e ){ This still executes only once, but attaches the handler to document (which is unchanging during the life of the DOM). Indeed, any common unchanging parent element in the hierarchy will work in place of document. The second selector, ".delete_result", is used on each event to filter events from selected child elements. Thus, any element added to the document later in the life of the DOM will still "bubble up" its click event to document and be identified by that second selector. For more examples and information, I've written about this before.
type: Answer
answers question: http://stackoverflow.com/q/24911225
has comment: http://stackoverflow.com/comment/38703487
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24911225

http://stackoverflow.com/a/24943743
has comment: http://stackoverflow.com/comment/91845184
has comment: http://stackoverflow.com/comment/38778257
has body: A component cannot update its own props unless they are arrays or objects (having a component update its own props even if possible is an anti-pattern), but can update its state and the props of its children. For instance, a Dashboard has a speed field in its state, and passes it to a Gauge child thats displays this speed. Its render method is just return &lt;Gauge speed={this.state.speed} /&gt;. When the Dashboard calls this.setState({speed: this.state.speed + 1}), the Gauge is re-rendered with the new value for speed. Just before this happens, Gauge's componentWillReceiveProps is called, so that the Gauge has a chance to compare the new value to the old one.
downvote count: 1
has comment: http://stackoverflow.com/comment/69018323
has comment: http://stackoverflow.com/comment/70926266
has comment: http://stackoverflow.com/comment/70505029
score: 317
has comment: http://stackoverflow.com/comment/39977268
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/59534689
has comment: http://stackoverflow.com/comment/38769020
upvote count: 318
has comment: http://stackoverflow.com/comment/105606007
accepted answer of: http://stackoverflow.com/q/24939623
type: Answer
has comment: http://stackoverflow.com/comment/59532282
answers question: http://stackoverflow.com/q/24939623

http://stackoverflow.com/comment/38877690
type: Comment
type: QuestionComment
has text: How about `objectThatContainsFunctions[functionName]();`?
comment on: http://stackoverflow.com/q/25003892
score: 1

http://stackoverflow.com/comment/38994694
type: AnswerComment
has text: I understand now, you pass the reference to the current promise because you did not resolve the value of action by wrapping it around an anonymous function :) . Darns! How did I Not thought of it before haha, thanks :)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25065812

http://stackoverflow.com/comment/38824002
has text: Shouldn't then the script evaluate when the end of the document is reached, due to tendency of browser to "fix" the html? According to result the script is ignored altogether, but by any chance do you know why?
comment on: http://stackoverflow.com/a/24975330
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25046269
accepted answer: http://stackoverflow.com/a/25046448
has body: How do you update the properties of an object in javascript? I would to update "id" of 68917 distance from 8.8 to 4.5... I have access to lodash.js [ { "_id":68917, "Distance":8.81, "Lat":"42.65322175", "Lon":"-73.77398886" }, { "_id":131277, "Distance":"9.86", "Lat":"42.654658", "Lon":"-73.805866" }, { "_id":62450, "Distance":6.58, "Lat":"42.67457566", "Lon":"-73.74902171" }]
possible better answer: http://stackoverflow.com/a/25046367
has answer: http://stackoverflow.com/a/25046367
tagged with: lodash
has answer: http://stackoverflow.com/a/25046639
type: AnsweredQuestion
tagged with: underscore.js
type: Question
has answer: http://stackoverflow.com/a/25046448
tagged with: javascript
has title: How do you update the properties of an object in javascript?
score: 0
answer count: 3

http://stackoverflow.com/comment/38972391
score: 0
comment on: http://stackoverflow.com/q/25053899
has text: @jgillich I might have simplified it too much but I'll create a JSFiddle, hang on
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24941528
type: Question
has answer: http://stackoverflow.com/a/24942471
has body: I am a new web developer currently working on a site that is using a login system that does not use any ajax and I would like to convert the existing framework to utilize ajax if that is possible. Currently it is simply a form that is calling actions already: <form action="<?=$url_root?>/controllers/UserController.php" method="post" name="login_form"> <input type="hidden" name="path_requested" value="<? if(isset($GLOBALS['path_requested'])) { echo $GLOBALS['path_requested']; } ?>" /> <?if(isset($invalid)){?>Invalid login! Try again.<?}?>E-mail: value="<? if(isset($email)) { echo $email; } ?>" /> Password: <input class="image" type="image" src="<?=$url_root?>/style/images/img_button_submit.jpg" name="Submit" value="Submit" /> As it stands right now the form submits to UserController.php and shows a blank screen, and then if its successful it logs in, if not it refreshes back to a certain page. I would like to convert this where ajax calls the UserController.php in the background and then returns its response. I started with just a simple form to replace the above form: E-mail: Password: <input class="image" type="image" src="<?=$url_root?>/style/images/img_button_submit.jpg" name="Submit" value="Submit" /> And here is my ajax script: I'm not sure how to return the response from UserController.php into the success or failure of the ajax call. I'm not sure if working with old code requires a total overhaul as well. Thanks for any input.
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
type: UnansweredQuestion
has title: converting old login using ajax
tagged with: php
has comment: http://stackoverflow.com/comment/38760762
has comment: http://stackoverflow.com/comment/38760718

http://stackoverflow.com/comment/38768629
comment on: http://stackoverflow.com/a/24945546
type: AnswerComment
type: Comment
score: 0
has text: Sorry to bother you as I'm not an expert in JS but what would be a good implementation to my existing code

http://stackoverflow.com/q/25017463
accepted answer: http://stackoverflow.com/a/25019306
favorite count: 0
tagged with: shapes
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25019306
linked to: http://stackoverflow.com/q/4876065
has body: I'm trying to implement a polygon self intersection algorithm from Google Maps API V3 polygons. The goal is just to detect if yes or no, a simple polygon drawn by the user is self crossing. I have found this very interesting link, but it assumes that coordinates of the polygon's vertices are given on geoJSON format. However, this isn't my case ; I'm only able to retrieve polygons coordinates using polygon.getPath() into a polygoncomplete event. This is how i retrieve the coordinates : google.maps.event.addDomListener(drawingManager, 'polygoncomplete', function(polygon) { var polygonBounds = polygon.getPath(); var coordinates = []; for(var i = 0 ; i &lt; polygonBounds.length ; i++) { vertice = { "Latitude" : polygonBounds.getAt(i).lat(), "Longitude" : polygonBounds.getAt(i).lng() } coordinates.push(vertice ); } } How can I transform these coordinates, given by polygon.getpath() into geoJSON format ? Is there any better way to detect if a Google Maps polygon is self-intersecting ? If so, could you please share some code sample and not just a mathematical explaination ? PS : I've seen this link but without any code sample, I'm a little bit lost.
tagged with: polygon
tagged with: self-intersection
tagged with: javascript
score: 4
tagged with: google-maps-api-3
upvote count: 4
has title: Google Maps Polygons self intersecting detection
answer count: 1
downvote count: 0

http://stackoverflow.com/a/24965258
has body: What does '-$1' mean in javascript? Nothing. But $1 in a replace replacement string refers to the first capture group, saying "include the first capture group in the replacement here." The - is literal text to include in the replacement. var id = k.replace(/([A-Z])/, '-$1').toLowerCase(); // Capture group ^ ^ What that call does is replace the first upper-case letter in the English alphabet (A-Z) with a dash followed by the character (and then the .toLowerCase() after it turns the string to all lower-case). E.g., "testingABC" becomes "testing-abc". (It's only the first upper-case letter because there's no "global" [g] flag on the regular expression.) In this particular case, the code doesn't need to use a capture group, it could be this: var id = k.replace(/[A-Z]/, '-$&amp;').toLowerCase() $&amp; refers to the entire match.
accepted answer of: http://stackoverflow.com/q/24965249
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24965249
type: Answer
score: 9
has comment: http://stackoverflow.com/comment/38805143
has comment: http://stackoverflow.com/comment/38805274
has comment: http://stackoverflow.com/comment/38805173
upvote count: 9

http://stackoverflow.com/q/25010032
possible better answer: http://stackoverflow.com/a/25010503
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/25010503
has comment: http://stackoverflow.com/comment/38889738
has comment: http://stackoverflow.com/comment/38890029
has body: In a javascript function, I have a multidimension array as below. How can i get a random number from myObject[1]? var myObject= [ [ [2,3], [5,9], [4,7] ], [ [1,3], [5,8] ], [ [1,2], [5,7], [6,9] ], [ [5,6], [1,7] ], [ [4,6], [1,9], [3,7],[2,8] ], [ [4,5], [3,9] ], [ [8,9], [3,5], [1,4] ], [ [7,9], [2,5] ], [ [7,8], [1,5], [3,6] ] ];
tagged with: javascript
has comment: http://stackoverflow.com/comment/38889356
tagged with: multidimensional-array
downvote count: 3
favorite count: 0
has answer: http://stackoverflow.com/a/25010150
accepted answer: http://stackoverflow.com/a/25010150
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38889143
has title: Get random number from multidimensional array
score: -1
has comment: http://stackoverflow.com/comment/38889417

http://stackoverflow.com/q/24957429
has comment: http://stackoverflow.com/comment/38790642
accepted answer: http://stackoverflow.com/a/24958194
has body: i have the following Razor view inside my asp.net mvc web application:- foreach (var item in Model) { &lt;tr id="@item.RouterID"&gt; &lt;td&gt; &lt;input type="checkbox" name="CheckBoxSelection" value="@item.RouterID.ToString()" /&gt; @Html.ActionLink("Edit", "Edit","Router", new { id=item.RouterID },null) Which will display a checkboxes inside table rows. so does Html-5 support having SelectAll checkbox , for selecting all the checkboxes that have the same name or id ? Thanks Edit i add the following selectAll checkbox:- &lt;input type="checkbox" name="selectAll" id="selectAll" /&gt; and i wrote the following script:- $('body').on("change", "#selectAll", function () { var checkflag = "false"; var checkboxes = document.getElementsByName('CheckBoxSelection'); function check() { if (checkflag == "false") { for (i = 0; i &lt; checkboxes.length; i++) { checkboxes[i].checked = true; } checkflag = "true"; } else { for (i = 0; i &lt; checkboxes.length; i++) { field[i].checked = false; } checkflag = "false"; } } }); but it did not work,, i mean the checkboxes will never get checked/unchekced .. can anyone adivce?
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24958194
tagged with: razor
has comment: http://stackoverflow.com/comment/38791171
has title: Html5 support having SelectAll for checkboxes
type: AnsweredQuestion

http://stackoverflow.com/a/25020571
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25019885
answers question: http://stackoverflow.com/q/25019885
type: Answer
has body: First, if your rows are in a loop, you cannot give hardcoded ID to your elements as there will be several HTML elements with the same ID, which is definitely very bad. Give your elements a class, that can be duplicated as many times as you want. Second, you could (and probably should if possible) use jQuery for this kind of things. It is really, really much more intuitive and easier than pure javascript. &lt;script src='/somewhere/jquery.min.js'&gt;&lt;/script&gt; &lt;script&gt; (function ($) { // Here you are sure that jQuery is included in your HTML page $(function () { // Now the DOM is fully loaded, you can use some javascript without problem // Listen a click on each ".para4" element : (class='para4') $('.para4').on('click', function (event) { // Get the parent &lt;tr&gt; element var $tr = $(this).closest('tr'); // On this parent &lt;tr&gt;, display all .para elements $tr.find('.para').show(); /* This is equivalent to : $tr.find('.para').css('display', 'block'); */ // Then hide the .para4 one only. $tr.find('.para4').hide(); /* This is equivalent to : $tr.find('.para4').css('display', 'none'); */ }); // Listen a click on each ".para5" element : (class='para5') $('.para5').on('click', function (event) { // Get the parent &lt;tr&gt; element var $tr = $(this).closest('tr'); // On this parent &lt;tr&gt;, hide all .para elements $tr.find('.para').hide(); /* This is equivalent to : $tr.find('.para').css('display', 'none'); */ // Then display the .para4 one only. $tr.find('.para4').show(); /* This is equivalent to : $tr.find('.para4').css('display', 'block'); */ }); }); })(window.jQuery); &lt;/script&gt; Fiddle : http://jsfiddle.net/9uRps/ Without jQuery, you have to use loops and event listeners : // Find all your .para4 elements var para4Array = document.getElementsByClassName('para4'); var para4Length = para4Array.length; // For each of them, listen for a click event while (para4Length--) { para4Array[para4Length].addEventListener('click', function (event) { // Fin…
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/comment/38791260
type: QuestionComment
has text: The list would likely be built in a model similar to a table if it is not specifically using a table format (ul as table-row and li as table-cell). If you were going to be implementing all those additional features I'd imagine using a list all though you are placing divs in your cells int exactly valid html. Person preference in this case is go to the list.
score: 1
comment on: http://stackoverflow.com/q/24958028
type: Comment

http://stackoverflow.com/comment/38969769
has text: Unfortunately, I still don't understand. This is simple stuff to figure out though. Just make sure you are including jQuery and bootstrap correctly and everything should work just fine.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25013292
type: Comment

http://stackoverflow.com/a/25065302
has comment: http://stackoverflow.com/comment/38994539
has comment: http://stackoverflow.com/comment/38994304
type: Answer
has comment: http://stackoverflow.com/comment/38994187
downvote count: 0
has body: You have to include the ngResource in your module's dependency list like this: var app = angular.module('myApp', ['ngRoute', 'ngResource']); Another thing is about the greet() function, when you bind a function in ng-click like this: &lt;button ng-click="greet()"&gt; Angular will look for the greet() function in the controller's scope, but you define the greet() in the controller instance itself. One way is to move the greet() function into the $scope like this: app .controller('MyCtrl', ['$scope', 'Greeter', function($scope, Greeter){ alert("yes"); $scope.greet = function(){ alert("greetttt"); Greeter.query({name:this.name}, function(response){ alert(response.greeting); }); }; }]);
score: 1
accepted answer of: http://stackoverflow.com/q/25063601
answers question: http://stackoverflow.com/q/25063601
has comment: http://stackoverflow.com/comment/38994040
has comment: http://stackoverflow.com/comment/38996679
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38994925

http://stackoverflow.com/comment/38915583
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25023664
score: 0
has text: The reason that the second one is not reproducable in your jsfiddle attempt is probably that you have selected in the fiddle options to wait for DOMready before executing the code (just what the first one does)

http://stackoverflow.com/q/24913117
downvote count: 3
type: Question
tagged with: arrays
tagged with: javascript
score: 4
has body: Is there a quick way to create a literal array filled with strings in javascript? I am coming from Ruby, where using %w{} allows for you to omit quotation marks and commas around the values of the array. For example: array = %w{a b c} =&gt; ["a", "b", "c"] is equivalent to the standard syntax for literal assignment: array = ["a", "b", "c"] =&gt; ["a", "b", "c"] Is there anything similar to this in javascript?
has comment: http://stackoverflow.com/comment/38706732
answer count: 2
favorite count: 0
has title: Shorthand for creating an array of string values in javascript
possible better answer: http://stackoverflow.com/a/24913191
upvote count: 7
has answer: http://stackoverflow.com/a/24913173
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24913173
has answer: http://stackoverflow.com/a/24913191

http://stackoverflow.com/comment/72758186
type: Comment
has text: @anapsix So the right way to reason about it is, with both default settings (2min socket timeout in nodejs and 1GB max temp file size in nginx), if 1GB of data cannot be delivered to the HTTP client within two minutes, they will only get that 1GB. *This means that lowering **or** raising the max temp file size in nginx can solve the problem!* Raising it to fit the entire response from nodejs will solve it. Likewise, lowering it to 1MB could solve it as long as nginx can push 1MB to its HTTP client within two minutes! And, of course, disabling the temp file fixes it too.
type: AnswerComment
score: 2
comment on: http://stackoverflow.com/a/25041896

http://stackoverflow.com/comment/38771738
has text: one last sir, but i want the input to remain
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24947283

http://stackoverflow.com/comment/38834842
type: Comment
type: QuestionComment
has text: @T.J.Crowder It's just a placeholder, you can put anything there. It could be `this`, or `null`, or `undefined`.
score: 0
comment on: http://stackoverflow.com/q/24981197

http://stackoverflow.com/a/24911586
answers question: http://stackoverflow.com/q/24911525
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24911525
has comment: http://stackoverflow.com/comment/38703746
has body: You're close, you need to echo the variable in the PHP file - <?php $variable = "foo"; echo $variable; ?> Then load like this - $('#loadme').load('example.php'); The content of #loadme will now be 'foo'. EDIT: Based on the OP's comments - Each echo containing a variable could be a div with an id, e.g., echo ' $variable '; Then your load statement would look like this - $('#loadme').load('example.php #foo'); Now #loadme would contain the variable echoed in that div. This is not an efficient plan if the variables are to be re-used by JavaScript/jQuery code.
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/a/25005937
has comment: http://stackoverflow.com/comment/38881793
has comment: http://stackoverflow.com/comment/38881580
has body: This might help. So if your image is is 90% width and centered, that will leave 10% left of pagespace, 5% on either side of the image. If I understand your drawing correctly, the that would mean you'd want the container your nav is in to be width: 5% position:fixed; top: 50%; right:0; margin-top -150px; // half the height height: 300px; text-align:center; The 5% width will take up the entire space to the right, but using text-align:center will get items in the middle, as per your "equal" annotation on your drawing. If you need a jsFiddle let me know Here's a fiddle: http://jsfiddle.net/47Q9p/
has comment: http://stackoverflow.com/comment/38881940
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25005569

http://stackoverflow.com/q/24913854
tagged with: google-maps
tagged with: javascript
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38717819
has body: I encounter with the javascript error: JavaScript runtime error: undefined or null reference's 'offsetwidth' property can not be retrieved Here is my javascript code block (myJavaScript.js): function initializeMap() { var lat = 41.4934579; var lng = -90.50442090000001; var myZoom = 14; init(lat, lng, myZoom); google.maps.event.addDomListener(window, 'load', init); } function init(lat, long, myZoom) { var mapOptions = { center: new google.maps.LatLng(lat, long), zoom: myZoom }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, lng), title: "ARA" }); marker.setMap(map); } Here is my GoogleMaps.aspx: Some commentators says that I should check whether the document should loaded, so I uncomment the above, however I've got another error: 0x800a1391 - JavaScript runtime error: '$' undefined. When I changed the my javascript code block (myJavaScript.js): function initializeMap() { var lat = 41.4934579; var lng = -90.50442090000001; var myZoom = 14; function init() { var mapOptions = { center: new google.maps.LatLng(lat, lng), zoom: myZoom }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(lat, lng), title: "ARA" }); marker.setMap(map); } google.maps.event.addDomListener(window, 'load', init); } Why shall I put everyting in one function in javascript file? Does not it destroy the readibility and maintainability?
has title: 'offsetwidth' property can not be retrieved
has comment: http://stackoverflow.com/comment/38710199
has comment: http://stackoverflow.com/comment/38731610
linked to: http://stackoverflow.com/q/11740663
has comment: http://stackoverflow.com/comment/38710222
has comment: http://stackoverflow.com/comment/38731717
type: Question
score: 0

http://stackoverflow.com/a/24961459
score: 0
has body: I answered a similar question today and solved it using a few underscore functions. The format of your example is pretty weird, but I would advise again to use a recursive function for this type of reads: function recursiveFuntion(collection){ collection.forEach(function(model) { //console.log(model.files); --&gt; Or do whatever you need if(model.files.length &gt; 0){ recursiveFunction(model); }; }); }; recursiveFuntion(DirectoryTree.files); The benefit of the recursive function is that it is dynamic. As you are not working with an array but with an object, you'll need to customise this code. But this is the basic principle.
type: Answer
answers question: http://stackoverflow.com/q/24961131

http://stackoverflow.com/comment/38941421
type: Comment
comment on: http://stackoverflow.com/a/25037392
score: 0
type: AnswerComment
has text: There is no fiddle. That's the URL to the start page.

http://stackoverflow.com/q/24938455
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24939105
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24939105
tagged with: ajax
score: 0
possible better answer: http://stackoverflow.com/a/24938485
has answer: http://stackoverflow.com/a/24938485
has comment: http://stackoverflow.com/comment/38754689
has body: After an AJAX call, I make an update on a PHP file, but I'm not sure, once the request is finished, what is the better way, if a PHP header location on the page who refresh the page where I'm from, or in the AJAX.done refresh the page.
tagged with: php
has title: How to redirect/refresh the page after an AJAX call

http://stackoverflow.com/a/25060573
has body: I think you can use regex for this. The main three expressions that you need are the following: [0-9]{4} // year (0[1-9]|1[0-2]) // month (0[1-9]|[1-2][0-9]|3[0-1]) // day You can combine these to fit the formats you mentioned, for example, to match "31.07.2014": (0[1-9]|[1-2][0-9]|3[0-1])\.(0[1-9]|1[0-2])\.[0-9]{4} Or "31/07/2014": (0[1-9]|[1-2][0-9]|3[0-1])\/(0[1-9]|1[0-2])\/[0-9]{4} You can decide which formats you need and create one regex expression separating the formats with the OR operator |.
type: Answer
answers question: http://stackoverflow.com/q/25060186
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/109789987
downvote count: 0

http://stackoverflow.com/q/25028188
score: 3
downvote count: 0
favorite count: 0
has body: Know how to get react-router working with ReactJS? It's throwing errors in browser console for me. My code is below. I installed npm react-router and using a basic server i.e. python -m SimpleHTTPServer 3000 which works fine for React app that doesn't have the Router code. Error in console is Uncaught Error: Parse Error: Line 18: Unexpected token . <this.props.activeRouteHandler/> I think its that my app.js can't find the react-router module, but maybe a RequireJS issue (I include it from a CDN in my index) ??? Directories /index.html /scripts/app.js /node_modules/react-router index.html Hello React app.js /** @jsx React.DOM */ var Routes = require('../node_modules/react-router/modules/main').Routes; var Route = require('../node_modules/react-router/modules/main').Route; var Link = require('../node_modules/react-router/modules/main').Link; var About = React.createClass({ render: function() { return About ; } }); var Users = React.createClass({ render: function() { return ( Users <this.props.activeRouteHandler/> ); } }); var User = React.createClass({ render: function() { return {this.props.params.userId} } }); var App = React.createClass({ render: function() { return ( About Users User 123 <this.props.activeRouteHandler/> ); } }); React.renderComponent(( ), document.body);
possible better answer: http://stackoverflow.com/a/25028307
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25028307
has answer: http://stackoverflow.com/a/25028457
upvote count: 3
type: Question
accepted answer: http://stackoverflow.com/a/25028457
tagged with: reactjs
tagged with: javascript
has title: Getting Parse Error <this.props.activeRouteHandler/>
answer count: 2

http://stackoverflow.com/q/24928345
has answer: http://stackoverflow.com/a/24928595
tagged with: javascript
type: UnansweredQuestion
has title: Call JS function from Codebehind
answer count: 2
tagged with: asp.net
has body: I use this code for call JS function from codebehind. This is button click event. ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "myfunction", "testFunc();", true); This is the code of JS. function testFunc() { //alert("msg"); document.getElementById("Text1").value = "value change"; //Text1 is html a text box } It's not change the value of the text box. But if i add alert, it is showing the alert which we can identify that the JS function is executing successfully. What could be the problem of my code?
type: Question
has answer: http://stackoverflow.com/a/24928523
score: 0
has comment: http://stackoverflow.com/comment/38735455
has comment: http://stackoverflow.com/comment/38735888

http://stackoverflow.com/q/24931421
has comment: http://stackoverflow.com/comment/38741180
favorite count: 0
linked to: http://stackoverflow.com/q/3353129
has comment: http://stackoverflow.com/comment/38740998
has body: I have one tag in my website where the user can put there HTML code and see its preview. My problem is when the user enter code below mention in my my preview functionality getting fail : Some code to show So question is how can I escape this html code in my tag as I know the problem is coming because tag. Any solution on this please. Edit Question is about using within a textarea. Problem visible here: http://jsfiddle.net/hrP6F/
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24931600
linked to: http://stackoverflow.com/q/1638599
has comment: http://stackoverflow.com/comment/38741139
score: 1
has answer: http://stackoverflow.com/a/24931702
has title: Escape HTML tag in
type: Question
linked to: http://stackoverflow.com/q/4705848
has comment: http://stackoverflow.com/comment/38740976
has comment: http://stackoverflow.com/comment/38741770
has comment: http://stackoverflow.com/comment/38741213
tagged with: javascript
tagged with: jquery
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/38741083
tagged with: http://stackoverflow.com/tag/html
downvote count: 1
has comment: http://stackoverflow.com/comment/38741034

http://stackoverflow.com/q/24915886
possible better answer: http://stackoverflow.com/a/24916463
has answer: http://stackoverflow.com/a/24916463
answer count: 2
downvote count: 0
tagged with: jquery
has body: I've created this script and it works pretty well except onload. On resize it works great and even on load it works great 90% of the time. I'm guessing that its due to the script running before the iframe is loaded but don't know what to do about it. $( document ).ready(function() { var content = $('#hero'); // top section container var iframe = $('.videoWrapper iframe'); // iframe var contentH = $(window).height() - 158; // set container height 100% of window minus some space for the header and sticky navbar var contentW = $(window).width(); // set container width 100% of window var iframeH = contentH - 150; // set iframe height to container height minus some space for margins and hgroup content.css = ('height',contentH); // set container height iframe.css = ('height',iframeH); // set iframe height var iframeW = iframeH/9 * 16; // calculate iframe aspect ratio iframe.css('width',iframeW); // set iframe width } ); $('iframe').load(function() { var content = $('#hero'); var iframe = $('.videoWrapper iframe'); var contentH = $(window).height() - 158; var contentW = $(window).width(); var iframeH = contentH - 150; content.css = ('height',contentH); var iframeW = iframeH/9 * 16; iframe.css = ('width',iframeW); } ); $(window).resize(function() { var content = $('#hero'); var iframe = $('.videoWrapper iframe'); var contentH = $(window).height() - 158; var iframeH = contentH - 150; content.css = ('height',contentH); iframe.css = ('height',iframeH); var iframeW = iframeH/9 * 16; iframe.css('width',iframeW); var margin = ($(window).width() - iframeW) / 2; $('.videoWrapper').style.marginLeft = margin; } );
favorite count: 0
has answer: http://stackoverflow.com/a/26198431
tagged with: youtube
tagged with: onload
type: AnsweredQuestion
score: 1
tagged with: embedded-resource
upvote count: 1
accepted answer: http://stackoverflow.com/a/26198431
type: Question
tagged with: javascript
has title: Youtube embed dynamic sizing

http://stackoverflow.com/comment/38827448
has text: I might be confused, but you mention that "if you leave the field blank" it should keep the value, but you're not checking that it isn't blank before storing it, so you're effectively storing an empty string, and you don't check when you load it so you're parsing an empty string.
type: Comment
comment on: http://stackoverflow.com/a/24977202
score: 0
type: AnswerComment

http://stackoverflow.com/a/24932282
type: Answer
has body: I would say it is because you are setting the loader variable in each iteration of the loop which will override the loader of the last iteration. Why is the actual loading being done in a loop? Why not load it once and clone it? eg. group = new THREE.Object3D(); var loader = new THREE.JSONLoader(); loader.load( "models/treehouse_logo.js", function(geometry){ var material = new THREE.MeshLambertMaterial({color: 0x55B663}); for(i=0; i &lt; 15; i+=3) { for(j=0; j &lt; 15; j+=3) { var mesh = new THREE.Mesh(geometry.clone(), material); mesh.position.set(i,0,j); group.add(mesh); } } }); scene.add( group ); The above code is untested
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24931070

http://stackoverflow.com/comment/38859536
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24994347
has text: i know i can use that, but i'm not sure this is ideologically correct. I'm configuring default headers for $http + request transformation function. 'reusable' - is a some aux function (e.g. generateGuid()), i can use in my controllers, etc.
score: 0

http://stackoverflow.com/q/24978998
has comment: http://stackoverflow.com/comment/38831096
has title: Unable to make modal box appear using JQuery
type: Question
has comment: http://stackoverflow.com/comment/38831499
has answer: http://stackoverflow.com/a/24979504
tagged with: javascript
tagged with: jquery
has body: Using JQuery I'm trying to get a modal box to open after a click is made on an image. I can make the box open using a hard link, but not when the user clicks the image. I've tried using .show but this does'doesn't seem correct? Example fiddle here http://jsfiddle.net/63VeU/13/ The below code structure using .go etc must remain as thats how the images are identified that they can be clicked on. I know this is a rookie, question, but I'm unable to find the anser I need anywhere. $(document).ready(function() { $('.go img').css('cursor', 'pointer'); $('.go').on('click', 'img', function(e) { $(this).width(100).height(100).appendTo('#modal-show'); $( "#modal-show" ).show( "slow", function() { // Animation complete. }); SaveMyBadge(); return false; }); });
has comment: http://stackoverflow.com/comment/38831480
score: 0
has comment: http://stackoverflow.com/comment/38831115
tagged with: http://stackoverflow.com/tag/html
answer count: 1
accepted answer: http://stackoverflow.com/a/24979504
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/25060471
has body: I m trying to insert user's check in value into db. For this i call the function and set the hidden field's value and than trying to submit the form but here after the form is submiteed hiden field's value is reset . HTML Code Check In Check Out Hours Javascript function call(){ $('#checkin').val("checkin"); $('#checkinout').submit(); } function call2(){ $('#checkout').val("checkout"); $('#checkinout').submit(); } PHP CODE if(isset($_POST['checkinout']) ){ if(isset($_POST['checkin']) && $_POST['checkin']=='checkin'){ $sql = "INSERT INTO attend (loginout,log_type,fk_userid) VALUES ('".TODAY_DATETIME."','I','".$_SEESION['user_id']."')"; }elseif(isset($_POST['checkout']) && $_POST['checkout']=='checkout'){ $sql = "INSERT INTO attend (loginout,log_type,fk_userid) VALUES ('".TODAY_DATETIME."','O','".$_SEESION['user_id']."')"; } $stmt = $class->dbh->prepare($sql); $stmt->execute(); $res = $stmt->fetch(PDO::FETCH_ASSOC); } first of all its not satisfied this if(isset($_POST['checkinout'])
tagged with: javascript
has comment: http://stackoverflow.com/comment/38984239
has comment: http://stackoverflow.com/comment/38984498
has answer: http://stackoverflow.com/a/25060544
score: 0
has answer: http://stackoverflow.com/a/25060500
has answer: http://stackoverflow.com/a/25060802
has title: value is not set after the form is submitted
favorite count: 0
linked to: http://stackoverflow.com/q/547821
type: UnansweredQuestion
tagged with: php
answer count: 4
has comment: http://stackoverflow.com/comment/38984529
has comment: http://stackoverflow.com/comment/38984684
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/25060536
type: Question

http://stackoverflow.com/a/24939830
downvote count: 0
has body: If 'not working' means that your functions are not called, then indeed it's because your event declarations are wrong (you should have posted the HTML code instead). You cannot pass parameters to the event handlers The event attribute is named on-click So you need to write on-click="{{functionName}}". Please refer to the delcarative event mapping section in the Polymer documentation.
has comment: http://stackoverflow.com/comment/38760357
answers question: http://stackoverflow.com/q/24939072
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38761088
has comment: http://stackoverflow.com/comment/38760169
has comment: http://stackoverflow.com/comment/38759419

http://stackoverflow.com/q/24918638
possible better answer: http://stackoverflow.com/a/26169528
downvote count: 2
has title: MIDI Keyboard with Javascript
score: -2
has answer: http://stackoverflow.com/a/26169528
tagged with: javascript
has body: I'm just trying to figure out the whole process of connecting a MIDI keyboard to the web. I have found things out there, but they're 3 years old or so and I think a fair amount has changed since then. To have a place to start, I want to create a web app that simply displays what note I am hitting on my MIDI keyboard when I press it. I found this thread and got it to work and all: How to discover midi keyboard in web midi api? I guess I am stuck on how to register notes. I am semi-new to things like this and any answer I can find doesn't make a whole lot of sense to me. Thanks.
favorite count: 0
tagged with: web-midi
tagged with: web-audio-api
tagged with: midi
upvote count: 0
tagged with: audio
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/23200972
has answer: http://stackoverflow.com/a/24940595
accepted answer: http://stackoverflow.com/a/24940595
type: Question
answer count: 2

http://stackoverflow.com/a/24934150
score: 0
has body: try this var object = $('.switch'); object.change(function(){ $('#my_textarea_id').attr('readonly',!this.checked); })
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24934054
downvote count: 1

graph
tags question: http://stackoverflow.com/q/24997184
tags question: http://stackoverflow.com/q/25023221
tag name: graph
tags question: http://stackoverflow.com/q/25047562
tags question: http://stackoverflow.com/q/24919870
type: Tag
tags question: http://stackoverflow.com/q/24926241

http://stackoverflow.com/comment/38742177
has text: Carrying on your good work, howabout: s.match(/[^,]+,[^,]+/g) to make it even more generic?
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24930514

http://stackoverflow.com/comment/38928792
comment on: http://stackoverflow.com/a/25030757
type: Comment
score: 0
has text: Well, if you do it this way around, the variable wouldn't need to be created locally in each function it needs to be used. Creating one variable instead of recreating it locally several times is certainly more efficient performance wise.
type: AnswerComment

http://stackoverflow.com/q/24910730
upvote count: 2
downvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/27629599
has body: I have a template which contains this SVG element … which produces this: … How can I preserve the name camelcased? I also tried using an alternative syntax ng-attr="'patternTransform=translate({{ example }}, 0)'" to no avail. What am I doing wrong?
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/27629599
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24912683
has title: How to handle patternTransform using ng-attr? (keep it camelcased)
has answer: http://stackoverflow.com/a/24912683
tagged with: attributes
tagged with: http://stackoverflow.com/tag/svg
tagged with: angularjs

http://stackoverflow.com/comment/38713401
has text: It's a bit unfair to use fibonacci because the recursion is exponential. This doesn't match the normal usage of recursion in JS.
type: AnswerComment
comment on: http://stackoverflow.com/a/24916033
type: Comment
score: 1

http://stackoverflow.com/q/24946169
has answer: http://stackoverflow.com/a/24946205
has answer: http://stackoverflow.com/a/24946246
accepted answer: http://stackoverflow.com/a/24946186
type: Question
has body: I'm fairly new to JavaScript, and I'm not sure I fully understand what's going on with the code snippet below: if ($(".filter-icon").length == 0) return; So I understand the if statement, but the part that I don't fully understand is the $(".filter-icon").length. After going through the documentation I'm a bit confused. How is $(".filter-icon") an array? I thought it was just anything that had a filter-icon class associated with it. How can you get the length of that? I apologize for the basic question, but I'm very confused by this and it's hard to google with punctuation.
tagged with: arrays
has comment: http://stackoverflow.com/comment/38769635
tagged with: javascript
tagged with: jquery
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/24946204
has answer: http://stackoverflow.com/a/24946186
has answer: http://stackoverflow.com/a/24946208
score: 0
has comment: http://stackoverflow.com/comment/38769861
upvote count: 1
has title: Understanding javascript arrays
downvote count: 1
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24946205

http://stackoverflow.com/comment/38817452
comment on: http://stackoverflow.com/a/24970780
score: 0
type: AnswerComment
has text: This looks like what I want. How would I handle a module though that requires several sockets? I assume create the object first and then simply use an addSocket function.
type: Comment

http://stackoverflow.com/comment/38905009
has text: The `type` attribute defaults to `text/javascript` in HTML5, no need to write it down. Conveniently, even older (non "HTML5") browsers had this behavior.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25018196

http://stackoverflow.com/comment/38962628
score: 0
has text: Just one pulse is perfect, thanks. The sound file is quick and short, like a drum beat or a music note. It is the removing of the class that I have struggled with, since it involves a nested setTimeout call and I cannot catch it in the debugger. Let me try this approach first, thanks for the fiddle
type: Comment
comment on: http://stackoverflow.com/a/25047705
type: AnswerComment

http://stackoverflow.com/a/25051012
type: Answer
has comment: http://stackoverflow.com/comment/38966770
has comment: http://stackoverflow.com/comment/38966867
answers question: http://stackoverflow.com/q/25050908
has body: Assuming the script sends HTML back, you can insert it into the DOM like this: xhr.onreadystatechange = function(){ if(xhr.readyState == xhr.DONE &amp;&amp; xhr.status == 200){ document.getElementById('listbox').innerHTML = xhr.responseText; } }
has comment: http://stackoverflow.com/comment/38966819
accepted answer of: http://stackoverflow.com/q/25050908
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38966798

http://stackoverflow.com/q/24937616
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24938831
has title: How to open a new tab and close it almost immediately after running a script on the new tab
favorite count: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/38755096
score: 2
type: AnsweredQuestion
upvote count: 3
accepted answer: http://stackoverflow.com/a/24938831
downvote count: 1
type: Question
tagged with: phantomjs
tagged with: dom
has comment: http://stackoverflow.com/comment/38753910
has body: I am fairly new to Javascript and programming and have been trying to make a chrome extension to monitor the price of any product the user views on a particular site and notifies the user when there is a change in price. I'm scraping the DOM to get the price. I want the extension to access the page every 5 hours and scrape the DOM and update the price. The two methods I thought would help me do this is either use PhantomJs or have my extension open a new tab with the saved URL, run the script to scrape and close it immediately. How would one go about doing it the new tab way or the Phantom way? I have tried window.open(url, '_blank') and setting a timeout but does not help. Tried using an iframe but not being able to access the document in the frame. Please excuse me if I have not complied with the guidelines to asking a question. This is my first.
answer count: 1

http://stackoverflow.com/q/25043033
has title: Need jquery to activate a click through by clicking on a different div
has body: I was hoping someone could help...I'm new to Jquery ....all I want to achieve is a click through on a hyperlinked image but this occurs when a completely separate div on another part of the page is clicked on rather than the hyperlinked image I just mentioned. .......the hyperlinked image needs to be invisible also. In case anyone is wondering why I need this ....it's because I want my own custom button rather than the standard one that comes with a CMS that I'm using and it can't be changed....it's basically a work around the owners of the system suggest. Here's what I thought would work <?php proprietary PHP here that renders the standard button ?>
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38984309
has comment: http://stackoverflow.com/comment/38984855
has comment: http://stackoverflow.com/comment/38984917
type: Question
has answer: http://stackoverflow.com/a/25043835
answer count: 2
has answer: http://stackoverflow.com/a/25043657
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38983929
score: 0
has comment: http://stackoverflow.com/comment/38953947
has comment: http://stackoverflow.com/comment/38983712

http://stackoverflow.com/comment/38911943
has text: What I didn't know is why Z in the first place. [I've just googled that](http://www.maybeck.com/ztime/).
score: 1
comment on: http://stackoverflow.com/q/25021728
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38978041
type: AnswerComment
score: 0
type: Comment
has text: Yes, you can do it that way and it will be perfectly correct. Good job!
comment on: http://stackoverflow.com/a/25056939

http://stackoverflow.com/q/25023793
has answer: http://stackoverflow.com/a/25023975
tagged with: gulp-header
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36892217
has title: Including current year in Header file with Gulp Header
type: Question
possible better answer: http://stackoverflow.com/a/36892217
accepted answer: http://stackoverflow.com/a/25023975
upvote count: 5
tagged with: date
has body: Is there anyway to print out the current year in a header file using Gulp Header? Here's an example of what I'd like to do: var banner = ['/**', ' * Copyright (c) 2014 Cofey', ' * &lt;%= pkg.name %&gt; - &lt;%= pkg.description %&gt;', ' * @version v&lt;%= pkg.version %&gt;', ' * @link &lt;%= pkg.homepage %&gt;', ' * @license &lt;%= pkg.license %&gt;', ' */', ''].join('\n');
answer count: 2
score: 5
downvote count: 0
tagged with: javascript
tagged with: gulp
favorite count: 0

http://stackoverflow.com/q/24918630
has comment: http://stackoverflow.com/comment/38718071
has comment: http://stackoverflow.com/comment/38717708
tagged with: bower
score: 1
type: Question
has title: Bower dependencies duplication
has body: I've got this problem, I'm using bower as a package manager for my project and one of my core packages is bootstrap-sass-twbs everything is perfect but than... I wanted to add a lightbox like gallery package that is based on twitter's bootstrap. But the problem is... this package requires 'classical' bootstrap package and at the end I have both: bootstrap-sass-twbs bootstrap which in my opinion is one of the worst things that can happen (library duplication). Any one know how to solve it?
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38717886
has comment: http://stackoverflow.com/comment/38717790
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: package
upvote count: 1

http://stackoverflow.com/comment/38756742
type: Comment
has text: `console.log(escape(XMLHttpRequestObject.responseText));`
comment on: http://stackoverflow.com/q/24936937
score: 0
type: QuestionComment

http://stackoverflow.com/a/25068671
has body: return; breaks and stops the function if you want to break the TimeInterval you can do it this way: var i = setInterval(FunctionA, 1000); clearInterval( i ); or you can stop the delay() with dequeue();: $( ".button4" ).dequeue();
score: 2
accepted answer of: http://stackoverflow.com/q/25068623
has comment: http://stackoverflow.com/comment/39000403
answers question: http://stackoverflow.com/q/25068623
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/39000312
has comment: http://stackoverflow.com/comment/39000589
downvote count: 0

http://stackoverflow.com/q/24991855
has body: I've got a problem near that one. Somewhere I've got a binding over a file input : var file; function initLoadImg(){ $('#test').on('change', function() { file = event.target.files; // block 1 console.log("hello"); center.html('25°C'); over = true; }); } And i'm triggering it with another javascript function : var over = false; var center; function loadImg(){ var elem = $(' '); center = elem.children().children(); $("#test").trigger('click'); passIfOver(); // block 2 console.log("bye"); return elem; } function passIfOver() { if (over) { return; } else { setTimeout(passIfOver(), 1000); } } This way, I'm able to see the "hello" before the "bye" in the console. However I don't really like this solution, (it's not clean) and user can have to wait up to 1s before getting any feedback. Would there be another way to ensure that the return elem is executed after the end of the callback on click? edit : My code doesn't even work, because of the setTimeout, I lose the restraint... edit 2 : My goal is to execute the part code 1 before the part code 2. I don't want my function loadImg() to return before the code 1 has finished to execute.
has comment: http://stackoverflow.com/comment/38855309
has comment: http://stackoverflow.com/comment/38855535
has answer: http://stackoverflow.com/a/24992131
type: Question
has comment: http://stackoverflow.com/comment/38855250
answer count: 2
has comment: http://stackoverflow.com/comment/38855670
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24991912
has title: synchronise code in javascript, wait for event to complete
linked to: http://stackoverflow.com/q/11790241
type: UnansweredQuestion

http://stackoverflow.com/comment/38799031
comment on: http://stackoverflow.com/a/24960969
score: 0
type: AnswerComment
type: Comment
has text: That's a very different question. As I noted in my answer, you are trying to manipulate `#tooltip` while it doesn't exist on the page. Try to solve it yourself first, and if you fail - make another question.

http://stackoverflow.com/comment/38906300
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25018959
has text: Check this: http://stackoverflow.com/questions/11708092/detecting-browser-autofill
score: 0

http://stackoverflow.com/comment/38715827
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24917045
type: Comment
has text: www.gnarlyweb.com:8080/wrladv/wp-content/themes/wrladv/js/wrladv.js:249 Line 249 is where I'm calling flexslider. Why do you wrap `$(window).load` inside `$(document).ready` instead of just `jQuery(function($){ ... });`

http://stackoverflow.com/q/24998357
has title: How to Open multiple modal windows and have in-modal navigation
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25123471
tagged with: angularjs
tagged with: twitter-bootstrap
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25123471
type: Question
has body: I have an issue I assume with ng-include but I am not sure. I will try to describe it as best as possible. Here is little background. I am using modal service from bootstrap, and I have created a view and a controller, that is supposed to serve as a wrapper. Idea is to inject any view in a modal. Here is a html fragment for the "modaltemplate.html" That is it, really nothing to it. Then on the $rootScope I have following code that opens a new modal based on the route name and paramters passed to it. app.run(function($rootScope,$modal) { $rootScope.openEditModal = function (startRouteName, parameters, scope) { $modal.open({ templateUrl: 'app/common/modaltemplate.html', scope: scope, controller: function($scope, $modalInstance) { $modalInstance.opened.then(function () { $scope.startRouteName = startRouteName; $scope.routeParams = parameters; }); } }); }; }); So, when the modal gets opened routeName and parameters get processed in modalCtrl.js. Part of the code was hijacked from angular code base. In nutshell it locates the url for the template to be bound to above ng-include, and sets all parameters to a routeParams on the $scope like this $scope.routeParams = next.params; //ep: set the templateUrl for the 'view' so that modal.html will load it in. $scope.templateUrl = next.$$route.templateUrl; This all works great, I am able to open any route, pass paramters, progress between routes back and forth while modal is open etc. Basically, I have a routing within modal working as if it was separate app. For example I can do this var startRouteName = 'InsuredExceptionAdd'; var params = { mode: 'add', viewTitle: "Add Insured Exception", insuredId: insuredId, }; $scope.openEditModal(startRouteName, params, $scope); and then on save I can navigate to next route etc. Now, I am trying to pop another modal from the modal, and that is where I am running into following issue. A new modal gets poped-up on top of the first, BUT, newly opened modal and the first modal now share the sam…

http://stackoverflow.com/comment/38986631
type: AnswerComment
has text: Added a basic example now.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25060833

http://stackoverflow.com/comment/38922094
has text: I really like this answer. Thanks for explaining why you chose to use `Object.keys` One question, from what I am reading, it seems like the `Object` prototype inject is not an issue with the `style` property. Can you confirm this? Also, why the `obj.style` check? This is just to make sure the `obj` has that style?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25027268
type: Comment

http://stackoverflow.com/comment/38740162
type: Comment
type: QuestionComment
score: 1
has text: Do it on the server side
comment on: http://stackoverflow.com/q/24930913

http://stackoverflow.com/q/24983127
favorite count: 0
upvote count: 0
has body: I am using HTML5 video tag to play videos on my website. When a certain image is clicked I want it to pull up the videoplayer and play the corresponding video. Any ideas on how to do this and make it compatible across all browsers? Heres the video player, So I want the src to change depending on what image is clicked &lt;video width="320" height="240" controls&gt; &lt;source src="" class="videoPlayer"&gt; &lt;source src="" class="videoPlayer"&gt; &lt;/video&gt; With this being the images clicked &lt;img src="images/1.jpg" class="boxImage" data-project="Project" data-videos="images/Portfolio/Test.webm, images/Portfolio/Test.mp4"&gt; &lt;img src="images/2.jpg" class="boxImage" data-project="Project" data-videos="images/Portfolio/Test2.webm, images/Portfolio/Test2.mp4"&gt;
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38839982
tagged with: video
has answer: http://stackoverflow.com/a/24983845
score: -1
has comment: http://stackoverflow.com/comment/38842724
type: Question
has comment: http://stackoverflow.com/comment/38839893
has title: Playing corresponding videos to different links in HTML5 Video
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 1

http://stackoverflow.com/comment/38895946
has text: Try changing your List Code as **@Html.ListBox(u => u.Users, new SelectList(Model.Users, "Id", "Name"), new { @class = "form-control", data_value_field ="Id", data_text_field = "Name" }))** Also if you don't need EditorLine Control then its better to remove it and directly use the above code. And if you are not binding your Listbox with any Variable in the model then its better to use Listbox rather than ListobxFor. In your scenario I would suggest to go with ListBox and MultiSelect rather than ListBoxFor and MultiSelectFor.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25012420

http://stackoverflow.com/comment/38934955
type: AnswerComment
score: 0
type: Comment
has text: Yep, load and update the displayed content in the relevant tab (probably a scope var).
comment on: http://stackoverflow.com/a/25030806

http://stackoverflow.com/comment/38810937
type: AnswerComment
score: 0
type: Comment
has text: @Omu You're right. I'll look into it more tomorrow to see what's going on.
comment on: http://stackoverflow.com/a/24966735

http://stackoverflow.com/a/24943638
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24943534
has body: I agree with Douglas's answer that it's not worth it. In fact I would go as far as saying that it's obfuscated coding. It's one thing to return something like return x===y in which case you are actually comparing x and y and returning true if they are equal and false otherwise. But returning the result of an assignment doesn't make much sense.

http://stackoverflow.com/comment/38701561
comment on: http://stackoverflow.com/q/24910456
score: 0
type: Comment
type: QuestionComment
has text: I am not getting variable `io` being used anywhere. is it your full code?

asp.net
tags question: http://stackoverflow.com/q/24910301
tags question: http://stackoverflow.com/q/24990259
tags question: http://stackoverflow.com/q/25053099
tags question: http://stackoverflow.com/q/24956051
tags question: http://stackoverflow.com/q/24938921
tags question: http://stackoverflow.com/q/24983566
tags question: http://stackoverflow.com/q/24950528
tags question: http://stackoverflow.com/q/25015555
tags question: http://stackoverflow.com/q/25011112
tags question: http://stackoverflow.com/q/24928269
tags question: http://stackoverflow.com/q/24992812
tags question: http://stackoverflow.com/q/24930601
tags question: http://stackoverflow.com/q/24975565
tags question: http://stackoverflow.com/q/25018787
tags question: http://stackoverflow.com/q/24913853
tags question: http://stackoverflow.com/q/24921950
tags question: http://stackoverflow.com/q/24929787
tags question: http://stackoverflow.com/q/25030454
tags question: http://stackoverflow.com/q/24961968
tags question: http://stackoverflow.com/q/24987773
tags question: http://stackoverflow.com/q/25023099
tags question: http://stackoverflow.com/q/24920408
tags question: http://stackoverflow.com/q/24995430
tags question: http://stackoverflow.com/q/25014073
tags question: http://stackoverflow.com/q/25000991
tags question: http://stackoverflow.com/q/24999675
tags question: http://stackoverflow.com/q/25027949
tags question: http://stackoverflow.com/q/24969616
tags question: http://stackoverflow.com/q/25003328
tags question: http://stackoverflow.com/q/24916135
tags question: http://stackoverflow.com/q/24993724
tags question: http://stackoverflow.com/q/24931103
tags question: http://stackoverflow.com/q/24939945
tags question: http://stackoverflow.com/q/24978937
tags question: http://stackoverflow.com/q/24937232
tags question: http://stackoverflow.com/q/24914237
tags question: http://stackoverflow.com/q/25060121
tags question: http://stackoverflow.com/q/24951419
tags question: http://stackoverflow.com/q/24989614
tags question: http://stackoverflow.com/q/24939518
tags question: http://stackoverflow.com/q/25053065
tags question: http://stackoverflow.com/q/25050766
tags question: http://stackoverflow.com/q/24993706
tags question: http://stackoverflow.com/q/25024255
tags question: http://stackoverflow.com/q/25035842
tags question: http://stackoverflow.com/q/24974018
tags question: http://stackoverflow.com/q/25026062
tags question: http://stackoverflow.com/q/24936749
tags question: http://stackoverflow.com/q/25000952
tags question: http://stackoverflow.com/q/24954852
tags question: http://stackoverflow.com/q/24969866
tags question: http://stackoverflow.com/q/24943969
tags question: http://stackoverflow.com/q/24943159
tags question: http://stackoverflow.com/q/24932938
tags question: http://stackoverflow.com/q/25000102
tags question: http://stackoverflow.com/q/24974555
tags question: http://stackoverflow.com/q/25061939
tags question: http://stackoverflow.com/q/24976843
tags question: http://stackoverflow.com/q/24992538
tags question: http://stackoverflow.com/q/24910300
tags question: http://stackoverflow.com/q/24986793
tags question: http://stackoverflow.com/q/24988980
tags question: http://stackoverflow.com/q/25035165
tags question: http://stackoverflow.com/q/24911028
tags question: http://stackoverflow.com/q/24938957
tags question: http://stackoverflow.com/q/25001680
tags question: http://stackoverflow.com/q/25059449
tags question: http://stackoverflow.com/q/25040230
type: Tag
tags question: http://stackoverflow.com/q/24999286
tags question: http://stackoverflow.com/q/24915044
tags question: http://stackoverflow.com/q/25020261
tags question: http://stackoverflow.com/q/24980513
tags question: http://stackoverflow.com/q/25058553
tags question: http://stackoverflow.com/q/24928345
tags question: http://stackoverflow.com/q/24943171
tags question: http://stackoverflow.com/q/25060397
tags question: http://stackoverflow.com/q/24972767
tags question: http://stackoverflow.com/q/24964960
tags question: http://stackoverflow.com/q/25034756

http://stackoverflow.com/comment/38756880
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24939036
has text: Only issue with this solution is if the user removes text from an input after the paragraph has faded in, the paragraph will still be visible. Not sure if that actually matters.
type: AnswerComment

google-chrome-extension
tags question: http://stackoverflow.com/q/24930403
tags question: http://stackoverflow.com/q/24912021
tags question: http://stackoverflow.com/q/24965610
tags question: http://stackoverflow.com/q/25016418
tags question: http://stackoverflow.com/q/24982941
tags question: http://stackoverflow.com/q/24968396
tag name: google-chrome-extension
tags question: http://stackoverflow.com/q/24945060
tags question: http://stackoverflow.com/q/24929068
tags question: http://stackoverflow.com/q/25021224
tags question: http://stackoverflow.com/q/24979262
tags question: http://stackoverflow.com/q/24959208
tags question: http://stackoverflow.com/q/24984677
tags question: http://stackoverflow.com/q/25025190
tags question: http://stackoverflow.com/q/25059601
tags question: http://stackoverflow.com/q/24983029
tags question: http://stackoverflow.com/q/24974048
tags question: http://stackoverflow.com/q/25038577
tags question: http://stackoverflow.com/q/24978473
tags question: http://stackoverflow.com/q/24975594
tags question: http://stackoverflow.com/q/25040168
tags question: http://stackoverflow.com/q/25022327
tags question: http://stackoverflow.com/q/24912659
tags question: http://stackoverflow.com/q/25025433
tags question: http://stackoverflow.com/q/25045917
tags question: http://stackoverflow.com/q/24937616
tags question: http://stackoverflow.com/q/24930057
tags question: http://stackoverflow.com/q/25034436
type: Tag
tags question: http://stackoverflow.com/q/25032058
tags question: http://stackoverflow.com/q/24990128
tags question: http://stackoverflow.com/q/24933680
tags question: http://stackoverflow.com/q/24974491
tags question: http://stackoverflow.com/q/24974262
tags question: http://stackoverflow.com/q/25010572
tags question: http://stackoverflow.com/q/25001919
tags question: http://stackoverflow.com/q/25005126
tags question: http://stackoverflow.com/q/25011297
tags question: http://stackoverflow.com/q/24923344
tags question: http://stackoverflow.com/q/24959372
tags question: http://stackoverflow.com/q/25026646
tags question: http://stackoverflow.com/q/24987951
tags question: http://stackoverflow.com/q/25027226
tags question: http://stackoverflow.com/q/24984666
tags question: http://stackoverflow.com/q/24960485
tags question: http://stackoverflow.com/q/24988549
tags question: http://stackoverflow.com/q/25025030
tags question: http://stackoverflow.com/q/24958625
tags question: http://stackoverflow.com/q/25021015
tags question: http://stackoverflow.com/q/25051321
tags question: http://stackoverflow.com/q/24990129
tags question: http://stackoverflow.com/q/25003219

http://stackoverflow.com/comment/51137502
has text: I'll ost it when I get the time
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25551219

http://stackoverflow.com/a/24915451
score: 2
has comment: http://stackoverflow.com/comment/38713899
downvote count: 0
has body: It is important to understand the meaning of this here (or in general when working with JavaScript or ExtJS). In a global context, this refers to the global object, also known as the global window variable. This is the case inside your Ext.onReady function: Ext.onReady(function() { console.log(this === window); // -&gt; true // because this is the global object }); In an object context, by default this refers to the owner object of the function (there are ways around it and actually this is exactly want you want do achieve using Ext.bind): var obj = { prop: 'My text property', fn: function() { console.log(this.prop); // -&gt; My text property // because "this" refers to our object "obj" } }; Now, this is exactly what makes the difference between your case and the one from the examples. When using the approach with Ext.onReady this - as pointed out above - will refer to the global object, which of course does not have a function onPortletClose. When using the approach from the examples, this is accessed from inside of initComponent, which is a member function of your derived viewport class, and therefore this refers to the component instance (= the owning object), which allows you to access your function. Ext.define('MyViewport', { extend: 'Ext.container.Viewport', onPortletClose: function(portlet) { this.showMsg('"' + portlet.title + '" was removed'); }, initComponent: function() { console.log(this); // -&gt; the instance of your viewport class Ext.apply(this, { items:[{ xtype: 'panel', title: 'Portlet 1', listeners: { 'close': Ext.bind(this.onPortletClose, this) } }] }); this.callParent(); } }); Side notes Ext.apply Ext.apply really just copies all properties from one object to another, so in this case it is just a convenient way of applying all attributes of that object to this with one function call. You could as well just use: this.items = [...]; Changing the scope of your listeners You do not need to use Ext.bind when adding listeners to a component, you can si…
answers question: http://stackoverflow.com/q/24913743
accepted answer of: http://stackoverflow.com/q/24913743
has comment: http://stackoverflow.com/comment/38740603
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38741363
type: Answer

http://stackoverflow.com/q/24995760
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/24999289
has comment: http://stackoverflow.com/comment/38862785
upvote count: 1
tagged with: css
type: AnsweredQuestion
has title: How to make a background image of a modal window appear simultaneously with a modal window, not before?
score: 1
has body: I have a modal window with a background image as a background css property. The problem is that the background image appears much faster than the modal itself. How to make make them appear simultaneously? Here is my HTML code of the modal window: &lt;div class="modal" id="regModal" tabindex="-1" role="dialog" aria-labelledby="regModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog modal-dialog-center modal-carpet" style="min-height: 400px;"&gt; &lt;div class="modal-content"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; Here is a class .modal: .modal { border: none !important; overflow: hidden; background-position: center; position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 1050; outline: 0; background: url('/img/carpet_simple.png') no-repeat fixed center; } And so background: url('/img/carpet_simple.png') no-repeat fixed center; appears instantaneously, much faster than the inner HTML code of the modal is rendered. I tried this solution. It works but it is obviously not a good one. I just make a backgroung image appear 300ml later: .pic { background: url('/img/carpet_simple.png') no-repeat fixed center; } $('.modal').on('shown.bs.modal', function() { var timeOutId = setTimeout(function() { $("#regModal").addClass("pic"); clearTimeout(timeOutId); delete(timeOutId); }, 280); }); $('.modal').on('hide.bs.modal', function() { $("#regModal").removeClass("pic"); }); How to make a background appear simultaneously with a modal inner html code or at least a little after it? And without my solution.
has comment: http://stackoverflow.com/comment/38862065
tagged with: background
type: Question
accepted answer: http://stackoverflow.com/a/24999289
downvote count: 0
tagged with: javascript
tagged with: jquery
answer count: 1
has comment: http://stackoverflow.com/comment/38862043
favorite count: 0
has comment: http://stackoverflow.com/comment/38862111

http://stackoverflow.com/q/25023178
upvote count: 17
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38914939
tagged with: source-maps
has comment: http://stackoverflow.com/comment/38915232
type: Question
has body: I'm logging javascript errors from my site, but the files are minimized so I don't get meaningful line numbers. I do have source maps, however. Is there a service, script, npm module, or anything that can help me "translate" the line numbers from the minified versions into something useful?
has title: How can I get the original line number and symbol from a sourcemap
answer count: 1
tagged with: javascript
score: 15
has answer: http://stackoverflow.com/a/25024059
tagged with: bundling-and-minification
has comment: http://stackoverflow.com/comment/38914885
tagged with: minify
favorite count: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/38914649
accepted answer: http://stackoverflow.com/a/25024059

http://stackoverflow.com/q/24985590
accepted answer: http://stackoverflow.com/a/24985708
possible better answer: http://stackoverflow.com/a/24985685
has body: I'm new to Node.js. I've been working my way through "Node.js the Right Way" by Jim R. Wilson and I'm running into a contradiction in the book (and in Node.js itself?) that I haven't been able to reconcile to my satisfaction with any amount of googling. It's stated repetitively in the book and in other resources I have looked at online that Node.js runs callbacks in response to some event line-by-line until completion, then the event loop proceeds with waiting or invoking the next callback. And because Node.js is single-threaded (and short of explicitly doing anything with the cluster module, also runs as a single process), my understanding is that there is only ever, at most, one chunk of JavaScript code executing at a time. Am I understanding that correctly? Here's the contradiction (in my mind). How is Node.js so highly concurrent if this is the case? Here is an example straight from the book that illustrates my confusion. It is intended to walk a directory of many thousands of XML files and extract the relevant bits of each into a JSON document. First the parser: 'use strict'; const fs = require('fs'), cheerio = require('cheerio'); module.exports = function(filename, callback) { fs.readFile(filename, function(err, data){ if (err) { return callback(err); } let $ = cheerio.load(data.toString()), collect = function(index, elem) { return $(elem).text(); }; callback(null, { _id: $('pgterms\\:ebook').attr('rdf:about').replace('ebooks/', ''), title: $('dcterms\\:title').text(), authors: $('pgterms\\:agent pgterms\\:name').map(collect), subjects: $('[rdf\\:resource$="/LCSH"] ~ rdf\\:value').map(collect) }); }); }; And the bit that walks the directory structure: 'use strict'; const file = require('file'), rdfParser = require('./lib/rdf-parser.js'); console.log('beginning directory walk'); file.walk(__dirname + '/cache', function(err, dirPath, dirs, files){ files.forEach(function(path){ rdfParser(path, function(err, doc) { if (err) { throw err; } else { console.log(doc); …
linked to: http://stackoverflow.com/q/10680601
type: Question
tagged with: event-loop
tagged with: javascript
score: 4
upvote count: 4
answer count: 3
has answer: http://stackoverflow.com/a/24985777
has title: Node.js event loop not making sense to me
has comment: http://stackoverflow.com/comment/38843194
downvote count: 0
has answer: http://stackoverflow.com/a/24985708
has comment: http://stackoverflow.com/comment/38843145
favorite count: 0
has comment: http://stackoverflow.com/comment/38843223
has comment: http://stackoverflow.com/comment/38852312
has comment: http://stackoverflow.com/comment/38843303
has answer: http://stackoverflow.com/a/24985685
has comment: http://stackoverflow.com/comment/38843417
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38843124

http://stackoverflow.com/comment/38814342
type: QuestionComment
comment on: http://stackoverflow.com/q/24970324
score: 0
has text: Well, there's no way to get the element wihtout using one of the DOM methods, like `getElementById`, so how exactly do you want to get the element ?
type: Comment

http://stackoverflow.com/a/34883447
type: Answer
has comment: http://stackoverflow.com/comment/57507011
answers question: http://stackoverflow.com/q/25059764
has body: I had the same problem where I had to hit the submit button on my form twice (on iOS.) Surprisingly I found that this solution worked: how to prevent blur running It was not clear at first but using this solution the mousedown event stops my normal blur event from happening but if you click the "Done" on the iOS keyboard it will let the blur event run because there was no mousedown event.
score: 0
has comment: http://stackoverflow.com/comment/57505297

http://stackoverflow.com/comment/38944395
type: AnswerComment
comment on: http://stackoverflow.com/a/25039413
score: 0
has text: Sorry, but I got an error. I guess the "callback" is an unknown function. The error is: `Uncaught TypeError: undefined is not a function`
type: Comment

http://stackoverflow.com/comment/38865521
type: QuestionComment
comment on: http://stackoverflow.com/q/24965163
has text: @Leeft - I added an update with more context. Let me know if that clarifies or if you need more info. Thanks!
score: 0
type: Comment

http://stackoverflow.com/comment/38960646
comment on: http://stackoverflow.com/a/25047545
type: Comment
has text: I agree this is a bit hacky... as an addition to hiding it, I'd go with disable, which is a valid-HTML-way of not allowing a person to select an option. Once that is done, disabled options can be set to display:none in the CSS stylesheet (instead of inline...)
score: 0
type: AnswerComment

highcharts
tags question: http://stackoverflow.com/q/24983286
tags question: http://stackoverflow.com/q/25000669
tags question: http://stackoverflow.com/q/24983681
tags question: http://stackoverflow.com/q/24939355
tags question: http://stackoverflow.com/q/25043485
tags question: http://stackoverflow.com/q/24926241
tags question: http://stackoverflow.com/q/25039217
tags question: http://stackoverflow.com/q/25013699
tags question: http://stackoverflow.com/q/24958656
tags question: http://stackoverflow.com/q/24978410
tags question: http://stackoverflow.com/q/24909561
tags question: http://stackoverflow.com/q/24910769
tags question: http://stackoverflow.com/q/24959228
tags question: http://stackoverflow.com/q/25018716
tags question: http://stackoverflow.com/q/25042030
tags question: http://stackoverflow.com/q/24968682
tags question: http://stackoverflow.com/q/24993675
tags question: http://stackoverflow.com/q/25060121
tags question: http://stackoverflow.com/q/24987791
tags question: http://stackoverflow.com/q/24958886
tags question: http://stackoverflow.com/q/25058193
tags question: http://stackoverflow.com/q/25061430
tags question: http://stackoverflow.com/q/24936131
tags question: http://stackoverflow.com/q/25065954
tags question: http://stackoverflow.com/q/24980303
tags question: http://stackoverflow.com/q/24909498
tags question: http://stackoverflow.com/q/24917051
tags question: http://stackoverflow.com/q/24996921
tags question: http://stackoverflow.com/q/24917970
tags question: http://stackoverflow.com/q/25003585
tags question: http://stackoverflow.com/q/25022753
tags question: http://stackoverflow.com/q/24949390
tags question: http://stackoverflow.com/q/25069249
tags question: http://stackoverflow.com/q/24968924
tags question: http://stackoverflow.com/q/25065548
tags question: http://stackoverflow.com/q/25026109
tags question: http://stackoverflow.com/q/24960994
tags question: http://stackoverflow.com/q/25041493
tags question: http://stackoverflow.com/q/24935834
tags question: http://stackoverflow.com/q/25001946
type: Tag
tags question: http://stackoverflow.com/q/24963808
tag name: highcharts
tags question: http://stackoverflow.com/q/24915721
tags question: http://stackoverflow.com/q/25068394
tags question: http://stackoverflow.com/q/24922800

http://stackoverflow.com/comment/38958063
comment on: http://stackoverflow.com/a/25026218
has text: I have mentioned about jquery.turbolinks gem too
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/25042532
has title: Adding values to a specific key position in PHP array
type: Question
has comment: http://stackoverflow.com/comment/38951040
has comment: http://stackoverflow.com/comment/38950970
tagged with: arrays
tagged with: javascript
has body: I'm using a library that takes, amongst other parameters, an array of names and create a &lt;select&gt; combobox containing the &lt;option&gt; elements named after what was in that array. It also assigns to the value attribute of the &lt;option&gt; nodes the value of the index at which the name was taken. So, for example, if the index 0 of an array contained "foo", then it would create a tag like follows: &lt;option value="0"&gt;foo&lt;/option&gt;. For reference, here is the code for that library: function generateSelect(objDimensionAssoc, obj, select_name, label_name, function_name, state, DivAlignement) { //Valid object before sChaine = ""; if( (obj != null) &amp;&amp; (obj != undefined) &amp;&amp; (obj != "") &amp;&amp; (parseInt(countObject(obj)) &gt; 0) ){ if( state == 'show' ){ sChaine +="&lt;label for='"+select_name+"' &gt;&lt;span&gt;"+label_name+"&lt;/span&gt;&lt;/label&gt;\n"; sChaine +="&lt;div class='"+DivAlignement+"'&gt;\n"; if(function_name != "") sChaine +="&lt;select name='"+select_name+"' id='"+select_name+"' onchange='"+function_name+"' &gt;\n"; else sChaine +="&lt;select name='"+select_name+"' id='"+select_name+"'&gt;\n"; //lang = variable reconnu dans tout les pages for (var x=0; x &lt; obj.length; x++){ //One or two domentionnal array if(obj[x] != null){ if(objDimensionAssoc == "1"){ if(chaineUrl){ sChaine += compare_and_create( x, obj[x], chaineUrl[select_name], select_name); } else { sChaine += compare_and_create( x, obj[x], "", select_name); } } else { if(chaineUrl){ sChaine += compare_and_create( x, obj[x][lang], chaineUrl[select_name], select_name); } else { sChaine += compare_and_create( x, obj[x][lang], "", select_name); } } } } sChaine +="&lt;/select&gt;\n"; sChaine +="&lt;/div&gt;\n"; } return(sChaine); } else { //empty array if( state == 'show' ){ sChaine +="&lt;label for='"+select_name+"' &gt;&lt;span&gt;"+label_name+"&lt;/span&gt;&lt;/label&gt;\n"; sChaine +="&lt;div class='"+DivAlignement+"'&gt;\n"; sChaine +="&lt;select name='"+se…
has answer: http://stackoverflow.com/a/25042614
answer count: 1
tagged with: web
tagged with: string
accepted answer: http://stackoverflow.com/a/25042614
tagged with: php
type: AnsweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/38950744

http://stackoverflow.com/comment/43074274
type: AnswerComment
comment on: http://stackoverflow.com/a/24963897
score: 0
type: Comment
has text: Thanks that fixed it for me too! Was only a problem on iOS all other devices seemed to work fine.

tree
tags question: http://stackoverflow.com/q/24926209
type: Tag
tags question: http://stackoverflow.com/q/24971092
tag name: tree
tags question: http://stackoverflow.com/q/25021146

http://stackoverflow.com/comment/38744857
comment on: http://stackoverflow.com/a/24933166
type: AnswerComment
has text: The script doesn't get through to the `.done()` method. It does however display `alert('something')` just before the ajax call is supposed to be run. How can I get the response/error then?
score: 0
type: Comment

http://stackoverflow.com/a/24975915
type: Answer
answers question: http://stackoverflow.com/q/24975899
score: 1
has body: You have to return the value from the prompt, otherwise the function will just return undefined, which is the default return value of any function that has no other value returned from it function userPrmpt(userResponse){ return prompt(userResponse); }
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38824916

http://stackoverflow.com/comment/38958313
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25037332
has text: I'm not entirely sure, but it might be because you're missing `FormMethod.Post` as the 3rd parameter of BeginForm. have a look here http://msdn.microsoft.com/en-us/library/dd460344(v=vs.118).aspx
type: Comment

http://stackoverflow.com/comment/38956560
type: Comment
has text: Thanks Frank, have tried the same thing, still have to click the link to 2nd page to get the alert.
type: AnswerComment
comment on: http://stackoverflow.com/a/25045575
score: 0

http://stackoverflow.com/comment/38955835
type: AnswerComment
type: Comment
has text: I think it is through a Javascript file. When you click on the products "Get A Quote" button, the form pops up. The first 3 fields are set and have the information in them already figured out. It has the Date, the Product Name and the Product ID. When I added your input fields into the code it added extra fields off to the side of the already permanent ones and they had nothing in them. So I think it is calling the information from the .js file. I am getting really confused now. I am not the original programmer, they worked on this back in January and now are no longer around.
comment on: http://stackoverflow.com/a/25044507
score: 0

http://stackoverflow.com/q/24971650
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: web
type: UnansweredQuestion
tagged with: requirejs
upvote count: 1
tagged with: node.js
score: 1
has body: How can I assign variables to modules in RequireJS? In other words, what is the RequireJS equivalent of this: var fs = require('fs'); var child_process = require('child_process'); I want to save these modules in their respective variables so I can call their functions and deal with them later. Edit: I tried using what Marco suggested and this is the error I get: Failed to load resource: the server responded with a status of 404 (Not Found) localhost/fs.js Uncaught Error: Script error for: fs requirejs.org/docs/errors.html#scripterror Then I placed the fs.js file right in the project directory and now the error says: Uncaught Error: Module name "fs" has not been loaded yet for context: _. Use require([]) requirejs.org/docs/errors.html#notloaded Uncaught TypeError: Cannot read property 'writeFile' of undefined Please suggest some workaround to this.
type: Question
tagged with: commonjs
has title: How to assign variables to modules in RequireJS?
has answer: http://stackoverflow.com/a/24971706
downvote count: 0

http://stackoverflow.com/q/24994719
answer count: 2
has body: I have an online shopping application where I have product categories. I have the following method to retrieve the categories from the database and it is written in C#. public IQueryable&lt;Category&gt; GetProductCategories() { var _db = new BundleShop.Models.ProductContext(); IQueryable&lt;Category&gt; query = _db.Categories; return query; } Can anybody give me a hand writing the same code in javascript?
tagged with: javascript
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38860695
has answer: http://stackoverflow.com/a/24995195
has title: ASP.net web form access database using javascript instead of C#
type: UnansweredQuestion
upvote count: 1
has answer: http://stackoverflow.com/a/24994823
has comment: http://stackoverflow.com/comment/38860305
downvote count: 1
type: Question
tagged with: c#
tagged with: database
tagged with: webforms
score: 0

ajax
tags question: http://stackoverflow.com/q/24940536
tags question: http://stackoverflow.com/q/24988755
tags question: http://stackoverflow.com/q/25058002
tags question: http://stackoverflow.com/q/25022999
tags question: http://stackoverflow.com/q/25000207
tags question: http://stackoverflow.com/q/25044974
tags question: http://stackoverflow.com/q/24949346
tags question: http://stackoverflow.com/q/25028240
tags question: http://stackoverflow.com/q/24979018
tags question: http://stackoverflow.com/q/24969989
tags question: http://stackoverflow.com/q/25048264
tags question: http://stackoverflow.com/q/24911525
tags question: http://stackoverflow.com/q/25006572
tags question: http://stackoverflow.com/q/24935213
tags question: http://stackoverflow.com/q/25009211
tags question: http://stackoverflow.com/q/25067173
tags question: http://stackoverflow.com/q/24920636
tags question: http://stackoverflow.com/q/25019737
tags question: http://stackoverflow.com/q/24914448
tags question: http://stackoverflow.com/q/25041068
tags question: http://stackoverflow.com/q/25019245
tags question: http://stackoverflow.com/q/24952939
tags question: http://stackoverflow.com/q/25025984
tags question: http://stackoverflow.com/q/25017132
tags question: http://stackoverflow.com/q/24910300
tags question: http://stackoverflow.com/q/24942435
tags question: http://stackoverflow.com/q/24972559
tags question: http://stackoverflow.com/q/24972510
tags question: http://stackoverflow.com/q/25067845
tags question: http://stackoverflow.com/q/24979054
tags question: http://stackoverflow.com/q/24954765
tags question: http://stackoverflow.com/q/24938957
tags question: http://stackoverflow.com/q/24941618
tags question: http://stackoverflow.com/q/25011145
tags question: http://stackoverflow.com/q/25036140
tags question: http://stackoverflow.com/q/24917896
tags question: http://stackoverflow.com/q/25062135
tags question: http://stackoverflow.com/q/24914886
tags question: http://stackoverflow.com/q/25033964
tags question: http://stackoverflow.com/q/24996701
tags question: http://stackoverflow.com/q/24980445
type: Tag
tags question: http://stackoverflow.com/q/24940923
tags question: http://stackoverflow.com/q/24949493
tags question: http://stackoverflow.com/q/24946749
tags question: http://stackoverflow.com/q/25002864
tags question: http://stackoverflow.com/q/24979725
tags question: http://stackoverflow.com/q/25044120
tags question: http://stackoverflow.com/q/25000448
tags question: http://stackoverflow.com/q/25016190
tags question: http://stackoverflow.com/q/24918030
tags question: http://stackoverflow.com/q/24912967
tags question: http://stackoverflow.com/q/24984649
tags question: http://stackoverflow.com/q/25066712
tags question: http://stackoverflow.com/q/25014984
tags question: http://stackoverflow.com/q/25025941
tags question: http://stackoverflow.com/q/25040861
tags question: http://stackoverflow.com/q/25042019
tags question: http://stackoverflow.com/q/24968051
tags question: http://stackoverflow.com/q/25040939
tags question: http://stackoverflow.com/q/24936937
tags question: http://stackoverflow.com/q/24969349
tags question: http://stackoverflow.com/q/24957115
tags question: http://stackoverflow.com/q/24949929
tags question: http://stackoverflow.com/q/24951335
tags question: http://stackoverflow.com/q/24930129
tags question: http://stackoverflow.com/q/25034365
tags question: http://stackoverflow.com/q/25045745
tags question: http://stackoverflow.com/q/25060397
tags question: http://stackoverflow.com/q/24981959
tags question: http://stackoverflow.com/q/25021482
tags question: http://stackoverflow.com/q/25050021
tags question: http://stackoverflow.com/q/24949709
tags question: http://stackoverflow.com/q/24933952
tags question: http://stackoverflow.com/q/24995054
tags question: http://stackoverflow.com/q/25061394
tags question: http://stackoverflow.com/q/24923065
tags question: http://stackoverflow.com/q/25062649
tags question: http://stackoverflow.com/q/25060100
tags question: http://stackoverflow.com/q/24925681

http://stackoverflow.com/comment/38854263
type: Comment
comment on: http://stackoverflow.com/a/24990601
score: 0
has text: Check out this one: http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery that explains that stuff.
type: AnswerComment

http://stackoverflow.com/a/25023408
type: AcceptedAnswer
type: Answer
has body: You may find these discussions useful: How do JavaScript closures work? Idiomatic way to wait for multiple callbacks in Node.js An initial attempt to solve this problem (that I'd likely soon refactor) might look something like: var request = require('request'); var jsdom = require('jsdom'); function fetchPlayerData(done) { var playerObject; function gotData() { if ( playerObject.RBObject &amp;&amp; playerObject.QBObject ) { //if all went well, we should have data for all positions done(playerObject); } } function qbReady(errors, window) { //existing code for scraping except... playerObject.QBObject = { position: 'qb', name: $tds.eq(0).text() }; //we write to the player object instead of a local gotData(); } function rbReady(errors, window) { //same for other positions playerObject.RBObject = {position: 'rb'}; gotData(); } jsdom.env({ url: 'http://www.fantasypros.com/nfl/projections/qb.php', scripts: ["http://code.jquery.com/jquery.js"], done: qbReady }); jsdom.env({ url: 'http://www.fantasypros.com/nfl/projections/rb.php', scripts: ["http://code.jquery.com/jquery.js"], done: rbReady }); } module.exports = { fecthPlayerData: fetchPlayerData }; And then the usage would be something like: var fetch = require('./dataFetch'); fetch.fetchPlayerData(function(data){ console.log(data.QBObject); });
accepted answer of: http://stackoverflow.com/q/25022241
has comment: http://stackoverflow.com/comment/38916354
answers question: http://stackoverflow.com/q/25022241
score: 0

http://stackoverflow.com/comment/38708176
comment on: http://stackoverflow.com/q/24913857
score: 0
type: Comment
type: QuestionComment
has text: One of the links on the right is http://stackoverflow.com/questions/750486/javascript-closure-inside-loops-simple-practical-example?rq=1 which should help.

http://stackoverflow.com/comment/38939152
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25036731
type: Comment
has text: `Failed to load resource: the server responded with a status of 400 (Bad Request)`

http://stackoverflow.com/q/24988647
has comment: http://stackoverflow.com/comment/38849187
upvote count: 2
score: 1
has answer: http://stackoverflow.com/a/24988761
downvote count: 1
type: Question
has title: Javascript - copy text from one field to another using a button
tagged with: javascript
answer count: 6
has answer: http://stackoverflow.com/a/32146388
has answer: http://stackoverflow.com/a/24988762
has body: I am trying to figure out how to insert text from one text field to another using a button. This is what I have so far: function copy(ID_value) { var textToCopy = document.getElementById(ID_value).innerHTML; var whereToCopy = document.getElementById("text"); whereToCopy.value += textToCopy; } HTML Option 1 Option 2 Option 3 or Send Option 4 Option 5 Option 6 Option 7 Option 8 Option 9 Option 10 <p /> Just as the buttons work, I need the "Send" button to send the text in the small field, to the large field, in any given order (Just as how each Option button inserts text in to the large field with proper spacing reguardless of order) Any help would be greatly appreciated.
favorite count: 0
has answer: http://stackoverflow.com/a/24988717
has answer: http://stackoverflow.com/a/32145676
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24988714
has comment: http://stackoverflow.com/comment/38849509

http://stackoverflow.com/a/25029948
downvote count: 0
answers question: http://stackoverflow.com/q/25029907
type: Answer
score: 1
upvote count: 1
has body: You've heard the disclaimers about parsing html with regex, but if you want regex, with your input, you can use this pattern: [^&gt;&lt;]+(?=&lt;\/td&gt;&lt;\/tr&gt;) In JS: var myregex = /[^&gt;&lt;]+(?=&lt;\/td&gt;&lt;\/tr&gt;)/; var matchArray = myregex.exec(yourString); if (matchArray != null) { thematch = matchArray[0]; }
accepted answer of: http://stackoverflow.com/q/25029907
type: AcceptedAnswer

http://stackoverflow.com/q/24940556
downvote count: 0
tagged with: jquery
favorite count: 0
has title: My page transition is not working
has answer: http://stackoverflow.com/a/24940635
tagged with: css
has body: I'm trying to create a full page transition using css animations. I've come to a fork in the road. I've placed a class on my link and have called it using JQuery to then apply the css class to the page to activate the transition. Now, when I assign the new window location, it wants to override the animation. It's like I can either have one or the other, not both, at least not how I'm doing it anyway...any tips? Here's the code $(document).ready(function() { var linkLocation $("a.transition").click(function(event){ event.preventDefault(); linkLocation = this.href; redirectPage(); }); function redirectPage() { $("body").attr('class', 'page-rotateSlideOut'); window.location = linkLocation; } });
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24940712
upvote count: 1
tagged with: javascript
tagged with: transition
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38758959

http://stackoverflow.com/comment/38780705
has text: Using `every` or `some` will work, but the use of a side effect of the `&&` operator instead of an `if` statement doesn't make it very readable.
type: Comment
score: 2
comment on: http://stackoverflow.com/a/24952232
type: AnswerComment

http://stackoverflow.com/q/24998624
has comment: http://stackoverflow.com/comment/38867642
has answer: http://stackoverflow.com/a/77286121
has answer: http://stackoverflow.com/a/79107238
downvote count: 4
has answer: http://stackoverflow.com/a/66317921
has title: Day Name from Date in JS
upvote count: 185
has answer: http://stackoverflow.com/a/45464959
has answer: http://stackoverflow.com/a/24998691
has answer: http://stackoverflow.com/a/77274590
has answer: http://stackoverflow.com/a/62020804
has answer: http://stackoverflow.com/a/66119133
has answer: http://stackoverflow.com/a/43284535
favorite count: 0
has answer: http://stackoverflow.com/a/63340931
has answer: http://stackoverflow.com/a/61316709
possible better answer: http://stackoverflow.com/a/45464959
has answer: http://stackoverflow.com/a/24998705
has answer: http://stackoverflow.com/a/66119001
has answer: http://stackoverflow.com/a/77960769
has answer: http://stackoverflow.com/a/69523595
has answer: http://stackoverflow.com/a/45180391
has answer: http://stackoverflow.com/a/65588812
has answer: http://stackoverflow.com/a/58145676
has answer: http://stackoverflow.com/a/24998702
has body: I need to display the name of the day given a date (like "05/23/2014") which I get from a 3rd party. I've tried using Date, but I only get the date. What is the correct way to get the name of the day?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/78320015
has comment: http://stackoverflow.com/comment/131782372
score: 181
has answer: http://stackoverflow.com/a/76807722
has comment: http://stackoverflow.com/comment/138076432
has answer: http://stackoverflow.com/a/57022208
type: Question
accepted answer: http://stackoverflow.com/a/24998705
answer count: 28
has answer: http://stackoverflow.com/a/65160970
has answer: http://stackoverflow.com/a/74661368
has answer: http://stackoverflow.com/a/73125768
has answer: http://stackoverflow.com/a/63230152
tagged with: javascript
has answer: http://stackoverflow.com/a/62028469
has answer: http://stackoverflow.com/a/57505560
tagged with: jquery

http://stackoverflow.com/a/24970576
has body: $(document).ready(function(){ var shnum = 0; $('#contentTitle .btnShare a').click(function(){ if(shnum==0) { $('#contentTitle .btnShare ul').css('display','block'); shnum = 1; } else { $('#contentTitle .btnShare ul').css('display','none'); shnum = 0; } }); $('#contentTitle .btnShare a').blur(function(){ $('#contentTitle .btnShare ul').css('display','none'); shnum = 0; }); });
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24970474
answers question: http://stackoverflow.com/q/24970474

http://stackoverflow.com/q/24947059
tagged with: markerclusterer
type: Question
tagged with: javascript
tagged with: google-maps-api-3
score: 0
has body: I have made a sample page to generate Clusters of Markers using Google Maps MarkerClusterer Library as linked below http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/docs/reference.html The sample page code is same as this one http://google-maps-utility-library-v3.googlecode.com/svn/trunk/markerclustererplus/examples/simple_example.html What I want to do is, I want to put a Button on this page and when I click on it, I want to call a Javascript function which will pass some kind of identification for the Clusters and based on that Identification, that cluster's click event will be called. I tried to look into the API reference of this library but did not find how to identify the Clusters. So finally decided to put it here. Thanks for the efforts.
tagged with: google-maps
tagged with: google-maps-markers
has comment: http://stackoverflow.com/comment/38773883
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38778394
answer count: 0
has title: How to click on specific cluster externally using Google Maps MarkerClusterer Library?

http://stackoverflow.com/q/24986197
has answer: http://stackoverflow.com/a/24986285
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: Description: I have an element that is hidden on page load. After a few moments, it fades in. If the user's cursor is on top of where that element loads in, I would like for it to still trigger hover events (e.g. .mouseenter() and .mouseleave()) without requiring the user to further move their mouse. In the example provided below, upon page load, place your cursor inside the red box. Note that this red box is only here for demonstrative purposes to show you where to place your cursor. After a few seconds, a kitten will fade into view. If you move your mouse, you will trigger scaling effects and upsize the kitten to 150%. If you don't, it will never trigger the mouse event and the kitten will not grow. How can I resolve this? Edit: It appears to trigger automatically in Firefox 31, but not in Chrome 36 or IE. Fiddle: http://jsfiddle.net/6xw8Z/1/ Code setTimeout(function() { $('#kitty').fadeIn('slow'); }, 3000); $('#kitty').mouseenter(function() { $(this).css({ 'transform': 'scale(1.5)', 'transition': 'transform 500ms' }); }).mouseleave(function() { $(this).css({ 'transform': 'scale(1)', 'transition': 'transform 500ms' }); });
has comment: http://stackoverflow.com/comment/38844573
accepted answer: http://stackoverflow.com/a/24986285
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38844727
has title: Triggering Hover Events After Fading in an Element Under the Cursor
type: Question

http://stackoverflow.com/comment/69448791
type: Comment
type: AnswerComment
has text: It depends on many factors. What version of expressjs do you use? For version 4.x+ you have to use [cookie-parser middleware](https://www.npmjs.com/package/cookie-parser) after using it you'll able to have fields `req.cookies.name` and method `res.cookie(name, value)`. As well, in version 4.11.0+ you can use `res.append('Set-Cookie', 'foo=bar; Path=/; HttpOnly')` to set multiple cookies fields. Check out api reference http://expressjs.com/
score: 0
comment on: http://stackoverflow.com/a/24933367

http://stackoverflow.com/comment/38912049
comment on: http://stackoverflow.com/a/25021736
score: 1
type: AnswerComment
has text: does that mean i copied from you ?
type: Comment

http://stackoverflow.com/a/29932226
type: Answer
has body: It's not really good to have a dependency like this, but if you need to call some init code in Controller2, you can do it using $broadcast to run init code of Controller2 directly from Controller1 when the object will be loaded.
score: 0
answers question: http://stackoverflow.com/q/25018293

http://stackoverflow.com/q/25042890
has title: Having images prepended using an array and for loop
score: 0
possible better answer: http://stackoverflow.com/a/25043111
has comment: http://stackoverflow.com/comment/38951351
has answer: http://stackoverflow.com/a/25043111
has answer: http://stackoverflow.com/a/25042993
accepted answer: http://stackoverflow.com/a/25042993
type: AnsweredQuestion
has body: I have multiple thumbnails I am trying to loop through and add to a site in an efficient way. Unfortunately I cannot seem to get them to appear the way I have set-up. It's suppose to loop through strings in an array and add those strings to img src's markup, which will then be appended to the HTML; "reggie" is called by an earlier function and it does fire (I tested it with an alert). The images are "editorial-cheese" and "editorial-lego", both in an "images/folder". var images = ["cheese", "lego"]; function reggie() { for (var i=0; i&lt;images.length; i++) { $('.port2').prepend("&lt;img class='cheese hover' src='images/editorial-"+i+".png'/&gt;"); i++; } } Let me know if more info is needed. Thanks.
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38823499
score: 0
comment on: http://stackoverflow.com/q/24974554
type: Comment
type: QuestionComment
has text: (Also, next time it would be helpful if you point out in your question the class/classes relevant to your question. As it is, I had to dig around in your code a bit to figure out what you were talking about.)

http://stackoverflow.com/a/24977494
has comment: http://stackoverflow.com/comment/76121272
has comment: http://stackoverflow.com/comment/66240416
upvote count: 83
has comment: http://stackoverflow.com/comment/118036283
answers question: http://stackoverflow.com/q/24977456
score: 81
has comment: http://stackoverflow.com/comment/101870194
has comment: http://stackoverflow.com/comment/107000637
has body: You can also use a while loop: while (true) { //your code }
downvote count: 2
type: Answer

http://stackoverflow.com/comment/38997403
comment on: http://stackoverflow.com/q/25067286
type: Comment
type: QuestionComment
has text: I believe you have confused Java with Javascript.
score: 0

http://stackoverflow.com/a/25002756
has body: You need to parse the JSON string to an object. var obj = jQuery.parseJSON( '{ "foo": "bar" }' ); alert( obj.foo ); http://jsfiddle.net/w2xcT/
type: Answer
answers question: http://stackoverflow.com/q/25002566
score: 0

regex
tags question: http://stackoverflow.com/q/24944966
tags question: http://stackoverflow.com/q/25019761
tags question: http://stackoverflow.com/q/25033001
tags question: http://stackoverflow.com/q/24954588
tags question: http://stackoverflow.com/q/24916287
tags question: http://stackoverflow.com/q/25029907
tags question: http://stackoverflow.com/q/25063619
tags question: http://stackoverflow.com/q/25057904
tags question: http://stackoverflow.com/q/25038029
tag name: regex
tags question: http://stackoverflow.com/q/24955473
tags question: http://stackoverflow.com/q/24965209
tags question: http://stackoverflow.com/q/25007483
tags question: http://stackoverflow.com/q/24919852
tags question: http://stackoverflow.com/q/24952118
tags question: http://stackoverflow.com/q/25016594
tags question: http://stackoverflow.com/q/25039478
tags question: http://stackoverflow.com/q/24971327
tags question: http://stackoverflow.com/q/25034680
tags question: http://stackoverflow.com/q/25037635
tags question: http://stackoverflow.com/q/24929678
tags question: http://stackoverflow.com/q/24934974
tags question: http://stackoverflow.com/q/25010901
tags question: http://stackoverflow.com/q/25049620
tags question: http://stackoverflow.com/q/25032023
tags question: http://stackoverflow.com/q/24991377
tags question: http://stackoverflow.com/q/25011079
tags question: http://stackoverflow.com/q/25053605
tags question: http://stackoverflow.com/q/24989065
tags question: http://stackoverflow.com/q/24951274
tags question: http://stackoverflow.com/q/24960384
tags question: http://stackoverflow.com/q/24978381
tags question: http://stackoverflow.com/q/25043860
tags question: http://stackoverflow.com/q/25039452
tags question: http://stackoverflow.com/q/25027378
tags question: http://stackoverflow.com/q/24970730
tags question: http://stackoverflow.com/q/25068739
tags question: http://stackoverflow.com/q/24982637
tags question: http://stackoverflow.com/q/24964351
tags question: http://stackoverflow.com/q/24934888
tags question: http://stackoverflow.com/q/25069242
tags question: http://stackoverflow.com/q/25009915
tags question: http://stackoverflow.com/q/25053050
tags question: http://stackoverflow.com/q/24953839
tags question: http://stackoverflow.com/q/25060186
tags question: http://stackoverflow.com/q/25040898
tags question: http://stackoverflow.com/q/25048536
tags question: http://stackoverflow.com/q/24913835
tags question: http://stackoverflow.com/q/25033863
tags question: http://stackoverflow.com/q/25021629
tags question: http://stackoverflow.com/q/24971855
tags question: http://stackoverflow.com/q/24996467
tags question: http://stackoverflow.com/q/24959699
tags question: http://stackoverflow.com/q/24966771
tags question: http://stackoverflow.com/q/24944019
tags question: http://stackoverflow.com/q/24981954
tags question: http://stackoverflow.com/q/25013987
tags question: http://stackoverflow.com/q/25023455
tags question: http://stackoverflow.com/q/24984311
tags question: http://stackoverflow.com/q/24959305
tags question: http://stackoverflow.com/q/25037608
tags question: http://stackoverflow.com/q/25044518
tags question: http://stackoverflow.com/q/24937182
tags question: http://stackoverflow.com/q/24951638
tags question: http://stackoverflow.com/q/24911092
tags question: http://stackoverflow.com/q/24973894
tags question: http://stackoverflow.com/q/24949606
tags question: http://stackoverflow.com/q/25060963
tags question: http://stackoverflow.com/q/24961780
tags question: http://stackoverflow.com/q/24926405
tags question: http://stackoverflow.com/q/25006838
tags question: http://stackoverflow.com/q/25028643
tags question: http://stackoverflow.com/q/24962542
tags question: http://stackoverflow.com/q/25057350
tags question: http://stackoverflow.com/q/24943580
tags question: http://stackoverflow.com/q/24993523
tags question: http://stackoverflow.com/q/24983176
tags question: http://stackoverflow.com/q/24980174
tags question: http://stackoverflow.com/q/24975249
tags question: http://stackoverflow.com/q/25028217

http://stackoverflow.com/comment/38922832
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25027655
has text: You cannot do that, because there is no defined ordering to the keys in an object. You can get the "last" key that the runtime *thinks* is the last key, but for all intents and purposes it's a random key.

http://stackoverflow.com/comment/38951456
type: Comment
has text: Glad I - indirectly - helped. As a rule of thumb: if you decide to use `async: false` for an ajax call, there is usually a better way of doing things. :)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25042236

http://stackoverflow.com/comment/38991484
type: Comment
type: QuestionComment
score: 0
has text: Also, which variable? `id`?
comment on: http://stackoverflow.com/q/25063470

http://stackoverflow.com/comment/38773077
score: 0
has text: height and width needed on html,body
type: Comment
comment on: http://stackoverflow.com/a/24948032
type: AnswerComment

http://stackoverflow.com/a/24969463
has comment: http://stackoverflow.com/comment/38813731
has comment: http://stackoverflow.com/comment/47679417
type: Answer
has comment: http://stackoverflow.com/comment/38814267
has comment: http://stackoverflow.com/comment/38880930
upvote count: 2
has comment: http://stackoverflow.com/comment/38880913
score: 2
has comment: http://stackoverflow.com/comment/38813062
has body: Use mouseLeaveMonitor in event Example: var combo = new ext.form.combobox({ width: 178, store: store, displayField: 'name', valueField: 'value', triggerAction: 'all', emptyText: 'blank', listeners: { expand: function(combo) { var element = combo.getPicker().el; combo.mouseLeaveMonitor = element.monitorMouseLeave(0, combo.collapse, combo); } } }); combo.applyTo('id'); First agrument it's collapse interval - you can change it.
answers question: http://stackoverflow.com/q/24969099
downvote count: 0

http://stackoverflow.com/comment/38867789
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24998659
has text: yes....i have a valued api key
score: 0

http://stackoverflow.com/a/24980784
has comment: http://stackoverflow.com/comment/39146750
has comment: http://stackoverflow.com/comment/39138835
has comment: http://stackoverflow.com/comment/39080979
has comment: http://stackoverflow.com/comment/39163358
score: 1
has comment: http://stackoverflow.com/comment/39146688
has comment: http://stackoverflow.com/comment/39150490
has comment: http://stackoverflow.com/comment/38976163
has comment: http://stackoverflow.com/comment/39140996
has comment: http://stackoverflow.com/comment/39177538
has comment: http://stackoverflow.com/comment/39121579
has comment: http://stackoverflow.com/comment/39140058
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38850898
has comment: http://stackoverflow.com/comment/39177493
has comment: http://stackoverflow.com/comment/39070457
has comment: http://stackoverflow.com/comment/38856524
has comment: http://stackoverflow.com/comment/38975581
has comment: http://stackoverflow.com/comment/39179686
has comment: http://stackoverflow.com/comment/39138893
has comment: http://stackoverflow.com/comment/39139098
has comment: http://stackoverflow.com/comment/39187385
type: Answer
has comment: http://stackoverflow.com/comment/38976505
has comment: http://stackoverflow.com/comment/39140678
has comment: http://stackoverflow.com/comment/39141759
has comment: http://stackoverflow.com/comment/39140822
accepted answer of: http://stackoverflow.com/q/24980680
has comment: http://stackoverflow.com/comment/38976220
has comment: http://stackoverflow.com/comment/39141453
has body: You must use javascript for this, not PHP as tagged. The simplest way, with simple JS : &lt;span id="price" style="display:none"&gt;&lt;?php echo get_field('price');?&gt;&lt;/span&gt; &lt;a id="price_ad" href="http://www.bookurl.com" onclick="show_price()" target="_blank"&gt; Click Here to reveal price &lt;a&gt; &lt;script&gt; function show_price() { document.getElementById('price').style.display = ''; document.getElementById('price_ad').style.display = 'none'; } &lt;/script&gt; This way, on click, link disappears, price appears, and popup opens.
has comment: http://stackoverflow.com/comment/39073003
has comment: http://stackoverflow.com/comment/38885517
has comment: http://stackoverflow.com/comment/39062662
has comment: http://stackoverflow.com/comment/39140724
answers question: http://stackoverflow.com/q/24980680
has comment: http://stackoverflow.com/comment/38850925
upvote count: 1
has comment: http://stackoverflow.com/comment/39236693
has comment: http://stackoverflow.com/comment/38885612
has comment: http://stackoverflow.com/comment/39172116
has comment: http://stackoverflow.com/comment/39141435
has comment: http://stackoverflow.com/comment/39139913
has comment: http://stackoverflow.com/comment/39164010
has comment: http://stackoverflow.com/comment/39128700
has comment: http://stackoverflow.com/comment/38856606

http://stackoverflow.com/a/25041137
answers question: http://stackoverflow.com/q/24994782
type: Answer
has comment: http://stackoverflow.com/comment/38968279
has comment: http://stackoverflow.com/comment/38968691
has body: Use something like this: function bustOut() { //no need to set href again... var sessionId = "LR&lt;%=session.getId()%&gt;"; var url="&lt;%=request.getContextPath()%&gt;/viewer/faces/faults/logReport_popup.jsf"; popupwindow=window.open(url,sessionId,"height=730,width=745,scrollbars=1,resizable=1,top=500"); //reload current window after popup opens..wait for 1000ms or 2000ms.. //reload happens after 1s as per below code... window.setTimeout("window.location.reload();", 1000); }
score: 0

http://stackoverflow.com/comment/38959987
type: QuestionComment
has text: Ugh...Angular errors are terrible when they happen in a minified state...best guess is always an injector error - doesn't seem that way though from this error. Since this doesnt happen unminified I'm guessing your syntax isn't minification safe. Can you post how you declare your Angular controllers/directives/modules?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25047340

http://stackoverflow.com/a/24959872
upvote count: 1
downvote count: 0
has body: you can write custom directive for this app.directive("isNotOpen", function(){ var linkFunction = function(scope, element, attrs){ scope.$watch( function() { return element.attr('class'); }, function(){ if(!element.hasClass("open")){ scope.$eval(scope.isNotOpen) } }); }; return { link: linkFunction scope: {isNotOpen: '&amp;'} } }) and you can use is like below &lt;div class="open" is-not-open="dosomething()"&gt;
answers question: http://stackoverflow.com/q/24959692
type: Answer
score: 1

http://stackoverflow.com/a/24997206
type: Answer
accepted answer of: http://stackoverflow.com/q/24991260
type: AcceptedAnswer
has body: I found a way to get around the problem with my own biding instead for value. Below is the code I use. Any drawbacks or mistace to edit? I'm pretty new to KO and still have problems sometimes when to use unwrap, unwrapobservable etc, but below code works. Ideas for improvement? ko.bindingHandlers.valueBasedOnObject = { init: function (element, valueAccessor, allBindings) { var prop = allBindings().optionsValue; var value = valueAccessor(); $(element).change(function () { var value = $(element).val(); var selectedModel = ko.utils.arrayFirst(ko.unwrap(allBindings().options()), function (item) { return ko.utils.unwrapObservable(item[prop]) == value; }); valueAccessor()(selectedModel); }); var valueUnwrapped = ko.unwrap(value); $(element).val(valueUnwrapped[prop]); }, update: function (element, valueAccessor, allBindings) { /* */ } };
score: 0
answers question: http://stackoverflow.com/q/24991260

http://stackoverflow.com/comment/38966601
comment on: http://stackoverflow.com/q/25051018
score: 0
type: Comment
has text: It's mainly about how I'd connect both parts. I know roughly how to both submit the form and include the data, just not at the same time
type: QuestionComment

http://stackoverflow.com/comment/38952777
type: AnswerComment
comment on: http://stackoverflow.com/a/25043661
type: Comment
has text: You should name it something more descriptive than `class2`. Also, like I mentioned earlier you should use the `data-` attributes, which will eliminate the overhead of having a dummy label. See [this for more info](http://ejohn.org/blog/html-5-data-attributes/) on them. Ex: `<asp:TextBox ID ="txtAnswer" TextMode="MultiLine" Columns="50" Rows="4" runat="server" data-essential='<%# DataBinder.Eval(Container.DataItem, "IsAnswerEssential") %>' />`
score: 0

http://stackoverflow.com/comment/38772119
comment on: http://stackoverflow.com/a/24947232
has text: there is no headers in your table.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/39020222
type: AnswerComment
type: Comment
has text: What if you make the individual images `display: none;` in the css? This would let you add them and run your sizing calculations without the incorrect sizing flicker (because hidden elements can still be sized and manipulated) and then at the end of your function, you can show everything.
comment on: http://stackoverflow.com/a/25068363
score: 0

http://stackoverflow.com/comment/64740151
has text: Actually, that error is comprehensive. I am so sure that `input` is undefined.
comment on: http://stackoverflow.com/q/25023846
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/38769413
has text: The description isn't very clear. At least to me. What does that have to do with looping through keys? Your code doesn't have a loop in it.
type: QuestionComment
comment on: http://stackoverflow.com/q/24946020
type: Comment
score: 1

http://stackoverflow.com/comment/38871214
comment on: http://stackoverflow.com/a/24996149
type: AnswerComment
score: 0
type: Comment
has text: Thank You! Would be happy if You helped solve the problem that I described in the continuation of the question.

http://stackoverflow.com/q/24998848
tagged with: typeerror
has comment: http://stackoverflow.com/comment/38867925
type: UnansweredQuestion
has body: I'm trying to put together a basic, customizable horizontal scroller based on the code provided here: http://jsfiddle.net/atAHh/261/ but when actually applied to the page, the javascript isn't taking. Chrome developer is giving me 'Uncaught TypeError: undefined is not a function' on the second line of the code below: //Start the scrolling process $(".panner").on("mouseenter", function () { var data = $(this).data('scrollModifier'), direction = parseInt(data, 10); and also with the brackets at the very end: }()); Full javascript, CSS, and html are in the jsfiddle, and these are the scripts my html references (pofoscroll.js being the problematic script): Any help would be appreciated!
has title: Uncaught typeerror: undefined is not a function for .on
downvote count: 3
has comment: http://stackoverflow.com/comment/38868095
type: Question
score: -2
has comment: http://stackoverflow.com/comment/38870738
tagged with: javascript
has comment: http://stackoverflow.com/comment/38867923
has answer: http://stackoverflow.com/a/24999025
upvote count: 1
tagged with: function
has comment: http://stackoverflow.com/comment/48426298
answer count: 1
tagged with: undefined
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/38989517
type: QuestionComment
comment on: http://stackoverflow.com/q/25063169
has text: BTW, if you're receiving a JSON or JSONP response, you don't need to call `$.parseJSON` in the success function.
score: 2
type: Comment

http://stackoverflow.com/comment/38843892
comment on: http://stackoverflow.com/a/24983720
type: AnswerComment
score: 0
has text: Can you show benchmark as support to your statement
type: Comment

http://stackoverflow.com/q/24943956
tagged with: jquery
tagged with: cross-domain
accepted answer: http://stackoverflow.com/a/24976057
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/38765842
has comment: http://stackoverflow.com/comment/38765839
possible better answer: http://stackoverflow.com/a/29409789
has answer: http://stackoverflow.com/a/33513393
has answer: http://stackoverflow.com/a/29409789
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/38780647
upvote count: 3
has body: I am trying to do a cross domain call using Polymer and the core-ajax component. I keep getting back No 'Access-Control-Allow-Origin' header is present on the requested resource. My code for the component is below If I use jQuery and the following snippet, it works $.getJSON('http://api.meetup.com/2/event_comments/?key=MyKeyc&event_id=191593992&callback=?') So I guess my question is what voodoo magic is jQuery using that Polymer is not and how do I get around it? I have checked the console and everything looks identical (headers, params etc).
has answer: http://stackoverflow.com/a/29401210
has answer: http://stackoverflow.com/a/24976057
type: Question
tagged with: polymer
has title: Polymer core-ajax cross domain issue
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/24993729
has body: You just have to upload the images, and give the relative paths to the script for all the images. var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/'; var icons = { parking: { icon: iconBase + 'parking_lot_maps.png' }, library: { icon: iconBase + 'library_maps.png' }, info: { icon: iconBase + 'info-i_maps.png' } }; function addMarker(feature) { var marker = new google.maps.Marker({ position: feature.position, icon: icons[feature.type].icon, map: map }); } Please refer to this link for further modifications Regards D.
answers question: http://stackoverflow.com/q/24993588
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38858694
upvote count: 1
has comment: http://stackoverflow.com/comment/38858553
has comment: http://stackoverflow.com/comment/38858374
downvote count: 0
has comment: http://stackoverflow.com/comment/38899630

http://stackoverflow.com/comment/38930962
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25019808
has text: Yes result is indeed just `annaheimkreiter` using code I showed above.'

http://stackoverflow.com/comment/38987198
comment on: http://stackoverflow.com/q/25061735
score: 0
has text: Correct. You can't make an HTTP request to an arbitrary server and create a file on it. That would be a massive security problem.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25041162
has body: According to this MSDN article (see sections Naming Conventions and Automagic), you can write all your event handlers inside the same &lt;script&gt; tag, provided that you name the functions objectname::eventname or objectname.eventname: &lt;script language="JScript"&gt; function Player::playStateChange(newState) { ... } function Player.currentPlaylistChange(change) { ... } &lt;/script&gt; I didn't try this though. And of course, this is all IE-specific.
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25019704
answers question: http://stackoverflow.com/q/25019704
upvote count: 3
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38878395
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25004159
score: 0
has text: The code present in the question should be enough for users to answer said question without having to go to jsFiddle. And the example should demonstrate the problem in its most minimalistic form, not a wall of code.

http://stackoverflow.com/a/45565720
has body: While searching for an answer to this question, I found a small open-source library that does the trick: SVG-to-PDFKit. If implementing your own interface is not convenient, this one is pretty easy to use (code sample from the Readme): PDFDocument.prototype.addSVG = function(svg, x, y, options) { return SVGtoPDF(this, svg, x, y, options), this; }; doc.addSVG(svg, x, y, options); The parameters are as such: doc [PDFDocument] = the PDF document created with PDFKit svg [SVGElement or string] = the SVG object or XML code x, y [number] = the position where the SVG will be added Check out the demo here.
type: Answer
upvote count: 19
answers question: http://stackoverflow.com/q/24982675
downvote count: 0
score: 19

http://stackoverflow.com/q/24935505
type: AnsweredQuestion
tagged with: npm
accepted answer: http://stackoverflow.com/a/24939807
type: Question
tagged with: javascript
tagged with: gruntjs
has title: Grunt Plugin- async.each with globbing pattern
score: 0
answer count: 1
tagged with: asynchronous
has answer: http://stackoverflow.com/a/24939807
has body: I'm working on a grunt plugin that was written (by someone else) to receive hard-coded file names (src and dest), but I'm trying to change it to be able to be pointed to a directory with a globbing pattern and specify an output folder for the "dest". But I'm having trouble with the async.each, because my initial implementation has a nested async.each. Specifically, I think I have a problem with when to call the callback(). I'm getting hung up in some loop somewhere. This does work as written because the files are created correctly both ways of configuring the Gruntfile.js, but the previously-working tests are now broken. I'm just wondering about how to structure the second nested loop. Perhaps that doesn't need to use async? The Gruntfile.js should be able to be config'd as: myplugin: { dev: { files : { 'src/business.html': 'src/test_src/business.test', ... } } }, or as a globbing pattern (this is what I'm adding) myplugin: { dev: { src: ['src/test_src/*.test'], dest: 'output' } }, The plugin started out with a single async.each, with each loop handling a specific "files" src/dest. But when we're using a globbing pattern, there's only one outer loop, the pattern, so I need a second async.each to handle the actual files (there are ~11). grunt.registerMultiTask('myplugin', 'Compiles files using myplugin', function () { done = this.async(); // Iterate over all specified file groups. async.each(this.files, function (fileGlob, cb) { var destination = fileGlob.dest; grunt.log.debug("FileGlob: " + fileGlob); async.each(fileGlob.src, function (filepath, callback) { if (notAPartial(filepath) &amp;&amp; grunt.file.exists(filepath)) { if (filepath.match(/\.(test|html)$/)) { grunt.log.debug('test compilation of ' + filepath); compileMyFile(filepath, destination); } else { // this callback is from the orig version // i think it's causing problems with the nested async.each calls callback(new Error("No handler for filetype: " + filepath)); } } }, function(err) { if(err) done(err)…
tagged with: node.js

http://stackoverflow.com/comment/44580389
score: 0
type: AnswerComment
has text: I see this old thread answers a similar question but i didnt try it http://stackoverflow.com/questions/730409/jquery-ui-call-start-drag-manually
type: Comment
comment on: http://stackoverflow.com/a/28066094

bootstrap-select
tags question: http://stackoverflow.com/q/25010597
tags question: http://stackoverflow.com/q/25066417
tag name: bootstrap-select
type: Tag
tags question: http://stackoverflow.com/q/25004697

http://stackoverflow.com/q/25025030
answer count: 2
possible better answer: http://stackoverflow.com/a/25037073
has title: Inject button into site (Chrome Extension content script)
has answer: http://stackoverflow.com/a/25025630
score: 11
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/25025630
type: Question
has body: I'm trying to inject a button onto a page using Chrome's content scripts, but the button never appears, and I get no error in the console. My manifest.json file: { "name": "Test", "version": "0.0.1", "manifest_version": 2, "description": "Test", "default_locale": "en", "permissions": [ "&lt;all_urls&gt;" ], "content_scripts": [ { "matches": [ "&lt;all_urls&gt;" ], "js": [ "src/inject/inject.js" ] } ] } and my inject.js file: document.addEventListener('DOMContentLoaded', function () { var buttonOnSite = document.getElementById("buttonOnSite"); var button = document.createElement("button"); var text = document.createTextNode("test"); button.appendChild(text); buttonOnSite.appendChild(button); }); What I expect from the above code, is when I go to the site where a button with the id buttonOnSite exists, a new button, with the text test is created after it. But nothing happens when I go to this site with the button! There is definitely a button with the id buttonOnSite (I've changed the ID for here, because it's a long ID). I get no error message in the console, so what's wrong? It's probably something obvious, but I just can't see it. Any help is appreciated!
tagged with: google-chrome-extension
has answer: http://stackoverflow.com/a/25037073
upvote count: 11

http://stackoverflow.com/a/24938456
has comment: http://stackoverflow.com/comment/38754630
score: 0
has body: Don't do it that way. Send the value of the alert in the json, and then run the alert function when the value is received at the other end. var object = { name: "lalala", alert: "lalala"} alert(object.alert); Edit: In fact all you would need is var object = { name: "lalala"} When response received: alert(object.name);
type: Answer
answers question: http://stackoverflow.com/q/24938317

http://stackoverflow.com/comment/38912998
score: 0
has text: I wasn't aware that jQuery had a vanilla... -- it's already a library itself.
type: QuestionComment
comment on: http://stackoverflow.com/q/25022426
type: Comment

http://stackoverflow.com/q/25024256
has body: Consider a JSON object with the following data: { "results": [ { flags: [ is_special: true // or false, or non-existing ], type: "typeone" // or typetwo, or non-existing }, ... // repeats ] } What's an efficient way of creating a filter for ng-repeat="result in json.results" that orders results: by putting all of the is_special=true first, ordered by #2, &amp; #3. by putting all typeone before typetwo by putting all typetwo before all the rest (or without any flags/types). Important: it mustn't fail when some of these properties are non-existent or equal to "" Thanks
answer count: 2
has answer: http://stackoverflow.com/a/25024414
downvote count: 0
has comment: http://stackoverflow.com/comment/38916586
has title: angular.js Sort filter for ng-repeat that uses priorities and object property values
favorite count: 0
possible better answer: http://stackoverflow.com/a/25024414
tagged with: angularjs
upvote count: 2
has answer: http://stackoverflow.com/a/25024478
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25024478
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38916622
type: Question
tagged with: javascript

http://stackoverflow.com/q/24996429
type: AnsweredQuestion
score: 3
has title: Form with editable elements should have `editable-form` attribute
upvote count: 3
accepted answer: http://stackoverflow.com/a/25039232
type: Question
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/24996550
has answer: http://stackoverflow.com/a/43121883
downvote count: 0
tagged with: x-editable
has answer: http://stackoverflow.com/a/25039232
has body: I have a form within which i have used x-editable plugin for editing a text-field. But i am getting the following script error. Can anyone please tell me some solution for this Form with editable elements should have `editable-form` attribute. Working Demo html edit script var app = angular.module('myApp', ["xeditable"]); app.controller('ArrayController', function ($scope) { $scope.test = "manu"; $scope.user = { name: 'awesome user' }; });
favorite count: 0
possible better answer: http://stackoverflow.com/a/24996550
tagged with: angularjs

http://stackoverflow.com/comment/38938068
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25035967
has text: Add the function that returns this value, we can't guess your code
type: Comment

http://stackoverflow.com/comment/38752874
comment on: http://stackoverflow.com/q/24937431
score: 1
has text: great idea. I will try it using document.activeElement to check if the focus is on an editable field, and post the answer here if it works :)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38839852
comment on: http://stackoverflow.com/q/24983660
type: QuestionComment
has text: call to Stripe is asynchronous, use a promise to return from `get()`
score: 1
type: Comment

http://stackoverflow.com/a/24953224
has body: http://jsbin.com/jocane/3/edit?html,js,output $scope.filterd = $filter('filter')($scope.allMyObjects, {name: '!rike' });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24952997
type: Answer
answers question: http://stackoverflow.com/q/24952997
score: 2
upvote count: 2

http://stackoverflow.com/comment/38962054
type: AnswerComment
comment on: http://stackoverflow.com/a/25048410
score: 0
type: Comment
has text: Do you mean: you can't because you get errors or something, or you can't because it won't fit in the system you're building?

http://stackoverflow.com/comment/39008638
type: Comment
has text: Thanks for the answer actually I want to get the current time of the last video played.
comment on: http://stackoverflow.com/a/25059346
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39002659
type: QuestionComment
has text: I totally forgot--`sails.hooks.views.render` is now aliased to `sails.renderView`. Fewer keystrokes!
score: 2
comment on: http://stackoverflow.com/q/25048730
type: Comment

http://stackoverflow.com/q/25062855
type: AnsweredQuestion
score: 0
tagged with: dom
type: Question
accepted answer: http://stackoverflow.com/a/25063142
has comment: http://stackoverflow.com/comment/38988729
has comment: http://stackoverflow.com/comment/38989372
tagged with: javascript
tagged with: jquery
has body: Here is the html piece that I want to manipulate: Event Stream Calendar Customers Profile Editor Cash Movement Application List Customer Relation Editor Multiple Relation Editor Mass Relation Editor Customer Applications Phone Calls CR Status Editor This html is created dynamically by commands coming from a web socket. But I want no li tags having class k-seperator as first or last child of ul tag. And also I don't want consecutive li tags having k-separator. I aim to have the following html: Event Stream Calendar Customers Profile Editor Cash Movement Application List Customer Relation Editor Multiple Relation Editor Mass Relation Editor Customer Applications Phone Calls CR Status Editor How can I manipulate the dom using jquery? Thanks,
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25063142
has title: Removing consecutive children of ul tag

http://stackoverflow.com/q/25013942
has comment: http://stackoverflow.com/comment/38932952
type: Question
tagged with: c#
tagged with: javascript
tagged with: jquery
has body: My grid is defined as follows: @(Html.Kendo().Grid&lt;DataModels.Picking.PickingAssignmentItemViewModel&gt;() .Name(@UserInterface.Resources.GridRes.GridChild) .... .... When I try run in IE I get a conditional compilation error pointing at the name part in Jquery..(version number) on this line $.ui.plugin.add("resizable", @UserInterface.Resources.GridRes.Grid, { Can anyone suggest a way of stopping the error happening? It's incredibly annoying while debugging. I've read that I need to add @cc_on for these types of errors but the error I get appears in the dynamic version of this JQuery file so I'm unsure where to put it, and it doesn't like it in the actual view. I'm using MVC Razor and JQuery
tagged with: kendo-ui
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/38944752
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38932665
tagged with: asp.net-mvc-3
has title: Res file entry used for Kendo Grid Name causing conditional compilation errors in JQuery
has comment: http://stackoverflow.com/comment/38925453

http://stackoverflow.com/q/25028283
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38924443
score: 0
has comment: http://stackoverflow.com/comment/38924507
has comment: http://stackoverflow.com/comment/38924413
has answer: http://stackoverflow.com/a/25029328
has comment: http://stackoverflow.com/comment/38924217
has comment: http://stackoverflow.com/comment/38924460
has comment: http://stackoverflow.com/comment/38924153
has comment: http://stackoverflow.com/comment/38924090
has body: I'm trying to implement a cheat function for a minesweeper game that reveals 1 random non-bomb square (line 279), along with its safe neighboring squares (any of the 8 squares around it that have no bombs). For some reason though, doing this $(this.nonBombCells.random()[0]).click() is triggering ALL of the non-bomb squares to reveal (line 260), instead of just the random one and safe neighbors until a nearby bomb is encountered. If I comment out line 279 and click a non-bomb cell, it works as intended. I have a plunker here: http://plnkr.co/edit/OyC8LbFdsAFPn709pUiw?p=preview How can I get this function to work properly as if a human clicked that square? Relevant code: (function($){ // I am the controller for the mine sweeper game. function MineSweeper(selector, columnCount, rowCount, bombCount){ var self = this; this.table = $(selector); this.columnCount = (columnCount || 30); this.rowCount = (rowCount || 30); // Check to see if the bomb count contains a percent sign. if ((typeof(bombCount) == "string") &amp;&amp; (bombCount.indexOf("%") &gt; 0)){ // The bomb count is a percentage of the total number // of cells. this.bombCount = Math.floor( (this.columnCount * this.rowCount) * (parseInt(bombCount) / 100) ); } else { // The bomb count is just a standard number. this.bombCount = (bombCount || 15); } // Bind the click handler for the table. This way, we // don't have to attach event handlers to each cell. this.table.click( function(event){ // Pass off to the table click handler. self.onClick(event); // Cancel default event. return(false); } ); // Initialize the table. this.initTable(); }; // I build the actual markup of the table using the // given number of columns and rows. MineSweeper.prototype.buildTable = function(){ // Build the markup for a given row. var rowHtml = ("&lt;tr&gt;" + duplicateContent("&lt;td class=\"active\"&gt;&amp;nbsp;&lt;/td&gt;", this.columnCount) + "&lt;/tr&gt;"); // Build the markup for the table using the row // data the given number of t…
type: UnansweredQuestion
has title: Click on 1 item in jQuery selector array is applying to all elements in the array
has answer: http://stackoverflow.com/a/25029269
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38924130
has comment: http://stackoverflow.com/comment/38924464

http://stackoverflow.com/comment/38860390
has text: Have you tried using "#" for the parent parameter? '$('#jstree').jstree().create_node("#","AAA","last");'
score: 0
comment on: http://stackoverflow.com/q/24981637
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25003156
tagged with: jsp
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25003385
has answer: http://stackoverflow.com/a/25003385
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38876495
favorite count: 0
has answer: http://stackoverflow.com/a/25003305
accepted answer: http://stackoverflow.com/a/25003305
has comment: http://stackoverflow.com/comment/38876441
has answer: http://stackoverflow.com/a/25003473
type: AnsweredQuestion
has title: Get the values from an array
downvote count: 0
score: 1
type: Question
tagged with: html-table
has body: I have a table in my jsp: Valor Recompensa I write something in the boxes, and press Send, and the send Javascript method is called. Javascript send method, which iterates through rows and cells, and stores the values in an Array: function send(tableID) { var table = document.getElementById(tableID); var array= new Array(); for (var i = 1;i<table.rows.length; i++){ var row = table.rows[i]; for (var j = 0;row.cells.length; j++){ alert("added to array: "+row.cells[j].innerHTML); array.push(row.cells[j].innerHTML); } } } I am getting " " in the alert. I have tried using row.cells[j].firstChild.innerHTML, receiving undefined. What am I doing wrong? how could I get what the user writes in the textboxes? PS: I'm using Firefox to test. Maybe a browser issue?

http://stackoverflow.com/comment/38715900
type: AnswerComment
has text: It does not assume the order is the same. It takes a key from `a` and checks that key against `b`. Order is irrelevant here. It checks the same number of keys exist on each object and that the values are the same across objects. I've already tested this.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24917465

http://stackoverflow.com/comment/38919379
type: Comment
has text: I think I worded that poorly. So you made the parent variable to speed up the search for the button tags by telling the browser to only look in the wrapper. My question is why didn't you apply the same parent in the calculate function. So instead of document.getElementById('bill'), couldn't you have written parent.getElementById('bill')? I've tried to do it that way but it didn't seem to work for me. What's the reason?
comment on: http://stackoverflow.com/a/25005346
score: 0
type: AnswerComment

http://stackoverflow.com/a/25066517
upvote count: 1
has body: Here's what a move to Angular with Rails would mean to me. Rails does not do any server side HTML templating. Your web server serves static files - HTML (angular views), CSS, and JavaScript. Rails serves an API (your Rails models being serialized to JSON). There isn't really a model to recreate on the Angular side. You get JavaScript objects back from the web API calls. Controllers, Services, and Directives do a lot of the work in Angular. You choose when to send requests to the server in Angular. Update whenever your app needs to. I think it's helpful to think of your Angular app like any other client of your Rails API.
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25066150
type: Answer
answers question: http://stackoverflow.com/q/25066150

http://stackoverflow.com/q/24965000
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/36191680
score: 1
type: Question
tagged with: google-maps
has title: AngularJS scope variables doesn't update when it changes inside another function
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38804654
accepted answer: http://stackoverflow.com/a/36191680
linked to: http://stackoverflow.com/q/15112584
downvote count: 0
has body: I'm trying to implement a google place search in Angular but the search result list is not updating when the callback happens. It only updates the $scope variable after the function setting the variable runs twice?? The variable that is not updating is $scope.fullCtrl.searchResults HTML: {{ fullCtrl.searchResults }} Search myApp.js myApp.factory('getWait', function ($http, $q) { return { getUrl: function(url, data) { var deferred = $q.defer(); $http.get(url, data) .success(function(rtn) { deferred.resolve({ res: rtn }); }).error(function(msg, code) { deferred.reject(msg); }); return deferred.promise; } } }); myApp.controller("fullCtrl", ['$scope', '$http', "$window", "getWait", function ($scope, $http, $window, getWait) { $scope.fullCtrl = {}; $scope.fullCtrl.userLOCip = []; $scope.fullCtrl.searchResults = []; //declared here! var infoWindow = new google.maps.InfoWindow(); var service; var searchLoc; getWait.getUrl('http://ipinfo.io/json').then( function(data) { $scope.fullCtrl.userLOCip = data.res.loc.split(','); $scope.fullCtrl.userLOCip[0] = Number($scope.fullCtrl.userLOCip[0]); $scope.fullCtrl.userLOCip[1] = Number($scope.fullCtrl.userLOCip[1]); console.log($scope.fullCtrl.userLOCip); // Google maps var mapOptions = { zoom: 10, center: new google.maps.LatLng($scope.fullCtrl.userLOCip[0], $scope.fullCtrl.userLOCip[1]), } $scope.map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); service = new google.maps.places.PlacesService($scope.map); searchLoc = new google.maps.LatLng($scope.fullCtrl.userLOCip[0], $scope.fullCtrl.userLOCip[1]); } ); $scope.searchPlaces = function () { var request = { location: searchLoc, radius: 8047, // 5 miles types: ['store'] }; service.nearbySearch(request, callback); } var callback = function (results, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { for (var i = 0; i < results.length; i++) { $scope.fullCtrl.searchResults.push(results[i].name); // UPDATED HERE! createMarker(results[i]); conso…
favorite count: 0
tagged with: google-places-api
tagged with: angularjs

http://stackoverflow.com/a/25017222
has comment: http://stackoverflow.com/comment/38903033
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38903541
downvote count: 0
has comment: http://stackoverflow.com/comment/38903665
has comment: http://stackoverflow.com/comment/38902926
has body: That's because Array.prototype.splice.apply(arguments, 0) is (roughly) equivalent to arguments.splice([0]) , as it has been said by others before me, apply expects an Array as its second argument. If you wanted to retrieve the n-first parameters, you could do Array.prototype.splice.apply(arguments, [0,n]) which would be (roughly) equivalent to arguments.splice.(0,n). On the contrary, call works with any type of parameters. Array.prototype.splice.call(arguments, 0) is (roughly) equivalent to arguments.splice(0), and since splice expects an integer as its first argument and not an array, the second solution works (but not the first one). Thus, Array.prototype.splice.apply(arguments, [0]) would also work as Jeroen Noten suggested it. Please note that the "equivalences" I'm referring to would not actually work since arguments is not an Array but rather an Array-like object. However, the technique you mentioned is frequently used to turn an Array-like object into a proper Array. EDIT : I edited my answer as it contained a big mistake. Thanks to cookiemonster for the correction.
type: Answer
has comment: http://stackoverflow.com/comment/38902987
accepted answer of: http://stackoverflow.com/q/25017100
has comment: http://stackoverflow.com/comment/38903490
upvote count: 7
score: 7
has comment: http://stackoverflow.com/comment/38902946
answers question: http://stackoverflow.com/q/25017100

http://stackoverflow.com/q/25067593
tagged with: laravel-4
has answer: http://stackoverflow.com/a/25067769
has comment: http://stackoverflow.com/comment/38998903
tagged with: javascript
has title: JavaScript variable doesn't work in Laravel
has comment: http://stackoverflow.com/comment/38999261
upvote count: 1
has comment: http://stackoverflow.com/comment/38998656
has comment: http://stackoverflow.com/comment/38999286
has comment: http://stackoverflow.com/comment/38999293
has comment: http://stackoverflow.com/comment/38998997
favorite count: 0
has answer: http://stackoverflow.com/a/25068294
downvote count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38999469
has comment: http://stackoverflow.com/comment/38999193
has comment: http://stackoverflow.com/comment/38998572
has comment: http://stackoverflow.com/comment/38999055
has comment: http://stackoverflow.com/comment/38998952
tagged with: php
tagged with: laravel-blade
tagged with: laravel
has comment: http://stackoverflow.com/comment/38998747
has comment: http://stackoverflow.com/comment/38999532
has comment: http://stackoverflow.com/comment/38999311
score: 1
has comment: http://stackoverflow.com/comment/38998804
has comment: http://stackoverflow.com/comment/38999083
has comment: http://stackoverflow.com/comment/38999021
type: Question
has comment: http://stackoverflow.com/comment/38998484
has comment: http://stackoverflow.com/comment/38998636
answer count: 2
has body: All the pages in my website has the same header. I implemented that like this: extends('layouts.main') Now in some pages, I need to send a successful message and in other pages not. I implemented that like this: return....-&gt;with(array( sucessfulMessage =&gt; 'asdf' )); Please note that I do that just in some pages not in all pages. Now I want to use that variable in JavaScript. I did this in the layout.main: &lt;head&gt; {{ HTML::script('/js/jquery-2.1.1.js')}} @if(isset($successfulMessage)) &lt;script&gt; var successfulMessage = "{{$successfulMessage}}"; &lt;/script&gt; @endif {{ HTML::script('/js/myPopupScript.js')}} &lt;/head&gt; and then in myPopupScript.js I did this: $(document).ready(function(){ if(!typeof successfulMessage === 'undefined'){ alert(successfulMessage); }else{ alert("test"); } }); My problem The alert is always test even though when the successfulMessage has been sent. Important note When I use F12 in Google Chrome to see the actual HTML, I can see this: &lt;script&gt; var successfulMessage = "asdf"; &lt;/script&gt; so the variable is defined.

http://stackoverflow.com/a/24964380
score: 1
answers question: http://stackoverflow.com/q/24961938
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: You can define an interface for your service instead and keep it external to your service. So you can summarize this as :- export interface IUtilityService { /** * Returns ... * @param {number} $index - ... * @param {SomeType[]} collection:SomeType - ... * @returns {SomeType} */ rowClicked($index:number, collection:SomeType[]):number } Class UtilityService implements IUtilityService { static $inject = [ '$http', '$angularCacheFactory' ]; constructor(private $http : ng.IHttpService, private $angularCacheFactory :ng.ICacheFactoryService) { } rowClicked($index, collection) { var row = collection[$index]; if (row.current) { row.current = false; return null; } else { collection.forEach(function (object) { object.current = false; }); row.current = true; return $index; } }; } app.service('utilityService',UtilityService); and when you consume it else where you could specify the type for your dependency as IUtilityService
type: Answer
accepted answer of: http://stackoverflow.com/q/24961938

http://stackoverflow.com/a/24965714
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24965699
type: Answer
has body: You cannot run PHP inside Javascript since PHP runs on the server-side and JS the client. The only way to "call" PHP from your JavaScript is to use techniques like AJAX.
upvote count: 1

http://stackoverflow.com/q/25029813
has title: KineticJs validating jigsaw pieces?
tagged with: kineticjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25043357
has body: does anybody know how could I validate my jigsaw pieces back into the original place after being scrambled? and show that I have completed the puzzle? Currrently i am using kineticJs library. Thanks :) function jigsaw(){ var imageObj = new Image(); imageObj.src = "kidwallpaper.jpg"; imageObj.onload = function(){ drawImage(this); } } P.S : My jsfiddle : http://jsfiddle.net/vFez6/21/
type: Question
tagged with: puzzle
has answer: http://stackoverflow.com/a/25043357
tagged with: javascript
score: 0
tagged with: validation
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/q/24924500
answer count: 1
tagged with: drop-down-menu
favorite count: 0
has title: close dropdown menu with js on onclick event
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24924821
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/24885755
tagged with: css
downvote count: 0
has body: i had asked a question on closing dropdown with pure css here and some said it is not possible to i had to find other way i read on js and im currently doing the coding with js now but i had one problem with the code it is not behaving properly it show all the dropdown and destroyed the submenu as well..any tutorial on this is appreciated or any suggestion here is the fiddle i made for this problem here this is the js $(function () { $('.click-nav &gt; ul').toggleClass('no-js js'); $('.click-nav .js ul').hide(); $('.click-nav .js').click(function(e) { $('.click-nav .js ul').slideToggle(200); $('.clicker').toggleClass('active'); e.stopPropagation(); }); $(document).click(function() { if ($('.click-nav .js ul').is(':visible')) { $('.click-nav .js ul', this).slideUp(); $('.clicker').removeClass('active'); } }); });
score: 1
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1

http://stackoverflow.com/q/25027349
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25027548
type: Question
has body: I've created a website or Instagram bot that auto likes and follows based on tags. I've abide by Instagrams server side auth and enforced signed header and can currently like 100 images per hour and follow/unfollow 60 times an hour. The current limit per user is 350 likes/hour, I'd like to hit close to that, around 250-300. But each access token is only worth 100/hour. So my question is, how can I release my current access token so that I can get a new one? The website is http://instapromobiz.com if you want to try it out.
has title: How to renew Instagram token to increase api limit
tagged with: api
tagged with: javascript
score: 0
tagged with: instagram
answer count: 1
accepted answer: http://stackoverflow.com/a/25027548
tagged with: limit

http://stackoverflow.com/q/24941475
downvote count: 0
favorite count: 0
tagged with: hash
tagged with: actionscript-3
type: UnansweredQuestion
tagged with: cryptography
has title: PRNG-like seeded hash function
has comment: http://stackoverflow.com/comment/38774497
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38773898
tagged with: javascript
has body: I want two clients using the same "seed" to generate the same number by inputting a time stamp or long number, returning a float like using random(). For example w/ the function: hasher(String seed, long input); hasher("StackOverflow", 1000000010); //returns 0.57217329503213.. hasher("StackOverflow", 1000000010); //returns 0.57217329503213... hasher("StackOverflowz", 1000000010); //returns 0.15689784654554... hasher("StackOverflow", 97494849465); //returns 0.456944151561... It really isn't supposed to be secure or private, but just random enough. I figured I could use bit manipulation, but I'm by no means an expert at either hashing or bit manipulation. I realize seed is pretty much redundant as combining seed and input, but I suppose it'd help to know the best way to implement a seed in it without compromising reliability. Any ideas? Thanks.
tagged with: random
has answer: http://stackoverflow.com/a/24959570
answer count: 1

http://stackoverflow.com/q/24927969
has comment: http://stackoverflow.com/comment/38738851
has comment: http://stackoverflow.com/comment/77913662
has comment: http://stackoverflow.com/comment/38734843
tagged with: angularjs
tagged with: xmlhttprequest
has title: Angular JS SSL client-side authentication
type: AnsweredQuestion
upvote count: 2
has answer: http://stackoverflow.com/a/41345397
type: Question
tagged with: ssl
tagged with: javascript
tagged with: ssl-certificate
accepted answer: http://stackoverflow.com/a/41345397
score: 2
answer count: 1
downvote count: 0
has body: Is it possible for angular js to forward self signed certificates for establishing SSL/HTTPS connection? We're trying to insert a self signed certificate to establish https connection from a secured server through angularjs https service or XMLHTTPREQUEST, is it possible?
favorite count: 0

http://stackoverflow.com/a/30591523
has body: Change the swf path to: "sSwfPath": "//cdn.datatables.net/tabletools/2.2.2/swf/copy_csv_xls_pdf.swf"
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25022380

http://stackoverflow.com/comment/38958175
comment on: http://stackoverflow.com/q/25046386
has text: Not sure how to do it in Angular, but you can reference the `shiftKey` property of the Event object at any time to see whether the Shift key is being held down.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25031439
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/38947056
upvote count: 3
has comment: http://stackoverflow.com/comment/38946994
answers question: http://stackoverflow.com/q/25031076
has comment: http://stackoverflow.com/comment/38929361
has comment: http://stackoverflow.com/comment/38933847
accepted answer of: http://stackoverflow.com/q/25031076
has body: First you need to send the data, you can use an ajax post method: $.post("yourservlet", data=JSON.stringify(array), function(response) { // handle response from your servlet. alert(response) }); In servlet, you retrieve the data with the command: String data=request.getParameter("data"); Then you need to parse the json, you can use a library like JSON simple: Object obj = JSONValue.parse(data); JSONArray array = (JSONArray) obj; Or you can manually parse it. Based on your code, your json string will look like this: data = "[{'orange':['1.00','5']},{'apple':['2.00','5']}]"; You can use split() method or StringTokenizer to separate each object, but you should write your own parser method, for this you can find many tutorials on google.
has comment: http://stackoverflow.com/comment/38933643
has comment: http://stackoverflow.com/comment/38930558
has comment: http://stackoverflow.com/comment/38929897
has comment: http://stackoverflow.com/comment/38929711
has comment: http://stackoverflow.com/comment/38946567
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38946505

http://stackoverflow.com/q/24993189
has title: how to replace text inside an svg using js?
answer count: 1
has body: in this code I am trying to load an svg file into snap paper and then convert it to a group by : replacing &lt;svg with &lt;g and &lt;/svg&gt; with &lt;/g&gt; ? how can I fix this to work please? var s1 = Snap('#svg1'); Snap.load( "https://dl.dropboxusercontent.com/u/140225334/bicycle.svg", function( frag ) { var maing = s1.g(); maing.append(frag); maing.attr({id: 'maing' }); // city_name=city_name.replace(/ /gi,'_'); var maing = maing.replace("&lt;svg", "&lt;maing").replace("&lt;/svg&gt;", "&lt;/maing&gt;"); // how this can be fixed to work?! Edit: @ dystroy, do you mean something like this?: var s1 = Snap('#svg1'); Snap.ajax("https://dl.dropboxusercontent.com/u/140225334/bike2.svg", function(request) { var svg = Snap(request.responseXML.documentElement); var maing = svg.selectAll("svg&gt;*");//you can select any elements. s1.append(maing); maing.attr({id: 'maing' }); } ); Edit: @ dystroy, If I go this way some svg styling is not going to be copied over: please check to see how these 2 would differ: copying over the svg nodes to an g: http://jsbin.com/geyog/1/edit vs original svg file: https://dl.dropboxusercontent.com/u/140225334/bike2.svg
has comment: http://stackoverflow.com/comment/38858181
has comment: http://stackoverflow.com/comment/38857254
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25008525
favorite count: 0
has comment: http://stackoverflow.com/comment/38857222
has comment: http://stackoverflow.com/comment/38857613
tagged with: http://stackoverflow.com/tag/svg
upvote count: 2
has comment: http://stackoverflow.com/comment/38857311
downvote count: 3
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38857665
score: -1
tagged with: raphael
type: Question
has answer: http://stackoverflow.com/a/25008525

http://stackoverflow.com/a/24913737
answers question: http://stackoverflow.com/q/24913577
type: Answer
has body: well first I suggest you to put the result in an array and show the value you need like this var elems = $("[name=XCITY]"); alert($(elems[0]).val()); // will show "DELROY" alert($(elems[1]).val()); // will show "LEXINGTON"
score: 0

http://stackoverflow.com/a/24985883
upvote count: 2
type: Answer
score: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24979799
accepted answer of: http://stackoverflow.com/q/24979799
has body: At a first glance, I think that behavior is mainly due to how the FTP Protocol works. The fact is that, in each mode of transfer, Stream, Block or Compressed, not all the data is send at one time. All your transfers are cut into small pieces of data, actually 8 bits of byte size. That's how FTP clients can determine the progress of a transfer, by comparing how many packets were successfully transferred with the actual number of packets the file you want to transfer consists. All this to say that when you start the upload of you main.js file, the client begin to transfer the data (by default using the Stream mode, which is as its name suggest, a stream of bytes (Hey ! Just as gulp !)), sending in most of the cases the STOR command, creating a file on the server if it doesn't exists or replace all its content otherwise. Since the gulp watcher is triggered on each file change, a single tick of a successful transfer packet can launch your task, even if the file is not done uploading. And like I say, when the file already exists on the server, all its content is cleaned before the data is transferred, so your task will run with an empty or partial file. Your timeout helps here to wait until the file is done uploading, by the way 1 second works for now but seems a little short to me, specially if you have a poor connection or that your file size gonna expand. You can have a look to the RFC 959 for more details, which is the current standard specification for the FTP Protocol.

http://stackoverflow.com/comment/38749766
has text: your javascript url doesn't have a base (`localhost:63203`) or a parameter
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24935930

http://stackoverflow.com/q/24969627
tagged with: ruby-on-rails-4
has comment: http://stackoverflow.com/comment/38813128
tagged with: haml
answer count: 1
has comment: http://stackoverflow.com/comment/38813517
favorite count: 0
tagged with: ruby
has comment: http://stackoverflow.com/comment/38813272
has comment: http://stackoverflow.com/comment/38813299
has body: I have a javascript function (available on all pages as it's included in application.js) that detects if the browser has Flash support and outputs true or false. Now, I want to show a flash based price chart if true and a HTML/Javascript based chart if false. At the top of a Haml page I try to pass the result of the javascript function to HAML like this: :javascript if (browserHasFlashSupport()) #{showFlashChart = true} And use it in Haml further down on the page like this: - if showFlashChart # show flash chart - else # show html/js chart But I can't get it to work as the ruby variable showFlashChart is "true" no matter what - but in console, the javascript function browserHasFlashSupport() returns true/false like it should, so I must be doing something wrong. I guess it would probably be the best solution just to use the javascript functions "return true/false" directly in HAML like - if browserHasFlashSupport() if that's possible and the "right" way to do it? I'd appreciate any help, thanks :-) PS. Any tips on how to avoid the usage of inline javascript in my HAML file would be very welcome too.
accepted answer: http://stackoverflow.com/a/24970057
tagged with: ruby-on-rails
type: AnsweredQuestion
has title: How to use JavaScript variable in Haml?
has comment: http://stackoverflow.com/comment/38814063
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24970057
score: 0

http://stackoverflow.com/q/25052148
type: Question
has title: Chrome Browser Uncaught TypeError in Handlebars Template
has answer: http://stackoverflow.com/a/25061445
answer count: 1
tagged with: javascript
tagged with: jquery
score: 0
type: UnansweredQuestion
tagged with: handlebars.js
tagged with: http://stackoverflow.com/tag/json
has body: Hi I am using following code to display durations with handlebars template. But Chrome browser says error: Uncaught TypeError: Cannot read property 'replace' of undefined Please assist me what I am doing wrong. JSON: duration : ["monthly", "yearly"] Template: {{#each duration}} {{.}} {{/each}}

http://stackoverflow.com/a/24916759
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24916261
has body: You can do this pretty simply without additional libraries if your browser supports HTML5 canvas. function getTextImage(text) { var c = document.getElementById("canvas"); var ctx=c.getContext("2d"); ctx.font="20px Georgia"; ctx.fillText(text,10,50); var img = canvas.toDataURL("image/png"); return img; } var yourText = "I'm an image"; document.write('&lt;img src="' + getTextImage(yourText) + '"/&gt;'); &lt;canvas id="canvas" style="display:none;"&gt; &lt;/canvas&gt;
accepted answer of: http://stackoverflow.com/q/24916261
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38714127
type: Answer

http://stackoverflow.com/comment/38950226
has text: I used the "answer" from the question that was marked as similar. In IE8 (the lowest i need to support) it randomly places the tag anywhere in the text area, its never the same place.
comment on: http://stackoverflow.com/q/25042148
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38775727
comment on: http://stackoverflow.com/q/24949372
score: 0
type: Comment
type: QuestionComment
has text: `Akhlesh` yes i am trying so . i have no clue how to alter observable inside observableArray .

http://stackoverflow.com/a/24931601
accepted answer of: http://stackoverflow.com/q/24931234
answers question: http://stackoverflow.com/q/24931234
score: 6
type: AcceptedAnswer
downvote count: 0
has body: If the item type is string, then follow this var getAddedorRemovedItem = function (sourceArray1, sourceArray2) { var added = [], removed = []; sourceArray1.forEach(function(item){ if (sourceArray2.indexOf(item) == -1) { removed.push(item); } }); sourceArray2.forEach(function (item) { if (sourceArray1.indexOf(item) == -1) { added.push(item); } }); // here added array contain all new added item and removed contain all removed item; // do acc. to whatever you want to get outpur }
type: Answer
upvote count: 6

http://stackoverflow.com/q/25045008
has answer: http://stackoverflow.com/a/25045733
upvote count: 1
has comment: http://stackoverflow.com/comment/38955348
has body: I want to do is to get the table contents and put it in a jquery variable as multidimensional array. Is this possible thing? Can anyone give me an example thanks.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25045486
tagged with: jquery
has answer: http://stackoverflow.com/a/25045721
favorite count: 0
accepted answer: http://stackoverflow.com/a/25045721
tagged with: http://stackoverflow.com/tag/html
has title: How to get table content and put it in a variable as multidimensional array
has answer: http://stackoverflow.com/a/25045486
answer count: 4
has comment: http://stackoverflow.com/comment/38955355
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25045376
score: 1
type: Question

http://stackoverflow.com/a/24948006
type: Answer
answers question: http://stackoverflow.com/q/24933111
accepted answer of: http://stackoverflow.com/q/24933111
upvote count: 2
score: 2
type: AcceptedAnswer
downvote count: 0
has body: Solved! Add webView.setWebChromeClient(new WebChromeClient()); after webView.getSettings().setJavaScriptEnabled(true); And add @JavascriptInterface to every function that will called from javascript.

http://stackoverflow.com/comment/38723918
score: 0
type: AnswerComment
has text: Please paste my code as part of your answer, so that I can accept it.
comment on: http://stackoverflow.com/a/24921703
type: Comment

http://stackoverflow.com/a/24937336
has comment: http://stackoverflow.com/comment/38756350
has comment: http://stackoverflow.com/comment/38755335
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38765162
accepted answer of: http://stackoverflow.com/q/24933951
answers question: http://stackoverflow.com/q/24933951
has comment: http://stackoverflow.com/comment/38755888
upvote count: 1
has comment: http://stackoverflow.com/comment/38757254
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38755449
has body: It seems like a poor design choice to reinstantiate a new entity manager every time you change pages as in effect you are losing the caching mechanism and sharing the entities across pages but if you must do so you can always do so fairly trivially with something like - var manager = {}; manager = manager ? manager.clear() : new breeze.EntityManager(); or manager = manager ? (function () { delete manager; return new breeze.EntityManager(); })() : new breeze.EntityManager(); or many other ways really. I would recommend not doing that though and just doing something like this - var manager = {}; // Some route activation logic if (!manager) { manager = new breeze.EntityManager(); } Edit Well the short answer is I am not 100% sure how the breeze object in the global namespace is referencing the entity manager. I don't think there is a collection of entity managers that the breeze object keeps, but I may be wrong. I don't see why calling delete on the entity manager isn't working but this should do what you are trying to do - Somewhere in either one of your closures or in the global namespace create an object called entityManagers. Example - window.entityManagers = {}; window.entityManagers.count = 0; Then tack the manager while it is created onto that namespace. There is probably a more dynamic way to do this just giving some pseudo-code - window.entityManagers.createNewManager = function (name) { window.entityManagers[name] = new breeze.EntityManager(); } window.entityManagers.createNewManager('ManagerNumber1'); And then when you want to dispose of a specific instance just clear it then delete it. Get the instance you want either by a variable reference or if you can't do that for some crazy reason just grab it off the affected entity - window.entityManagers.deleteManager = function (name) { window.entityManagers[name].clear(); delete window.entityManagers[name]; } window.entityManagers.deleteManager('ManagerNumber1'); For all intents and purposes, as long as there no …

http://stackoverflow.com/comment/38839851
type: Comment
type: QuestionComment
has text: Are you using Chrome Console? If so it shows the reference to this which gets updated during your async task and console also gets updated.. See if `createToken` method returns a promise or something..
score: 1
comment on: http://stackoverflow.com/q/24983660

http://stackoverflow.com/comment/38891344
comment on: http://stackoverflow.com/q/25010983
has text: @NielsKeurentjes So is there another way like the applet solution to do that?
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38737697
has text: Test it in firefox ! It works in that ! I don't have chrome lastes version so haven't tested with that !
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24927261

http://stackoverflow.com/a/59082573
score: 0
has body: You can bind event by document, and initialize qtip on the first time event triggered: $(document).on('click', '.dynamic-element-class', function(){ // return if qtip already initialized if( 'object' === typeof $(elem).data('qtip') ) return $(element).qtip({ content: { text: $(this).next('div').html() }, position: { my: 'bottom center', at: 'top center', target: $(this) }, show: { ready: true, // Show qtip on initialization event: 'click mouseenter', solo: true, effect: function(offset) { $(this).fadeIn(100); } }, hide: { fixed: true, delay: 300 } }); })
type: Answer
answers question: http://stackoverflow.com/q/25030575

http://stackoverflow.com/comment/38736075
comment on: http://stackoverflow.com/a/24928322
score: 0
type: Comment
has text: I am not getting it properly.
type: AnswerComment

http://stackoverflow.com/comment/38907041
type: QuestionComment
comment on: http://stackoverflow.com/q/25017779
score: 0
type: Comment
has text: I have tried but there is so much to consider. I am using geoxml3 among other libraries and custom KML files etc and getting a simple reducted test case working is proving to be a nightmare.

http://stackoverflow.com/comment/38788539
type: AnswerComment
has text: the options that I have are coming out of a databse that contains around 10000+ values that increase on a daily basis.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24956549

http://stackoverflow.com/q/25000841
score: 0
has answer: http://stackoverflow.com/a/25002543
tagged with: prettyphoto
type: AnsweredQuestion
has body: I have a question about Jquery, it is possible to unbind an element to a script. Example: $("a[rel^='prettyPhoto']").prettyPhoto(); I want to run something like: $("a[rel^='prettyPhoto']").unbind('prettyPhoto'); and if I click on the element, the prettyPhoto doesn't work. I have try this but... it is not working.. :/ it is possible? thank you
has title: unbind a prettyPhoto element
accepted answer: http://stackoverflow.com/a/25002543
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/43069566
type: AnswerComment
has text: This is not a separate .json though, this is storing the json as a variable. How would you do it in a separate .json file? I tried redirecting var document = 'jsonSample.json', but it did not work.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24952784

http://stackoverflow.com/q/25017226
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38902952
type: UnansweredQuestion
tagged with: android
has answer: http://stackoverflow.com/a/42177289
has comment: http://stackoverflow.com/comment/38902842
has body: I am currently trying to use the &lt;video&gt; tag to, obviously, display videos. If the user clicks on the video (or poster image) it will trigger my script to set the video to fullscreen through the requestFullScreen method. When I exit fullscreen mode, I attempt to catch this by using a listener like so: document.addEventListener('fullscreenchange', function() { // This is never triggered, I never arrive here. if (isFullScreen) { // do something} else { // do something else} } I have similar listeners for mozfullscreenchange, msfullscreenchange and webkitfullscreenchange. Now my problem is that for some android devices with some browsers, the listener is not triggered. For instance, on a Samsung Galaxy Note the listener is not triggered when using Chrome, while when using Asus Transformer with Chrome it works. However, if I use Firefox on the same two devices, it only works on Samsung Galaxy Note and not the Asus Transformer. Is there a simple explanation to this inconsistency? Have I done something wrong? Is there perhaps some different events I should listen to on different versions of Android and browsers?
has comment: http://stackoverflow.com/comment/38904695
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38930257
has title: Detecting fullscreenchange does not work on some android devices
linked to: http://stackoverflow.com/q/16755129
score: 0
upvote count: 1

http://stackoverflow.com/comment/38984951
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25060512
has text: It's easy to do if it is in this order right1 -> right2 . But u use rightn->rightn-1....right1
score: 0

http://stackoverflow.com/q/24929890
has answer: http://stackoverflow.com/a/24930180
has comment: http://stackoverflow.com/comment/38738471
has title: How to Give add new item option in jquery autocomplete?
score: 2
type: AnsweredQuestion
upvote count: 2
tagged with: twitter-bootstrap
type: Question
tagged with: jquery-ui
tagged with: autocomplete
accepted answer: http://stackoverflow.com/a/24930180
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
has body: I have autocomplete implemented. I have implementation of bootstrap Modal. All i want to do is to add a new option in autocomplete response i.e Add new Item at the end. So how to implement this. My code for autocomplete is as: $(document).ready(function () { var makesCache = {}, modelsCache = {}, makesXhr, modelsXhr; $('#&lt;%= txtName.ClientID%&gt;').autocomplete({ source: function (request, response) { var term = request.term; if (term in makesCache) { response(makesCache[term]); return; } if (makesXhr != null) { makesXhr.abort(); } makesXhr = $.getJSON('AutoComplete.svc/GetProjects', request, function (data, status, xhr) { makesCache[term] = data.d; if (xhr == makesXhr) { response(data.d); makesXhr = null; } }); } }); }); The html for the modal which i want to be visible by the option inside autocomplete: &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; So how to implement this!!
favorite count: 0
linked to: http://stackoverflow.com/q/5705960

http://stackoverflow.com/comment/38727517
type: QuestionComment
comment on: http://stackoverflow.com/q/24923904
has text: Prior to angularjs-1.3, ng-transclude will create nested scope. Refer to https://github.com/angular/angular.js/issues/5489 . You can try the workaround.
score: 0
type: Comment

http://stackoverflow.com/q/24929820
favorite count: 0
linked to: http://stackoverflow.com/q/8031951
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: image
has comment: http://stackoverflow.com/comment/38739033
type: Question
has answer: http://stackoverflow.com/a/24929967
downvote count: 0
accepted answer: http://stackoverflow.com/a/24929967
tagged with: javascript
tagged with: sequential
has body: There are few images stored in a folder with random names. The contents of the folder will constantly be changing but they will have only images and no other kind of documents. Therefore i cannot predefine the image names in src. I want to display the images sequentially (one after another with specific time interval) using HTML-Javascript-CSS codes. The folder is on the client side only. Or atleast i should be able to read the filenames in the folder. I cannot use PHP. How do i do this? Thank you in advance!
linked to: http://stackoverflow.com/q/3087502
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: directory
has title: How to Display Images sequentially from a folder using HTML-Javascript-CSS?
linked to: http://stackoverflow.com/q/6994212
has comment: http://stackoverflow.com/comment/38738866

http://stackoverflow.com/comment/38794875
type: Comment
score: 1
type: QuestionComment
has text: sorry, do the opposite then; that link will show you how to insist on cache as well as avoid it...
comment on: http://stackoverflow.com/q/24959759

http://stackoverflow.com/comment/38953619
score: 0
comment on: http://stackoverflow.com/a/25044164
type: Comment
has text: Wowo, didn't know this is possible. Gonna refactor some code using this :-)
type: AnswerComment

http://stackoverflow.com/comment/38840955
has text: you would have some form of a function/module/singleton that is executed to perform ajax. The structure is very dependent on how your code uses said function and what the existing structure of your application is.
score: 0
comment on: http://stackoverflow.com/q/24984299
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38959741
type: Comment
type: QuestionComment
has text: @YuriyGalanter the purpose of this site is to be a better repository of programming knowledge than google. To that end, "just google it" etc is not helpful.
comment on: http://stackoverflow.com/q/25047262
score: 0

http://stackoverflow.com/comment/38990463
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25063773
has text: Indeed, tried it and actually works.. Damn, I was so close :P Thanks! I'll accept the answer as soon as the system allows me to, I have to wait 8 minutes :)

http://stackoverflow.com/a/25068823
type: Answer
answers question: http://stackoverflow.com/q/25068739
has body: You can create a jQuery object from html strings outside of the DOM and maniuplate it just the same as if it was in the DOM. Simple example: var html=' ABC '; alert( $(html).find('p').text() ); // alerts "ABC" Or var $div= $(' ').append(html).find('p').after(' DEF '); var newHtml= $div.html(); Will return ABC DEF Conclusion, I would loop through a jQuery object created from your html and do what you need using jQuery methods
score: 0

http://stackoverflow.com/comment/38842284
comment on: http://stackoverflow.com/q/24985072
has text: why do you need to set the `mp3` source after other scripts loaded since it appears you already have the url beforehand?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24970874
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Look what you can do according to your paths. I'd suggest you to change your controller name from 'home.controller' to 'homeCtrl' (for simplicity). Note: still you can go with home.controller but better to follow suggested way. I'm showing you with home.controller... //INCLUDE starCtrl.js (you have to create this) //include home.controller.js // initialize startCtrl here Angular Layout!! startCtrl.js app.controller('startCtrl',function(){ $location.url('home') //startCtrl gets initialized and it redirects you to home (it will check for defined routes }) ; Now, to your app.js (function(angular) { 'use strict'; var app = angular.module('app', ['ngRoute']); app.config(function($routeProvider) { $routeProvider .when('/home', { //home route found controller: 'home.controller', //controller will be applied templateUrl: '/my-scripts/vk.plants/public/static/scripts/angular/app/templates/home.html' // user will be redirected to this page. }); }); })(angular); I hope this will work. With startCtrl you can do many things which you might not be aware of.
answers question: http://stackoverflow.com/q/24970303

http://stackoverflow.com/a/24919215
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Also (or rather), in my browser the background-image styles are not parsed properly because of the missing closing parenthesis of the url() declarations. Fix that and then the background-image's can be retrieved using $().css(). Details: I see &lt;a style="background-image: url(https://../thumbnail.png" class="gist thumbnail" href=".."&gt; It should be &lt;a style="background-image: url(//../thumbnail.png)" class="gist thumbnail" href=".."&gt;
accepted answer of: http://stackoverflow.com/q/24918773
score: 1
has comment: http://stackoverflow.com/comment/38718970
answers question: http://stackoverflow.com/q/24918773
upvote count: 1

http://stackoverflow.com/comment/38768609
comment on: http://stackoverflow.com/q/24945381
score: 0
type: Comment
type: QuestionComment
has text: Hogan's right, I don't have it setup as an input or in a form, so I guess that might be the problem. It's just a simple tag, and I added #submit_button as an ID. Though I tried using .click, and that didn't work either. But I'll try changing it to an input tag and get back to you.

http://stackoverflow.com/comment/38986755
type: Comment
has text: My bad, you should then submit the form in the success case of the Ajax. (ex: $(formname).submit();)
comment on: http://stackoverflow.com/a/25061587
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38938849
type: AnswerComment
comment on: http://stackoverflow.com/a/25035589
type: Comment
has text: This brings out another question, is there any performance difference between the two approaches? @Utkanos
score: 0

http://stackoverflow.com/comment/38755228
has text: Just to test if your datauri syntax is right. Anyways. I will try to write an example php script as soon as I get home. I'm gonna edit my post to reflect changes.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24938118
score: 0

http://stackoverflow.com/comment/38966371
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25050891
type: Comment
has text: function `Hello()` can take a `int` parameter say `callcount`. if it's more than 1 .. return undef;

http://stackoverflow.com/comment/38831971
score: 0
comment on: http://stackoverflow.com/q/24979513
type: Comment
type: QuestionComment
has text: @T.J.Crowder I edited your second example to 18.4 / 0.1. Because that should be divisible, but because of not precise representation of 0.1 does not result in integer number.

http://stackoverflow.com/comment/101977993
score: 0
comment on: http://stackoverflow.com/q/24941284
type: Comment
type: QuestionComment
has text: Agreed. Sometimes 3rd party servers don't set the headers properly and we need to see the response in order to provide a useful bug report. I see the CORS requests in the inspector in red as well, but without the response information filled in (no headers, no preview). It looks like the devtools JS is just as restricted by browser policy as regular JS (which is probably a good thing). The best way I've found is to right-click, `Copy, as Curl`, paste into a terminal (adding the `-v` option), and re-executing the request there.

http://stackoverflow.com/q/25040898
has body: I have text: https://youtu.be/iOA7NUI\-9Xhwvideo\-one\- I need to replace \- to - with JS, so i get: https://youtu.be/iOA7NUI-9Xhwvideo-one-
favorite count: 0
score: -1
type: Question
linked to: http://stackoverflow.com/q/5519368
has answer: http://stackoverflow.com/a/25041008
tagged with: regex
downvote count: 6
duplicate of: http://stackoverflow.com/q/5519368
has answer: http://stackoverflow.com/a/25040946
answer count: 3
has comment: http://stackoverflow.com/comment/38983648
has answer: http://stackoverflow.com/a/25040966
upvote count: 5
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: How can I replace "\-" to "- " in the url with JS?

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

http://stackoverflow.com/q/25032058
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38930755
has comment: http://stackoverflow.com/comment/38930823
has comment: http://stackoverflow.com/comment/38931881
has comment: http://stackoverflow.com/comment/38930781
has comment: http://stackoverflow.com/comment/38930642
has comment: http://stackoverflow.com/comment/38930938
has answer: http://stackoverflow.com/a/25032341
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38931028
downvote count: 0
has comment: http://stackoverflow.com/comment/38930651
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25032341
has body: This is the JSON stored in my chrome local storage {"users":[ {"password":"123","userName":"alex"}, {"password":"234","userName":"dena"}, {"password":"343","userName":"jovit"} ]} Is it possible to remove a specific item in "users" ? I tried to this code but no luck chrome.storage.local.remove('users[0]', function(){ alert('Item deleted!'); });
favorite count: 0
tagged with: google-chrome-app
upvote count: 8
tagged with: google-chrome-extension
has title: chrome.storage remove specific item from an array
possible better answer: http://stackoverflow.com/a/70935266
has answer: http://stackoverflow.com/a/70935266
score: 8
has comment: http://stackoverflow.com/comment/38930814
tagged with: google-chrome
linked to: http://stackoverflow.com/q/17927378
has comment: http://stackoverflow.com/comment/38931071

http://stackoverflow.com/comment/38767758
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24945058
score: 1
has text: @RobertC.Barth: I have read your question. But you probably didn't read this line in my answer: `And use matched group #1 for your match.` In the demo link I provided look at bottom-right section for your matches.

http://stackoverflow.com/a/24967637
answers question: http://stackoverflow.com/q/24966557
has comment: http://stackoverflow.com/comment/38913006
has comment: http://stackoverflow.com/comment/38921280
has comment: http://stackoverflow.com/comment/38913495
upvote count: 1
type: AcceptedAnswer
downvote count: 0
has body: Replace Template.leaderboard.events with this: Template.player.events({ click: function() { // only continue if this was not the last player clicked if (!this.isLast) { // find the last player clicked var lastPlayerClicked = Players.findOne({isLast: true}); // remove the isLast marker from the previously clicked player and // decrement her score if (lastPlayerClicked) { var modifier = {$inc: {score: -5}, $unset: {isLast: ''}} Players.update(lastPlayerClicked._id, modifier); } // update this player with a new score and mark her as last Players.update(this._id, {$inc: {score: 5}, $set: {isLast: true}}); } } }); It keeps track of the last clicked player by setting or removing isLast and then modifies the current and last player as appropriate. You may want to make sure you have a clean database by running meteor reset prior to adding this.
has comment: http://stackoverflow.com/comment/38919895
type: Answer
accepted answer of: http://stackoverflow.com/q/24966557
score: 1

http://stackoverflow.com/q/25057309
has comment: http://stackoverflow.com/comment/38977950
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38978211
answer count: 0
upvote count: 1
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has body: I am trying to show div with some contents when user tries to close the window. I have done the following JavaScript code to do so: function closeWindow(){ if(submitted == false) { $("#confirmation").show(); return 0; } } window.onbeforeunload = closeWindow(); Whenever I close window, alert is appearing for confirmation. I don't want to show that confirmation message instead show div with id confirmation. Is there any way to prevent that confirmation alert ?
has title: window.onbeforeunload javascript function
favorite count: 0
has comment: http://stackoverflow.com/comment/38977949

http://stackoverflow.com/comment/38919265
has text: I'm writing an answer
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25025426
score: 0

http://stackoverflow.com/q/24963474
has answer: http://stackoverflow.com/a/52021777
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24963734
has body: My website is http://southsideonline.com/ I just have an easy sticky.js that fixes the navbar on scroll, but the content below the nav jumps up below the nav bar. Any idea how to fix this? jQuery(function(){ var menuOffset = jQuery('.menu-wrapper')[0].offsetTop; jQuery(document).bind('ready scroll',function() { var docScroll = jQuery(document).scrollTop(); if(docScroll &gt;= menuOffset) { jQuery('.menu-wrapper').addClass('fixed'); } else { jQuery('.menu-wrapper').removeClass('fixed').removeAttr("width"); } }); }); seems like its suppose to be an easy fix. I tried using jQuery .next() to put the margin-top of the next .css after the nav to fit just under the nav like it should. any other bright ideas?
favorite count: 0
has title: Why does sticky nav jump when fixed?
tagged with: sticky
has comment: http://stackoverflow.com/comment/38802820
possible better answer: http://stackoverflow.com/a/24963634
has comment: http://stackoverflow.com/comment/38802006
answer count: 4
has answer: http://stackoverflow.com/a/24963634
type: AnsweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24963734
score: 1
has answer: http://stackoverflow.com/a/24963671
has comment: http://stackoverflow.com/comment/38802324
tagged with: navigation

http://stackoverflow.com/a/24980095
has comment: http://stackoverflow.com/comment/38832801
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24980075
has comment: http://stackoverflow.com/comment/38833049
type: Answer
has comment: http://stackoverflow.com/comment/38832835
upvote count: 19
score: 19
has body: Slice does not work "in place" but returns the value: var text = "Hello World"; console.log(text.slice(0,2)); // He console.log(text); // Hello World (unchanged!) You need to assign it to the variable like this: text = text.slice(0,2); Also, from your question, it sounds as if you're trying to remove the first two letters. That would be var text = "Hello World"; text = text.slice(2); // will be "llo World"
accepted answer of: http://stackoverflow.com/q/24980075

http://stackoverflow.com/comment/38972733
has text: @JonathanCrowe The markers finally works!! Can you explain to me why there is 2 var latlng? When calling the .json file, it always fail without showing the errors..
comment on: http://stackoverflow.com/q/25052145
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24948005
answers question: http://stackoverflow.com/q/24947935
score: -2
has comment: http://stackoverflow.com/comment/38773937
has comment: http://stackoverflow.com/comment/38792734
has comment: http://stackoverflow.com/comment/38933827
type: Answer
has body: Have JQuery function to get width and height of the end-user screen. var jQueryWidth = $( window ).width(); var jQueryHeight = $( window ).height(); Once you have this, set your HTML image width and height attributes. &lt;img src="yourImage.jpg" alt="Alternate text" height="&lt;jQueryWidth&gt;" width="&lt;jQueryHeight&gt;"&gt;
has comment: http://stackoverflow.com/comment/38773005
downvote count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38774022

http://stackoverflow.com/comment/38856579
type: QuestionComment
has text: Replace `attr` with `prop`
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24992773

http://stackoverflow.com/a/25027341
accepted answer of: http://stackoverflow.com/q/25027278
score: 2
has body: Here you go, working with your latest code: http://liveweave.com/mvxPkl I added class="font" to the font tags and check that e.target does not have class "font" $(".toolbox").on('mousedown touchstart', function(e) { if (!$(e.target).hasClass('font')){ $(this).children().not($("input[type=text]")).hide(); } });
upvote count: 2
answers question: http://stackoverflow.com/q/25027278
has comment: http://stackoverflow.com/comment/38922269
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/a/24937541
has comment: http://stackoverflow.com/comment/38753035
downvote count: 2
answers question: http://stackoverflow.com/q/24935840
score: -2
type: Answer
upvote count: 0
has body: You need to use a select element, try this: &lt;form&gt; ... &lt;select id="someSelect"&gt; //options &lt;/select&gt; &lt;input type="hidden" name="fromSelect" id="fromSelect" value=""/&gt; &lt;/form&gt; You have two options here: 1.- Get the value direct from select: var selected = $('#someSelect').val(); 2.- Assign the value to the hidden input and then get its value: $('#someSelect').on('change', function(){ $('#fromSelect').attr('value', this.value); }); var selected = $('#fromSelect').val();

http://stackoverflow.com/a/25029598
has body: I already found the answer, I just put this little script popupWindow = window.open('/test.htm', 'name', 'width=700,height=350'); popupWindow.focus();
accepted answer of: http://stackoverflow.com/q/24987938
answers question: http://stackoverflow.com/q/24987938
type: AcceptedAnswer
score: 0
type: Answer

http://stackoverflow.com/q/24916437
tagged with: http://stackoverflow.com/tag/html
tagged with: video
has answer: http://stackoverflow.com/a/25214489
accepted answer: http://stackoverflow.com/a/25229791
possible better answer: http://stackoverflow.com/a/25214489
has answer: http://stackoverflow.com/a/25238482
upvote count: 9
has answer: http://stackoverflow.com/a/25123617
has body: In Firefox when a video tag is wrapped in an a tag, using the standard video controls when clicking on the video to pause it also re-directs. How can I make it behave like the other browsers where for example clicking on pause only pauses the video and does NOT re-direct as well. This is what I need. Here is a simple demo: http://jsfiddle.net/me2loveit2/cSTGM/
tagged with: javascript
answer count: 5
tagged with: html5-video
type: AnsweredQuestion
tagged with: firefox
downvote count: 0
has answer: http://stackoverflow.com/a/25229791
favorite count: 0
has title: How to prevent event bubbling when clicking on HTML5 video controls in Firefox
has answer: http://stackoverflow.com/a/59318630
score: 9
type: Question

http://stackoverflow.com/comment/38754266
has text: What about checking the focus of the textbox? Not sure if the submit button will steal focus if it is clicked.
comment on: http://stackoverflow.com/q/24937815
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25035033
type: AnsweredQuestion
type: Question
tagged with: javascript
tagged with: extjs
score: 0
has answer: http://stackoverflow.com/a/25036725
answer count: 1
has title: Get global vars everywhere from Extjs MVC Application
has body: I'm learning ExtJs framework 4.2.2 MVC and i want to get a global var declared in Application.js: Ext.define('XApp.Application', { name: 'XApp', extend: 'Ext.app.Application', serverUrl: 'http://localhost:31109/', requires: [ 'XApp.util.Util', 'XApp.util.SessionMonitor' ], views: [ ], controllers: [ 'Login', 'Main', 'Mail' ] }); I want to get serverUrl from everywhere, because in future i want to change this url of server back-end. In "Application" extended class i found this var with XApp.app.serverUrl But from my store, this syntax does not work: Ext.define('XApp.store.Xusers', { extend: 'Ext.data.Store', requires: [ 'XApp.model.Xuser'], model: 'XApp.model.Xuser', proxy: { type: 'jsonp', url: XApp.app.serverUrl + 'Login/Loadusers', reader: { type: 'json', } }, }); Firebug tellme: TypeError: XApp.app is undefined Any ideas?
accepted answer: http://stackoverflow.com/a/25036725

http://stackoverflow.com/comment/38909806
type: AnswerComment
has text: Here I'm uploading images to server with java-script code and on success image upload I need to add file names to some variable (with comma separated or something), and finally with a Save button I need to save all the file names to database. So I need to update the `fileNames` field (in Model) each time a file is uploaded. Did I make it clear?? :)
comment on: http://stackoverflow.com/a/25018451
score: 0
type: Comment

http://stackoverflow.com/comment/38963831
comment on: http://stackoverflow.com/q/25049462
has text: Even if you're not posting all of your code (which you probably shouldn't), try cutting it down to a small, relevant subsection while still being able to reproduce the problem. http://jsfiddle.net is useful for making demos like that. As is we haven't seem your DOM or the logic for your event handler, both of which appear to be key parts of this problem.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38892424
score: 1
comment on: http://stackoverflow.com/a/25010542
has text: I have edited my answer and added the code for hiding the list if clicked outside. .blur() and .focusout() do only work with A, AREA, BUTTON, INPUT, LABEL, SELECT, TEXTAREA elements.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38996158
comment on: http://stackoverflow.com/q/25066651
type: Comment
type: QuestionComment
has text: Reproduce the error in jsFiddle please.
score: 1

http://stackoverflow.com/q/24957656
downvote count: 0
has body: Is it possible to change this code so that the balls rolled out. but: Indicate the number of balls (for example 10). Once rolled out one ball and stopped, then rolls out the next ball (and gets close to another). And that they rolling from the right side to the left side. html &lt;div id="balls"&gt; &lt;img src="http://i058.radikal.ru/1407/0d/33cc119c6686.png" id="ball" /&gt; &lt;/div&gt; css body { background: #383838; } #balls { position: absolute; } #balls img { position: absolute; } #ball { width: 90px; height: 90px; left: 170px; top: 45px; } jQuery var diameter = $('#ball').height(), perimeter = Math.PI * diameter; var goLeft; var times = 0; var to = [600, 600]; function moveBalls() { goLeft = !goLeft; times++; if (times &gt; to.length) { return false; } $('#balls').animate({ right: to[times] }, { duration: 2000, step: rotateBall, complete: moveBalls }); } moveBalls(); function rotateBall(distance) { var degree = distance * 360 / perimeter; $('#ball').css('transform', 'rotate(' + degree + 'deg)'); } Example Here
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/38790783
tagged with: javascript
tagged with: jquery
has title: Ball roll animation using jquery or CSS3
accepted answer: http://stackoverflow.com/a/24958911
has comment: http://stackoverflow.com/comment/38790506
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38790619
favorite count: 0
has answer: http://stackoverflow.com/a/24958911
has comment: http://stackoverflow.com/comment/38790618
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38790711
has comment: http://stackoverflow.com/comment/38792842

http://stackoverflow.com/comment/38928536
comment on: http://stackoverflow.com/q/25030863
type: QuestionComment
type: Comment
has text: Give us more code please. Do you have a form, where is the submit-button ....
score: 0

http://stackoverflow.com/a/24988702
downvote count: 2
answers question: http://stackoverflow.com/q/24988672
upvote count: 4
has body: But what if I want to dynamically replace all the tags with <\/script>... In a comment below, you've said: I'm getting the var XXX from an input that always changes.. I just added a defined value (var XXX=' ...) in my question just for example That's a very different thing than what's in your question. If you're saying that you'll receive input in the XXX string whose content (in memory, not a string literal) looks like this: ...then than input is perfectly fine and can be used as-is to set the content of the iframe. You don't have to do the replacement on it. The post you linked to doesn't relate to what you're doing. But if you're saying you'll get input like this: "; // <====== }); ...then you're in the same unfortunate position as the HTML parser: You don't know when the substring actually ends a script element, or is text within a JavaScript string literal (or a comment). If you had a web page with that content, the HTML parser would conclude the script element ended immediately after The problem is here:. And indeed, if you output that content to an iframe via document.write, the parser will choke on it. The line: var str = "The problem is here: "; needs to be var str = "The problem is here: <\/script>"; // or var str = "The problem is here: </sc" + "ript>"; // or similar ...in order to avoid tripping up the HTML parser. (It would be fine in a .js file, but that's not your use case.) Fundamentally, if you're receiving input with something like that in it, the person giving it to you is giving you invalid input. The substring cannot appear in JavaScript code within tags — not in a string literal, not in a comment, nowhere. The answer defined by the spec is: Don't try to figure it out, require that it be correct. But if you know the scripts are JavaScript, and you really really want to allow invalid input and correct it, you'll need a JavaScript parser. That sounds outrageous, but Esprima is exactly that, there's jsparser in the Meteor stuff, and there may be ot…
has comment: http://stackoverflow.com/comment/38850602
type: Answer
score: 2

http://stackoverflow.com/comment/38952607
score: 0
type: AnswerComment
type: Comment
has text: additionally, another question: it seems that, according to your answer, anything labeled with $scope is accessible by the node server. So for instance, $scope.formData would automatically become available in the server.js file. Is this correct? or does something additional have to be done to pass formData to the server (besides including it in the $http post request)?
comment on: http://stackoverflow.com/a/25025915

http://stackoverflow.com/comment/38721247
score: 0
has text: Okay, well if you want your site to be usable by anyone not using the latest version of FF, I'd recommend using more traditional methods of specifying default values. See the browser compatibility chart [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/default_parameters)
comment on: http://stackoverflow.com/q/24920318
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25021964
downvote count: 0
answers question: http://stackoverflow.com/q/25009295
type: Answer
has comment: http://stackoverflow.com/comment/38927278
has comment: http://stackoverflow.com/comment/38966743
upvote count: 6
has comment: http://stackoverflow.com/comment/38935426
score: 6
has body: Looks like this question is very old.. but if someone is still looking for solution then this might help. in this code i am using blob to create the csv file. function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) { //If JSONData is not an object then JSON.parse will parse the JSON string in an Object var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; var CSV = ''; //This condition will generate the Label/Header if (ShowLabel) { var row = ""; //This loop will extract the label from 1st index of on array for (var index in arrData[0]) { //Now convert each value to string and comma-seprated row += index + ','; } row = row.slice(0, -1); //append Label row with line break CSV += row + '\r\n'; } //1st loop is to extract each row for (var i = 0; i &lt; arrData.length; i++) { var row = ""; //2nd loop will extract each column and convert it in string comma-seprated for (var index in arrData[i]) { row += '"' + arrData[i][index] + '",'; } row.slice(0, row.length - 1); //add a line break after each row CSV += row + '\r\n'; } if (CSV == '') { alert("Invalid data"); return; } //this trick will generate a temp "a" tag var link = document.createElement("a"); link.id="lnkDwnldLnk"; //this part will append the anchor tag and remove it after automatic click document.body.appendChild(link); var csv = CSV; blob = new Blob([csv], { type: 'text/csv' }); var csvUrl = window.webkitURL.createObjectURL(blob); var filename = 'UserExport.csv'; $("#lnkDwnldLnk") .attr({ 'download': filename, 'href': csvUrl }); $('#lnkDwnldLnk')[0].click(); document.body.removeChild(link); }
has comment: http://stackoverflow.com/comment/38934423
has comment: http://stackoverflow.com/comment/38966809
has comment: http://stackoverflow.com/comment/38966323
has comment: http://stackoverflow.com/comment/38934221

http://stackoverflow.com/comment/38917123
type: Comment
has text: @ಠ_ಠ Actually your code does work on this codepen http://codepen.io/MARS/pen/cGwbC?editors=001 now i have to figure out why it doesn't work on my code, I'm wondering if it has to do with script order. The site is huge and i'm only working on a certain piece of it. Any tips for debugging? Thanks.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24964434

http://stackoverflow.com/comment/43548000
type: AnswerComment
has text: this is the only way to do that.. Thank u so much for ur reply..:)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24989873

http://stackoverflow.com/a/25050993
score: 0
has body: Depending on what you want to do with the data returned by the php page, you should parse it into a DOM element so it will be accessible with JavaScript: xhr.onreadystatechange = function(){ if(xhr.readyState == xhr.DONE &amp;&amp; xhr.status == 200){ var parser = new DOMparser(), doc = parser.parse(xhr.responseText, 'text/html'); // do something with doc, like: var list = doc.getElementById('list'); document.getElementById('some-id').innerHTML = list; } }
type: Answer
answers question: http://stackoverflow.com/q/25050908

http://stackoverflow.com/comment/38938475
type: Comment
type: QuestionComment
has text: After some investigation – https://code.google.com/p/chromium/issues/detail?id=52408 there is bug in Chrome – „initKeyboardEvent fires successfully but doesn't do anything.”
comment on: http://stackoverflow.com/q/25032300
score: 0

http://stackoverflow.com/comment/38872829
has text: Thanks a lot, I am chekcking it right now. Happy to know that I am not the first to tackle this issue
comment on: http://stackoverflow.com/a/25001244
score: 0
type: AnswerComment
type: Comment

mean-stack
tags question: http://stackoverflow.com/q/25030195
tags question: http://stackoverflow.com/q/25038267
tags question: http://stackoverflow.com/q/24974128
tags question: http://stackoverflow.com/q/25061390
tags question: http://stackoverflow.com/q/25001407
tags question: http://stackoverflow.com/q/25064669
tags question: http://stackoverflow.com/q/24941297
type: Tag
tag name: mean-stack

http://stackoverflow.com/a/25050822
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38967079
has body: http://api.prototypejs.org/language/Enumerable/prototype/each/ To access the element, you don't need change the context (this) of the iterator function. The iterator function receives the item as the first argument. You just need to name the argument. $$('.example').each(function(div) { if(div.hasClassName('active')) { div.previous().setStyle({border:'1px solid #999'}) } }); Also, you can remove the conditional by updating the CSS selector passed into $$: $$('.example.active').each(function(activeDiv) { activeDiv.previous().setStyle({border:'1px solid #999'}) }); If you are interested in controlling the value of this inside of a function, check out call, apply, and bind.
type: Answer
upvote count: 4
score: 4
accepted answer of: http://stackoverflow.com/q/25050714
answers question: http://stackoverflow.com/q/25050714

http://stackoverflow.com/a/24942601
downvote count: 0
has comment: http://stackoverflow.com/comment/38763055
answers question: http://stackoverflow.com/q/24942557
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38763023

http://stackoverflow.com/comment/38788901
has text: @markspace Sanitized means I'm passing it to the Markdown.getSanitizingConverter() instance, which simply removes any html tags not on the whitelist. It's more complicated than that though, as it does **not** strip html tags that are inside a code block, which is what I need. This makes it difficult to use a Java solution, as they all seem to be all-or-nothing instead of the selective sanitation that respects the code blocks.
comment on: http://stackoverflow.com/q/24946092
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38783563
has text: my code is can work already for data from the one column to search but what i asked above is i want search with data from multi column result to search
comment on: http://stackoverflow.com/a/24953602
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25033183
type: Question
has body: I am currently playing around with different implementations of pagination in my application. I would very much like to use ng-table and the build in pagination but it seems to struggle horribly when handling several thousand records. And yes, that is a lot of records, but I am able to built a different pagination that easily handles several hundred thousand and doing so much much much faster then ng-table. The situation is I have two implementations listed below. The first one is ng-table and the other one is the mystically better implementation. I have tried to limit both of these implementations to the absolute minimum required code in hope of getting the best possible answer, I hope this is enough My Question: How do I best implement the ng-table pagination, like the implementation below, for best possible performance. And/or how can I change the ng-table to cope with its performance issue handling a lot of records with filtering/pagination? Ngtable implementation (the struggler) Nothing out of the ordinary implementation wise. http://plnkr.co/edit/ISa4xg?p=info Controller $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())); } }); Table {{user.name}} {{user.age}} The hard implementation http://jsfiddle.net/2ZzZB/56/ Controller $scope.currentPage = 0; $scope.pageSize = 10; $scope.data = []; $scope.numberOfPages=function(){ return Math.ceil($scope.data.length/$scope.pageSize); } for (var i=0; i<45; i++) { $scope.data.push("Item "+i); } HTML {{item}} Previous {{currentPage+1}}/{{numberOfPages()}} = data.length/pageSize - 1" ng-click="currentPage=currentPage+1"> Next
has title: built in ng-table pagination struggle with performance vs. other solutions
tagged with: pagination
tagged with: javascript
has comment: http://stackoverflow.com/comment/38936296
accepted answer: http://stackoverflow.com/a/25035358
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25035358
type: AnsweredQuestion
score: 1
upvote count: 1

http://stackoverflow.com/a/24941598
has comment: http://stackoverflow.com/comment/38761187
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38761336
has comment: http://stackoverflow.com/comment/38762016
accepted answer of: http://stackoverflow.com/q/24941285
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38761889
answers question: http://stackoverflow.com/q/24941285
has body: Browsers throttle timers when the webpage moves to the background tab. The browser doesn't throttle timers in the background specifically. Each browser has an event loop that process' jobs in a queue. When an event completes, it pulls the next item from the queue and process' it (this differs across browsers). The event loop is throttled when the browser enters the background or a tab is not active. Every browser, again, implements this differently and will throttle / dethrottle differently. As for javascript timers, they are also processed in the event loop, as is the resulting callback. This actually means that timers in javascript are never 100% accurate. If you set a timeout for 5000 milliseconds, it is highly likely that by the time the event loop gets round to processing the timeout/interval there will have been a few milliseconds delay, also when the callback function is queued the delay will add up to however long it takes the event loop to process it. Your 5000ms is more likely to have a few ms added to it in real time. Wouldn't this require the browser to keep track of all the timers for a particular tab? Yes, it would, however the execution is only as fast as the event loop will allow for jobs to be processed. Or, perhaps, is the browser able to throttle the activity of an entire tab without regards to any individual timer? No, the timers are subject to the event loop as much as any other code. To sum up... If the event loop is throttled it won't get through the queue as fast, therefore anything in the loop will complete slower than usual, including timers. Developers often keep track of timer ids for various reasons. Isn't this redundant in some cases? Hypothetically, couldn't the developer just invoke a function that tells the browser "when you reach a timer in the event loop, do something special" Yes it could be redundant in some cases, I often reference my timeouts or return them from functions but never do anything with the reference, at least its t…

http://stackoverflow.com/q/25045745
tagged with: ajax
has body: This is the first time I do the ajax and I must confess that I am confused. What I want to do is to take the value of 3 Select html to make a request to my database that'll get me a score according to the desired choice. The purpose of using ajax is that I do not want the submit button and I want that when the value of one of my select changes only choose my result in my database changes according to the new value. So the hen I change a value in my select I call a javascript that takes values ​​from my select and pass ajax to my function.php which then makes a request with the values ​​of my Selects function and then returns the result of my request. Sorry for my English, this language is not my first language. Now my code look like that: javascript: function showWidth($) { // get the value of my 3 html select var width1 = document.getElementById('width1').value; var width2 = document.getElementById('width2').value; var width3 = document.getElementById('width3').value; if (width1!="aucun" &amp;&amp; width2!="aucun" &amp;&amp; width3!="aucun") { $.ajax({ ObjectName.ajaxurl, data: { action:'script_handle', width01 : width1, width02 : width2, width03 : width3 }, success:function(data) { // This outputs the result of the ajax request document.getElementById("result").innerHTML=console.log(data); }, error: function(errorThrown){ console.log(errorThrown); } }); } } PHP (in function.php): function widthcalculate(){ if( isset($_REQUEST) ) { $width1 = $_REQUEST['width01']; $width2 = $_REQUEST['width02']; $width3 = $_REQUEST['width03']; // Let's take the data that was sent and do something with it global $wpdb; $where = "'".$width1."' AND camber = '".$width2."' AND handrim = '".$width3."'"; $sql = $wpdb-&gt;get_results( "SELECT result FROM mc_widthCalculatorResult WHERE wheel = ".$where."" ); foreach ($sql as $element) { echo $element-&gt;result; } echo $result; //print_r($_REQUEST); } die(); } add_action( 'wp_ajax_script_handle', 'widthcalculate' ); // Hook for the WordPress…
tagged with: php
has answer: http://stackoverflow.com/a/25047993
has comment: http://stackoverflow.com/comment/38960863
type: UnansweredQuestion
tagged with: wordpress
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25046198
answer count: 3
has answer: http://stackoverflow.com/a/25060447
tagged with: jquery
has title: wordpress ajax php function dont execute

http://stackoverflow.com/comment/38750741
comment on: http://stackoverflow.com/q/24919452
has text: I agree, but I'm porting to Backbone, and Backbone internally calls these method types - GET,POST,PUT, and DELETE and if you pass the option in it will use PATCH. I'm OK with using only POST and believe it is the most secure, I just need to find a way re-write `Backbone.sync` to work only with POST.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25043067
tagged with: asynchronous
tagged with: gulp
tagged with: build-process
favorite count: 0
has comment: http://stackoverflow.com/comment/38952225
type: Question
has comment: http://stackoverflow.com/comment/48859429
has answer: http://stackoverflow.com/a/25043469
upvote count: 3
answer count: 2
has comment: http://stackoverflow.com/comment/48897765
downvote count: 1
has comment: http://stackoverflow.com/comment/38952226
has comment: http://stackoverflow.com/comment/48898712
has comment: http://stackoverflow.com/comment/38952247
linked to: http://stackoverflow.com/q/22824546
has comment: http://stackoverflow.com/comment/38952509
linked to: http://stackoverflow.com/q/24342030
tagged with: javascript
type: UnansweredQuestion
has title: Gulp: Cannot get tasks to run synchronously
score: 2
has body: I have a clean task that I want to finish before running my build tasks. No matter what I tried, I cannot get it to work properly: clean starts, build tasks starts, clean finishes (and throw an error because some folder is being written to) while build tasks are still running. Here's some of my task definitions: gulp.task('default', ['clean', 'build']); gulp.task('js', ['phnxjs', 'vendorsjs']); gulp.task('css', ['phnxcss', 'vendorscss']); gulp.task('assets', ['fonts', 'images', 'templates']); gulp.task('build', ['js', 'css', 'assets', 'login']); gulp.task('index', ['build'], index); &lt;-- index is a function defined elsewhere gulp.task('clean', function() { return gulp.src('**/*', targetOptions) .pipe(filters.excludeWebInf) .pipe(g.rimraf()); }); ALL my tasks returns a stream I also tried calling the callback function from the clean task instead of returning a stream, to no avail. I even gave run-sequence a try, like so: gulp.task('default', function() { run('clean', 'build', 'index'); }); It seems to yields better results but looks like it's missing a step as index isn't executed edit: Tried tons of "task dependency" combinations, amongst which I tried to have task('build', ['clean', 'js' ...] Still won't work with that scenario: [13:46:32] Starting 'clean'... [13:46:32] Starting 'phnxjs'... &lt;-------- Clean not finished, other tasks started [13:46:33] Starting 'vendorsjs'... [13:46:33] Starting 'phnxcss'... [13:46:33] Starting 'vendorscss'... [13:46:33] Starting 'fonts'... [13:46:33] Starting 'images'... [13:46:33] Starting 'templates'... [13:46:33] Starting 'login'... [13:46:33] Starting 'index'... [13:46:34] Finished 'vendorscss' after 1.2 s [13:46:34] Finished 'login' after 1.1 s [13:46:34] Finished 'index' after 1.09 s [13:46:35] Finished 'fonts' after 2.7 s [13:46:35] Finished 'images' after 2.7 s [13:46:35] 'clean' errored after 3.1 s &lt;--------- Clean Error [13:46:35] Error in plugin 'gulp-rimraf' ENOTEMPTY, rmdir '/Users/oclement/Documents/phoenix/Med…
has answer: http://stackoverflow.com/a/44169441

http://stackoverflow.com/q/25058823
answer count: 1
has answer: http://stackoverflow.com/a/25058976
tagged with: angularjs
type: UnansweredQuestion
has title: How to access particular value after angularjs's form submitted
type: Question
tagged with: javascript
has body: My form start like that : URL and the attached js controller start like this : $scope.form = {}; $scope.form.submit = function() { console.log($scope.form); var url = $scope.form[url]; console.log("Url is " + url); } the url var is undefined in the console, what is the good way ?
score: 0

http://stackoverflow.com/a/24920943
has body: You can create an associative array like that: $newarr = array(); foreach($arr as $key=&gt;$value){ $newarr["embedCode$key"] = $value; }
answers question: http://stackoverflow.com/q/24920905
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24920905
upvote count: 2
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38722257

http://stackoverflow.com/comment/38844298
has text: Thank you for this explanation. The jQuery UI Dialog looks nice though. I'll take a look on this.
type: AnswerComment
comment on: http://stackoverflow.com/a/24986086
score: 0
type: Comment

http://stackoverflow.com/comment/88708643
type: AnswerComment
has text: Link is broken.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/49680586

http://stackoverflow.com/comment/38999147
score: 0
type: Comment
type: QuestionComment
has text: @PatrickQ I figured that'd be the case so I've included a image. http://i.imgur.com/u6FXJYK.png
comment on: http://stackoverflow.com/q/25068093

http://stackoverflow.com/q/25033863
tagged with: jquery
has answer: http://stackoverflow.com/a/25033972
tagged with: regex
has comment: http://stackoverflow.com/comment/38933841
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25033972
tagged with: javascript
has title: Regular expression for wrap a group of no-break spaces
score: 0
answer count: 2
has body: I need to do that with Jquery + Regular Expression: For instance: HELLO WORLD&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HELLO WORLD2&amp;nbsp;&amp;nbsp;HELLO WORLD3&amp;nbsp; final result HELLO WORLD&lt;span class='test'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt; HELLO WORLD2&lt;span class='test'&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt; HELLO WORLD3&lt;span class='test'&gt;&amp;nbsp;&lt;/span&gt; I have two doubts: 1.- If the number of no-break spaces is always random, exist a way for wrap this groups with regular expressions? 2.- Only with Jquery or javascript is possible insert in the inital and final position of this group?
has answer: http://stackoverflow.com/a/25034078
accepted answer: http://stackoverflow.com/a/25034078

http://stackoverflow.com/q/25043909
has comment: http://stackoverflow.com/comment/38953381
has comment: http://stackoverflow.com/comment/38954411
has comment: http://stackoverflow.com/comment/38953562
has comment: http://stackoverflow.com/comment/38953188
answer count: 1
has body: I'm using jQuery to handle Ajax-calls. I've noticed that, about 5% off the time, the ajax call fails. To make sure I get a good understanding of what's going wrong, I use this code: $.ajax({ type:'POST', url:'somepage.php', data:{somedata:somedata}, success:function (data) { var IS_JSON = true; try { var newdata = jQuery.parseJSON(data); } catch(err) { IS_JSON = false; } if(IS_JSON) { //this is the part where a correct response is handled } else { //In case somepage.php gives a php-error, I put the exact error (=data) in the error-table at error.php. window.location = "error.php?errorstring="+data; } }, error:function (XMLHttpRequest, textStatus, errorThrown) { //In case the ajax errors, I store the response (timeout, error, ...) in the database at error.php window.location = "error.php?errorstring="+textStatus; } }); "Good" responses contain JSON, which I parse. If it's not JSON (for example just raw text from an php error) I don't try to parse it, but store the error in my database. I would understand errors containing php errors that occured on somepage.php (since it's quiet a large page), but I'm supprised that the main errors I get, are errors of the ajax failing. The response data is just "error". Anyone knows what the cause could be? What causes ajax-calls to fail? It's not a timeout, and it's also nothing like that somepage.php wasn't found or something. It's also not an error on somepage.php, since in that case, the Ajax-call would be successful, and the php-error would be logged in my database. Edit: I used this obfuscator to make the script a little harder to read... Don't know if this could be causing the errors...
has answer: http://stackoverflow.com/a/25050686
has comment: http://stackoverflow.com/comment/38954672
favorite count: 0
has comment: http://stackoverflow.com/comment/38953620
upvote count: 2
type: UnansweredQuestion
has title: Ajax fails 5% of time, response is "error"
has comment: http://stackoverflow.com/comment/38954335
tagged with: php
has comment: http://stackoverflow.com/comment/38953271
score: 2
has comment: http://stackoverflow.com/comment/38955324
has comment: http://stackoverflow.com/comment/38953876
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38953654
has comment: http://stackoverflow.com/comment/38953603
has comment: http://stackoverflow.com/comment/38955620
has comment: http://stackoverflow.com/comment/38979362
has comment: http://stackoverflow.com/comment/38953474
type: Question
has comment: http://stackoverflow.com/comment/38953158
has comment: http://stackoverflow.com/comment/38953536
has comment: http://stackoverflow.com/comment/38953433
has comment: http://stackoverflow.com/comment/38953213
downvote count: 0
has comment: http://stackoverflow.com/comment/38955170
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38954848
has comment: http://stackoverflow.com/comment/38953484
has comment: http://stackoverflow.com/comment/38953386
tagged with: ajax

http://stackoverflow.com/q/24909959
type: UnansweredQuestion
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24910109
has answer: http://stackoverflow.com/a/24910094
has answer: http://stackoverflow.com/a/24910102
has answer: http://stackoverflow.com/a/24910052
has answer: http://stackoverflow.com/a/24910072
tagged with: javascript
tagged with: jquery
has title: Remove Attribute From Input Checkbox in another div
favorite count: 0
answer count: 5
has comment: http://stackoverflow.com/comment/38700422
score: 2
has body: Is it possible to remove the input type checkbox checked attribute on click of id="chk1" checkbox. testing1 str1 str2 testing2 lblstr1 lblstr2 Is there any reference for this/ Thanks, ShailShin
upvote count: 3

http://stackoverflow.com/comment/38819644
type: Comment
score: 0
has text: error: function (a,b,c) {alert([a." ".b." ".c." "])}, - Add this code. after data:{ID: jsID },
type: AnswerComment
comment on: http://stackoverflow.com/a/24965958

angularjs-scope
tags question: http://stackoverflow.com/q/25004122
tags question: http://stackoverflow.com/q/24933076
tags question: http://stackoverflow.com/q/25043534
tags question: http://stackoverflow.com/q/25004420
tags question: http://stackoverflow.com/q/24918345
tags question: http://stackoverflow.com/q/25001482
tags question: http://stackoverflow.com/q/25006078
tags question: http://stackoverflow.com/q/24975582
tags question: http://stackoverflow.com/q/25013763
tags question: http://stackoverflow.com/q/25010748
tags question: http://stackoverflow.com/q/25033647
tags question: http://stackoverflow.com/q/24950958
tags question: http://stackoverflow.com/q/25009660
tags question: http://stackoverflow.com/q/24936858
tag name: angularjs-scope
tags question: http://stackoverflow.com/q/24926827
tags question: http://stackoverflow.com/q/24989327
tags question: http://stackoverflow.com/q/24994533
tags question: http://stackoverflow.com/q/24923904
tags question: http://stackoverflow.com/q/24963123
tags question: http://stackoverflow.com/q/24979576
tags question: http://stackoverflow.com/q/25067898
tags question: http://stackoverflow.com/q/25053819
tags question: http://stackoverflow.com/q/24916788
tags question: http://stackoverflow.com/q/25062394
tags question: http://stackoverflow.com/q/24936391
tags question: http://stackoverflow.com/q/24968084
type: Tag

http://stackoverflow.com/a/25039501
type: Answer
has comment: http://stackoverflow.com/comment/38947188
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/38944933
has body: The syntax is fine. It should work. You might also want to try onclick="javascript:window.print();" and see if that works. Another option you can try then is to create a function inside a script tag and call it from your onclick event: &lt;input type="button" value="Print this page" onclick="PrintMe()" /&gt; &lt;script&gt; function PrintMe(){ window.print(); } &lt;/script&gt;
score: 1
has comment: http://stackoverflow.com/comment/38945619
has comment: http://stackoverflow.com/comment/38945053
answers question: http://stackoverflow.com/q/25039381
has comment: http://stackoverflow.com/comment/38971968
accepted answer of: http://stackoverflow.com/q/25039381
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38944786

serialization
tags question: http://stackoverflow.com/q/24910432
tag name: serialization
tags question: http://stackoverflow.com/q/25036418
tags question: http://stackoverflow.com/q/24916273
type: Tag

http://stackoverflow.com/comment/38800950
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24962934
has text: I do not see a gallery link. Also when you say hide do you mean slide it up like how it is prior to opening it? Or do you actually want the entire nav bar to disappear?

http://stackoverflow.com/q/25008841
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25009553
tagged with: http://stackoverflow.com/tag/xml
has body: I am using Struts 1.x and jsp as view to display. Want to display the entire xml file as it is in a new pop-up window when a link is clicked in jsp. So far I have managed to open the pop-up window but I get a blank window and save/open/cancel links in browser(IE9). When clicking on save I get as 'url.do' but I just want to display the xml content as it is in browser, just don't want to save. Here is what I wrote in javascript function function viewXML(bcFileNo){ popupwin = window.open("about:blank", "popupwin", "toolbar=no, resizable=yes, menubar=no, scrollbars=yes, status=no, location=no, width=900 , height=400"); var form = document.forms['BirthCertificateForm']; form.action = "/Vista-Web/birthCertificateOverview.do?method=viewBirthCertificateDetails&amp;bCertFileNo="+bcFileNo; form.target = "popupwin"; form.submit(); form.target = "_self"; } Here is what I wrote in Action class String xmlContent = getXMLContent(); byte[] birthCertBytes = xmlContent.getBytes(); // set xml content response.setContentType("html/xml"); // write the content to the output stream BufferedOutputStream outStream = new BufferedOutputStream(response.getOutputStream()); outStream.write(birthCertBytes); outStream.flush(); outStream.close();
score: 0
tagged with: java
type: Question
linked to: http://stackoverflow.com/q/5278975
tagged with: javascript
has answer: http://stackoverflow.com/a/25018421
tagged with: struts
has title: display raw xml in popup window using java when a link is clicked
answer count: 3
tagged with: jsp
has answer: http://stackoverflow.com/a/25009249

http://stackoverflow.com/a/24965795
accepted answer of: http://stackoverflow.com/q/24965656
upvote count: 4
has body: First step, add this config.action_mailer.perform_deliveries = true to config/environments/development.rb With that you can send emails in development mode. Second step rails 4 use strong parameters, this means that you need to whilelist your parameters so in your controller add the following method: def contacts_params params.require(:contact).permit(:name, :email, :message) end then change this line @contact = Contact.new(params[:contact]) with @contact = Contact.new(contacts_params) Please do a try with these changes. Edit: In your routes you are calling to 'contacts#new' instead of 'contacts#create' so your code is not reached. Also if you do not need remote: true since you are handling the submit stuff manually
answers question: http://stackoverflow.com/q/24965656
downvote count: 0
has comment: http://stackoverflow.com/comment/38806818
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38806740
score: 4
type: Answer

http://stackoverflow.com/comment/38863197
type: QuestionComment
type: Comment
has text: add your `wrapperNav` div to `item` div. Add to `item` css `position:relative;` add to `wrapperNav` css : `{position: absolute; bottom: 20px; right: 50px; z-index:999;}`
comment on: http://stackoverflow.com/q/24995977
score: 0

http://stackoverflow.com/a/24985001
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has body: You're not using your event properly: $('.next').on('click', function( event ){ // &lt;&lt; pass as argument also you should use "-="+ variable var slideObject = $('.object').width(); $('.next').on('click', function( event ){ event.preventDefault(); $(slideContainer).animate({ marginLeft: "-="+ slideObject}, 500); }); Look at the argument we pass to the .animate() method as an Object Literal: var obj = { marginLeft : 200, // Valid (Number) marginRight : "100", // Valid (String) marginTop : topValue, // Valid (Variable) marginBottom : "100px" // Valid (String) } (Yes exactly, you can use the above as $(slideContainer).animate(obj, 500); ) where in this example: var obj = { marginLeft : -=200, // Unexpected Token Error marginRight : "-=100" // Valid (String) } So jQuery usually expects is a valid Object. Usually a string value like "200px" To make our lives easier it allows us to use a Number value like: 200 which will be than converted internally to String using px as default: "200px". It allows us to pass inside the Animate object a variable like {marginLeft : margVal} but -=margVal is no longer a valid object property value but Unexpected token -=. If you convert it to String concatenating your Operator with your Variable, jQuery will than see "-=200" a valid string. Note also that if your slideContainer is already a jQuery object, there's no need to wrap it again into jQuery $().
accepted answer of: http://stackoverflow.com/q/24984951
answers question: http://stackoverflow.com/q/24984951

http://stackoverflow.com/a/24938147
answers question: http://stackoverflow.com/q/24937786
has body: I would change your code a bit, to add a event listener rather than inject the javascript into your markup (which is the preferred method). You can try this code: window.onload = function() { var input = document.getElementById('input'); input.addEventListener('click', toggle); } The input will need id='input and the toggle function will need to be slightly modified: function toggle(e){ e.preventDefault(); var el = e.toElement //rest of code } The e.preventDefault() is what will keep the page from refreshing.
type: Answer
has comment: http://stackoverflow.com/comment/38783525
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/38786360
has comment: http://stackoverflow.com/comment/38756114
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24937786

http://stackoverflow.com/comment/38857717
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24993049
has text: What about my overall structure? would you fix that?
type: AnswerComment

http://stackoverflow.com/comment/39001651
score: 0
has text: `$timeout` call `$apply` - no need to include `$apply` in a function called within `$timout`
comment on: http://stackoverflow.com/q/25069436
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24970774
has title: Trouble with google map Api, for locating adress
has comment: http://stackoverflow.com/comment/38815213
has comment: http://stackoverflow.com/comment/38815236
tagged with: class
has comment: http://stackoverflow.com/comment/38815298
type: Question
has answer: http://stackoverflow.com/a/24970959
has comment: http://stackoverflow.com/comment/38815250
has body: Hi have some trouble while using javascript and google api for locating adress. When I use that code, it works fine : var options = { types: ['(cities)'], componentRestrictions: { country: 'fr' } }; var input = document.getElementById('location'); autocomplete = new google.maps.places.Autocomplete(input, options); But when I want to use multi input, for having many adresses, it does not work, I tried to change the getElementById to getElementsByClassName('location') it return to me TypeError: undefined is not a function all elements input that need to have this autocomplete script do have a class named "location". I do not know what I'm doing wrong. all example I have seen, show only for one input, so I don't know if this script is able to work with many inputs using classname. Anykind of help will be much appreciated.
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/24970959
tagged with: google-maps
type: AnsweredQuestion
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38841383
type: AnswerComment
type: Comment
has text: Can you give me example in context of Parse.Query?
comment on: http://stackoverflow.com/a/24984620
score: 0

http://stackoverflow.com/a/24939628
has comment: http://stackoverflow.com/comment/38758534
type: Answer
has comment: http://stackoverflow.com/comment/38761745
has comment: http://stackoverflow.com/comment/38761101
has comment: http://stackoverflow.com/comment/38760530
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24939114
has body: You could observe the currentPath in the ApplicationController and react on any changes. App.ApplicationController = Ember.Controller.extend({ currentPathChanged: function() { console.log(this.get('currentPath')); }.observes('currentPath') });
accepted answer of: http://stackoverflow.com/q/24939114
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38762383

http://stackoverflow.com/q/24981586
score: 0
tagged with: whmcs
has comment: http://stackoverflow.com/comment/38835837
has title: javascript is not loading on ssl
tagged with: ssl
tagged with: javascript
has comment: http://stackoverflow.com/comment/38835875
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38835461
has body: I've a WHMCS installed on my host. I've just added a simple code to rotate our certificates logo and it's working fine in the main page (and also Non-SSL pages), take a loot please (down in right column of the page): http://www.irpowerweb.com/ but in SSL pages it's not working: https://www.irpowerweb.com/register.php eth is same in both paths and the only difference is about SSL (HTTPS). I find out the problem is not related to the insecure content on my page ('enamad.ir/trustseal/symbol.aspx') because I removed it but problem exists. any helps are appreciated.
answer count: 0
has comment: http://stackoverflow.com/comment/38835611
type: Question
tagged with: php

yui-compressor
tags question: http://stackoverflow.com/q/25068188
type: Tag
tag name: yui-compressor

http://stackoverflow.com/q/24958028
has comment: http://stackoverflow.com/comment/38791945
score: 0
has comment: http://stackoverflow.com/comment/38791260
has body: I developed a prototype of a graphical time scheduler but need to re-code most of it since the JS is a mess at the moment. And I realized this is the best time to make any major changes to my design as well. It uses an html table and looks like: Currently: starts off empty and grows/shrinks via jquery rewriting it fairly dynamic (time scale, sizes, etc can all be changed at run time) horizontal lines are halfway through cells, they aren't cell borders (like here). red boxes are anchored in a cell and given an offset and size via JS. same with blue box. time tags are divs inside cells and not really fun to work with I need to add a bunch more functionality: some basic/limited zooming multi-day tags labels on the redboxes hover/click effects possibly some drag effects I can figure out all of the above but I'm unsure if it's better to go with a table or list (or something else?). Technically, it's a "timetable" but it looks more like a graph. My experience with lists is very limited so I'm looking for someone's advice that's done this kind of thing before before. I don't want to switch to a list and realizing I need to change my base html type partway through. Also, this is not a "public" app (it's behind a login), if that makes a difference. And my key priorities are smooth development and easy maintenance/customization. Though thoughts about JS performance would be useful too. EDIT: Rereading, my question is a bit vague (the 'why' part of it). What I'm interested in is which html element makes it easier in regards to: positioning, alignment absolute positioned things like red boxes effects and events (of the type previously mentioned) Or are they fairly similar? Conclusion Edit: I eventually changed my design to a grid like div system. Tables worked up until I tried to add Firefox compatibility. Firefox and Chrome handle tables differently when it comes to complicated positioning and trying to get it pixel perfect was a nightmare.
type: AnsweredQuestion
has title: HTML table or list for graphical time schedule
tagged with: list
type: Question
has answer: http://stackoverflow.com/a/24958693
tagged with: html-table
linked to: http://stackoverflow.com/q/4619542
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38792215
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/24958693

http://stackoverflow.com/a/24931871
score: 21
upvote count: 21
has comment: http://stackoverflow.com/comment/38742507
accepted answer of: http://stackoverflow.com/q/24931390
answers question: http://stackoverflow.com/q/24931390
has comment: http://stackoverflow.com/comment/38742023
has body: These are the steps: Get the selected item Get the item corresponding to the selected item. Get the index corresponding to the item that is selected. Use insert method in DataSource for specifying the position where you want to insert. Code: var grid = $("#grid").data("kendoGrid"); // Get selected item var sel = grid.select(); // Get the item var item = grid.dataItem(sel); // Get the index in the DataSource (not in current page of the grid) var idx = grid.dataSource.indexOf(item); // Insert element before grid.dataSource.insert(idx, { /* Your data */ }); // Insert element after grid.dataSourcer.insert(idx + 1, { /* Your data */ }); See it in action here: http://jsfiddle.net/OnaBai/8J4kr/ EDIT If after inserting the row you want to enter that row in edit mode, you have to remember the position inside the page where you are inserting since editRow works at DOM level: var grid = $("#grid").data("kendoGrid"); // Get selected item var sel = grid.select(); // Remember index of selected element at page level var sel_idx = sel.index(); // Get the item var item = grid.dataItem(sel); // Get the index in the DataSource (not in current page of the grid) var idx = grid.dataSource.indexOf(item); // Insert element before (use {} if you want an empty record) grid.dataSource.insert(idx, { LastName: "Smith", FirstName: "John", City: "Baiona" }); // Edit inserted row grid.editRow($("#grid tr:eq(" + ( sel_idx + 1) + ")")); For after you should do // Insert element before (use {} if you want an empty record) grid.dataSource.insert(idx + 1, { LastName: "Smith", FirstName: "John", City: "Baiona" }); // Edit inserted row grid.editRow($("#grid tr:eq(" + ( sel_idx + 2) + ")")); See it in action here: http://jsfiddle.net/OnaBai/8J4kr/1/ There is an additional question that is that you might need to move to previous or next page depending if you are inserting before the first row of a page or after the last row of a page (use page for moving between Grip pages).
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38743586
has comment: http://stackoverflow.com/comment/38742223
type: Answer

http://stackoverflow.com/comment/38819629
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24972452
has text: Check this http://stackoverflow.com/a/9296803/3797480
type: Comment

http://stackoverflow.com/comment/38825540
score: 0
comment on: http://stackoverflow.com/q/24973965
has text: `Subject` vs `subject` maybe? I also used service `Gmail`.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38995397
comment on: http://stackoverflow.com/q/25062326
type: Comment
has text: How do you know that you don't get the permissions you asked for?
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38709581
has text: @DaveNewton Exactly - Asynchronous JavaScript And XML.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24914366

http://stackoverflow.com/comment/38948541
type: QuestionComment
comment on: http://stackoverflow.com/q/25041236
type: Comment
has text: Purely my opinion: JS engines seem to be playing "keeping up with the Joneses" with each other, with Chrome mostly running the show (although Firefox does out perform them in certain cases). So it's my belief that, if you really need to optimize, optimize such that it performs better for Chrome or Firefox because they're leading the charge. But this isn't concrete fact, only future speculation.
score: 0

http://stackoverflow.com/a/24911465
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38704471
has body: You have a semi colon after the for loop: for(i=1; i > templateTotal; i++); It should be: for(i=1; i > templateTotal; i++) templateButton += ' T'+i+' ' or for(i=1; i > templateTotal; i++){ templateButton += ' T'+i+' ' } The semicolon indicates the end of a statement (as does the carriage return). The for loop (unless followed by brackets) will execute the next single statement which the semicolon ends. A semicolon isn't necessary to end a statement, but it's good practice to put it in. Omitting it will still create valid syntax.
has comment: http://stackoverflow.com/comment/38704378
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/24911423
has comment: http://stackoverflow.com/comment/38703964
upvote count: 3
answers question: http://stackoverflow.com/q/24911423

http://stackoverflow.com/q/24982771
score: 5
has comment: http://stackoverflow.com/comment/56280248
upvote count: 5
has title: Can't get EXIF info using loadImage.parseMetaData
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/32511356
tagged with: loadimage
has answer: http://stackoverflow.com/a/25125725
has answer: http://stackoverflow.com/a/32144591
answer count: 3
has comment: http://stackoverflow.com/comment/56342948
favorite count: 0
type: UnansweredQuestion
tagged with: exif
has body: I am using JavaScript LoadImage.parseMetaData (https://github.com/blueimp/JavaScript-Load-Image) to try and get Orientation of an image on the web, so I can rotate it. If I hardcode the orientation (see "orientation: 3" in my second loadImage call), I can rotate it... but I am trying to use loadImage.parseMetaData to get the Orientation. I have used web based EXIF parsers and the orientation info is there in the image. When I call loadImage.parseMetaData "data.exif" seems to be null. See this fiddle: http://jsfiddle.net/aginsburg/GgrTM/13/ var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://www.filepicker.io/api/file/U0D9Nb9gThy0fFbkrLJP', true); xhr.responseType = 'blob'; xhr.onload = function(e) { if (this.status == 200) { // Note: .response instead of .responseText console.log ("got image"); var blob = new Blob([this.response], {type: 'image/png'}); console.log("about to parse blob:" + _.pairs(this.response)); loadImage.parseMetaData(blob, function (data) { console.log("EXIF:" + _.pairs(data)) var ori ="initial"; if (data.exif) { ori = data.exif.get('Orientation'); } console.log("ori is:" + ori); }); var loadingImage = loadImage( blob, function (img) { console.log("in loadingImage"); document.body.appendChild(img); }, {maxWidth: 600, orientation: 3, canvas: true, crossOrigin:'anonymous' } ); if (!loadingImage) { // Alternative code ... } } }; xhr.send(); Any ideas or alternative approaches to correctly orientating images welcome.
type: Question

http://stackoverflow.com/a/24913985
upvote count: 0
type: Answer
has body: I would use css display:table to acheieve this. Something like this // UL Navigation //All Tabs content The table cells will always be of the same height and so will the border.
answers question: http://stackoverflow.com/q/24913243
downvote count: 1
score: -1

http://stackoverflow.com/q/24971676
possible better answer: http://stackoverflow.com/a/24972052
linked to: http://stackoverflow.com/q/23586425
type: Question
has title: Notify after async task is done
tagged with: javascript
has answer: http://stackoverflow.com/a/24973026
score: 0
answer count: 2
tagged with: jquery-deferred
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24973026
has body: I'm building a game with move.js for animation, but it takes too long so when the player click on the right solution it displays the winning message before the right solution change it's color, so I used deferred object to fire an event and catch it when the animation ends. Here's my code: var deferred = new $.Deferred(); click(e); //show message when game is over $.when(deferred).then(function(){ if (this.checkIfWin()){ alert('you won !'); this.nextLevel(); } }); function click(e){ move(e) .set('background-color','black') .delay('0.1s') .end(); deferred.notify(); } but it's not notified and the message doesn't show up.What am I missing here ?
linked to: http://stackoverflow.com/q/23403814
has answer: http://stackoverflow.com/a/24972052
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/23865481

http://stackoverflow.com/comment/38915900
has text: @SerdarBasegmez - yes it works in firefox but not in IE8. Extjs 5 documentation says it supports IE8 so not quite sure what the issue is. Will test it on IE11 and see if it works there.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24962677

http://stackoverflow.com/a/25004970
score: 0
has body: For those who run into the same problem, the issue is covered here: https://github.com/nlaplante/angular-google-maps/issues/561 and has not been pushed to the latest master branch. To fix, use the current "develop" branch ( as of July 2014).
accepted answer of: http://stackoverflow.com/q/24945544
type: Answer
answers question: http://stackoverflow.com/q/24945544
type: AcceptedAnswer

http://stackoverflow.com/comment/38703951
type: QuestionComment
comment on: http://stackoverflow.com/q/24911675
has text: Please post any relevant code snippets that you have tried.
score: 1
type: Comment

http://stackoverflow.com/a/24983209
has comment: http://stackoverflow.com/comment/38852477
has comment: http://stackoverflow.com/comment/38851890
type: Answer
has comment: http://stackoverflow.com/comment/38852565
downvote count: 0
has comment: http://stackoverflow.com/comment/38851405
score: 1
has comment: http://stackoverflow.com/comment/38850774
has comment: http://stackoverflow.com/comment/38850747
answers question: http://stackoverflow.com/q/24979576
has body: Not completely sure that I understand your app structure, but here is a working example, which should follow your design Firstly, because the 'tab' state is parent for both children tab.posts and tab.view, I placed both targets inside of the tabs.html: Tabs NOTE: in fact, there could be just one even unnamed template and both states can target that like this views : { '' : {... The way, how we can go to comments from a list view is expressed this way: comments comments The rest of your draft is mostly unchanged, just do not forget to reference all modules in the root one: var app = angular.module('myApp', [ 'app.controllers.view', 'ui.router' ]); The working plunker is here
upvote count: 1

http://stackoverflow.com/a/24974765
has body: use class instead of id, since (as its name already says) id must be unique, otherwise it is not an id anymore.. repaired and working version: http://jsfiddle.net/hvWeG/5/ $(function(){ $('.option').on('click',function(){ $(this).css('background-color','yellow'); }); }); html Cucumber Tomato Potato
upvote count: 1
answers question: http://stackoverflow.com/q/24974683
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/38917129
score: 3
comment on: http://stackoverflow.com/q/25024534
has text: I've changed your [tag:java] tag to a [tag:javascript] tag. Please understand that these are two completely different programming languages, about as closely related as ham and hamburger are, and that if you mis-tag your question, you will not get the right experts in to review it, and this will hurt your chances of getting decent help. Since I know nothing about Javascript, this is about all that I can do for you except to wish you well and hope that you get a decent answer soon.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25058134
has answer: http://stackoverflow.com/a/25060605
has answer: http://stackoverflow.com/a/74818340
has answer: http://stackoverflow.com/a/25070236
has comment: http://stackoverflow.com/comment/38979555
has answer: http://stackoverflow.com/a/38214732
type: AnsweredQuestion
has title: Javascript: Split a string by comma, except inside parentheses
score: 3
has comment: http://stackoverflow.com/comment/38979635
has answer: http://stackoverflow.com/a/25058431
downvote count: 5
has answer: http://stackoverflow.com/a/25060627
type: Question
accepted answer: http://stackoverflow.com/a/25060605
has comment: http://stackoverflow.com/comment/38979662
has answer: http://stackoverflow.com/a/73487516
possible better answer: http://stackoverflow.com/a/25060627
tagged with: javascript
answer count: 7
has body: Given string in the form: '"abc",ab(),c(d(),e()),f(g(),zyx),h(123)' How can I split it to get the below array format: abc ab() c(d(),e()) f(g(),zyx) h(123) I have tried normal javascript split, however it doesn't work as desired. Trying Regular Expression but not yet successful.
tagged with: parsing
favorite count: 0
upvote count: 8

http://stackoverflow.com/comment/38962604
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25048617
has text: @showdev, while not optimal, definately better than what I was able to come up with. Thanks for the help! I'll keep playing with clearRect and see what I can come up with. If you throw it as an answer, I'll accept. Definitely enough to work with. Thanks!

http://stackoverflow.com/comment/38806165
type: Comment
has text: I am a little confused as to what you mean, do you have an example?
score: 0
comment on: http://stackoverflow.com/a/24965832
type: AnswerComment

http://stackoverflow.com/comment/38914024
type: Comment
score: 1
comment on: http://stackoverflow.com/q/25022878
has text: When you say other document, what do you mean? Other HTML document?
type: QuestionComment

http://stackoverflow.com/a/24949630
upvote count: 1
has body: Use this: if (/]]\[\[/.test(yourString)) { // It matches! } else { // Nah, no match... } Note that we need to escape the two opening braces with \[, but the closing braces ] do not need escaping as there is no potential confusion with a character class.
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24949606
type: Answer

http://stackoverflow.com/a/25203926
has body: I created a performance test to see the results: http://jsperf.com/module-performance-test 1. and 2. are nearly equal. 3. should not be used in case of focus on fast execution.
score: 0
accepted answer of: http://stackoverflow.com/q/24958041
type: Answer
answers question: http://stackoverflow.com/q/24958041
type: AcceptedAnswer

http://stackoverflow.com/a/24994146
has comment: http://stackoverflow.com/comment/38859780
accepted answer of: http://stackoverflow.com/q/24994091
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24994091
type: Answer
has body: var objSample = function(){ this.variable = 10 this.func1 = function(){ someJQueryPlugin(1, function(){ this.variable; &lt;-- this doesn't work, don't have access }); } } also you can extend constructor with params var objSample = function(options){ this.variable = options.val this.func1 = function(){ someJQueryPlugin(1, function(){ this.variable; &lt;-- this doesn't work, don't have access }); } } var obj1 = new objSample ({val:1}) var obj2 = new objSample ({val:2}) and to access this from callbacks in different context, enclose this to some variable. So final code looks like: var objSample = function(options){ var self = this; self.variable = options.val self.func1 = function(){ someJQueryPlugin(1, function(){ self.variable; }); } }
downvote count: 0
score: 1

http://stackoverflow.com/a/25063142
downvote count: 0
score: 6
has body: Note you want to remove the adjacent siblings before you take out the first and last. $('li.k-separator + li.k-separator').remove(); $('li.k-separator:first-child, li.k-separator:last-child').remove(); http://jsfiddle.net/54dd4/
type: AcceptedAnswer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/25062855
answers question: http://stackoverflow.com/q/25062855
type: Answer

http://stackoverflow.com/q/24963045
has body: Given this view markup, I'm linking to an image on the server dynamically using values in the scope. Upon first loading the page, images is empty, so the second div is displayed to say there are no images. However, since the first div contains an img tag, it attempts to download the image from the server when the view itself is downloaded by the browser. I've tried wrapping the anchor and image tag in a div with ng-if="image", but that doesn't fix it. Search 0"> Name: {{ image.name }} Index: {{ image.index }} Pages:{{ image.pages.length }} Path: {{ image.path }} Type: {{ image.type }} 0"> No images found.
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38801066
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24963187
accepted answer: http://stackoverflow.com/a/24963187
has title: Prevent images from loading in an AngularJS view if scope variable is empty

http://stackoverflow.com/q/24988020
tagged with: socket.io
has comment: http://stackoverflow.com/comment/38848070
type: AnsweredQuestion
has body: I am writing an Android app that connects to a server using socket.io (v1.0.4). Is there a socket.io Java client out there that works with socket.io v1.0? I was originally using the Gottox solution but it only seems to work with socket.io &lt;= v0.92. Some other libraries available https://github.com/koush/AndroidAsync https://github.com/nkzawa/socket.io-client.java nkzawa's claims to be supported for 1.0 but there seem to be some issues with it.
tagged with: java
linked to: http://stackoverflow.com/q/24386302
has comment: http://stackoverflow.com/comment/38848546
has title: Socket.io Java Client with support for 1.0.x
type: Question
has answer: http://stackoverflow.com/a/24988429
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24988429
score: 0
tagged with: android

http://stackoverflow.com/comment/39388954
score: 0
comment on: http://stackoverflow.com/a/25272793
type: Comment
type: AnswerComment
has text: Indeed, it's a debatable thing. As I said, the most important are your resources, how you access them and what status you return, the name of the controller actions you put behind has nothing to do with being RESTful. Rails conventions recommend the [show index edit update destroy] for RESTful routes but whatever makes your code understandable is fine I guess.

http://stackoverflow.com/comment/38868628
type: AnswerComment
type: Comment
score: 1
has text: @minitech Yeah I'm sorry for that. Indeed now it's ten. It used to be 12 though
comment on: http://stackoverflow.com/a/24988713

http://stackoverflow.com/comment/38994243
has text: This works http://jsfiddle.net/Ta5j4/4/ . Not ideal but since all of the functions exist in FF (though they throw errors) I can't just check if they exist.
comment on: http://stackoverflow.com/a/25065192
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25031013
upvote count: 2
has comment: http://stackoverflow.com/comment/38930475
accepted answer of: http://stackoverflow.com/q/24997246
has body: Add .Selectable() in your grid so it allow you select previously row. @(Html.Kendo().Grid&lt;SustIMS.Models.StretchModel&gt;() .Name("datagrid_Stretches") .Columns(columns =&gt; { columns.Bound(s =&gt; s.StretchCode).Title(ViewBag.lblCode).Width(80); columns.Bound(s =&gt; s.StretchMediumDescription).Title(ViewBag.lblDescription); ... }) .Selectable(selectable =&gt; selectable .Type(GridSelectionType.Row) &lt;--------- Add This ) .Events(e =&gt; e.Change("onChange")) .DataSource(dataSource =&gt; dataSource .Ajax() .PageSize(15) .Read(read =&gt; read.Action("GetStretches", "MasterData")) ) ) Script function onChange() { var code = this.dataItem(this.select()).StretchCode; $.post('@Url.Content("getStretchCode")', { "code": code }); }
answers question: http://stackoverflow.com/q/24997246
has comment: http://stackoverflow.com/comment/38931256
has comment: http://stackoverflow.com/comment/38931999
has comment: http://stackoverflow.com/comment/38931468
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38930644
has comment: http://stackoverflow.com/comment/38932613
type: Answer
has comment: http://stackoverflow.com/comment/38935807

http://stackoverflow.com/a/24921700
has comment: http://stackoverflow.com/comment/38795240
has body: If I understand you well, you need an Ajax request. This is an example using jQuery: &lt;script&gt; // fetch the file via a jQuery Ajax request $.ajax({ url : "http://localhost/test/file.htm", success : function(result){ // get the &lt;body&gt; content of the file (split with regular expressions) var body = result.split(/&lt;body[^&gt;]*&gt;/i)[1].split(/&lt;\/body&gt;/i)[0]; // split the bits separated by space (" ") and redirect to the 2nd bit (the URL) window.location.href = body.split(" ")[1]; } }); &lt;/script&gt; Keep in mind that the file you want to fetch has to be on the same domain as yours. This means "example.com/..." will only work if the fetching script is also on this domain (cross domain requests are usually not allowed for security reasons).
type: Answer
answers question: http://stackoverflow.com/q/24920185
score: 0
has comment: http://stackoverflow.com/comment/38725580

http://stackoverflow.com/comment/38948667
type: Comment
has text: Thanks for testing. Weird, tested it in three different computers and get the same results. Let's see if other people have the same issue...
score: 0
comment on: http://stackoverflow.com/q/25041190
type: QuestionComment

http://stackoverflow.com/q/24982551
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38861218
has title: D3 Force Layout / 2 magnets?
has comment: http://stackoverflow.com/comment/38888123
answer count: 0
tagged with: d3.js
has body: I have a central circle (C1) and have bunch of nodes on the left, marked with 'L' and bunch of them on the right, marked with 'R'. I've been trying unsuccessfully implement the following behavior ( for this fiddle http://jsfiddle.net/yeQS2/94/ start();): I would like the 'L' marked circles to be dragged by a magnet / force onto the left and the 'R' marked circles to be dragged/ forced onto the right. Could some please help/ advise or modify my given example with a better idea, please. Of course if there is a better way of doing this Your suggestions are welcome
type: Question
has comment: http://stackoverflow.com/comment/38931904
has comment: http://stackoverflow.com/comment/38890716
tagged with: javascript
has comment: http://stackoverflow.com/comment/38867625
has comment: http://stackoverflow.com/comment/38837465
has comment: http://stackoverflow.com/comment/38867152
score: 0
has comment: http://stackoverflow.com/comment/38859717
has comment: http://stackoverflow.com/comment/38932298
tagged with: layout
has comment: http://stackoverflow.com/comment/38936990

http://stackoverflow.com/comment/38789917
type: Comment
type: QuestionComment
has text: Not sure why there is a downvote?
score: 0
comment on: http://stackoverflow.com/q/24957058

http://stackoverflow.com/q/25024613
downvote count: 0
has comment: http://stackoverflow.com/comment/38917255
duplicate of: http://stackoverflow.com/q/1451009
favorite count: 0
has answer: http://stackoverflow.com/a/25024704
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25024704
has body: I am creating a small domain availability checker. For that I will parse the desired domain into a form, and submit that to a PHP file with jQuery AJAX. However while I am looping through the different TLD's it suddenly gets undefined and I am not able to use the "TLD" for further processing within the loop. As far as I can read, it as something to do with the loop happening first and the requests made after, so I somehow have to freeze the index of my array. But I don't know how to do that. This is my code: $("input[name=submit]").click(function(){ var getDomain = $("#domainsearch").val(); var stripDomain = getDomain.split("."); var domain = stripDomain[0]; var tlds = ["dk", "se", "com", "net"]; for (var i = 0; i &lt; tlds.length; i++ ) { var dataString = "domain=" + domain + "." + tlds[i]; console.log(dataString); $.ajax({ type: "POST", url: "search.php", data: dataString, success: function(data) { console.log(domain + "." + tlds[i] + " is " + data); } }); }; return false; }); The printed console.log's looks like this:
has answer: http://stackoverflow.com/a/25024700
score: 1
upvote count: 1
has title: Index of an array becomes undefined while looping
type: Question
accepted answer: http://stackoverflow.com/a/25024700
linked to: http://stackoverflow.com/q/1451009
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25024707
has comment: http://stackoverflow.com/comment/38917298
answer count: 3

http://stackoverflow.com/q/24924666
tagged with: forms
has body: I have a form that take a few seconds to submit. I want to disable the submit button and display "Processing.." I disable it for 5 seconds. Problem is that the page the the form is being submitted to yay display an error and as the user to go back and fix the error. When I click the back link the submit button remains disabled if it was successfully submitted before the 5 second timer re-enabled it. Question is - Is there a way to re-enable the submit button so if I have to go back a fix some form data it wont remain frozen?
upvote count: 1
answer count: 1
has answer: http://stackoverflow.com/a/29371151
favorite count: 0
type: UnansweredQuestion
has title: Disable submit but make sure its re-enabled if back button is pressed
tagged with: onclick
downvote count: 0
tagged with: onsubmit
type: Question
score: 1
tagged with: javascript

http://stackoverflow.com/a/24961234
score: 0
has body: If it's going to be displayed statically (ie no frame by frame updates) then simply drawing on a canvas is probably the best approach as redrawing a few thousand lines might be fine for a GPU, but millions is definitely pushing it (1). linewidth is also not supported everywhere in WebGL but works fine with the canvas methods. Once drawn on a canvas there is no frame by frame redrawing required, and you can bypass three.js entirely if you don't need the 3D. And yes, you should export the data you need from the database as JSON, then process that in a loop rather than building a HTML page with all the instructions. (1) You wouldn't be able to fill an image with millions of lines and not display a terrible mess in the process, so you'll have to filter the data in some way. Edit: Also have a look at Circos, which might just be what you need.
type: Answer
has comment: http://stackoverflow.com/comment/38811574
answers question: http://stackoverflow.com/q/24960108

http://stackoverflow.com/q/24945021
tagged with: debugging
answer count: 2
tagged with: sails.js
tagged with: javascript
score: -1
favorite count: 0
has answer: http://stackoverflow.com/a/68171349
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has title: How do I output log messages to the console
has answer: http://stackoverflow.com/a/24945067
has body: I am working on a sails.js web app so I am starting the web app using the command line. I am trying to output objects to the browser console but instead, they are displayed in the command line. Is there a way to change it so that logs are output to the console?
type: Question

http://stackoverflow.com/q/24994954
tagged with: jquery
has comment: http://stackoverflow.com/comment/38860553
has answer: http://stackoverflow.com/a/24995202
has body: The problem is that the code here is fine, because it's main function is to narrow down the results from an unordered list if a checkbox is checked and it works, but if no checkboxes are checked, you can see all the results. I would like to hide the results if none of the checkboxes are checked. Can you help me with it? The code: $(document).ready(function() { $("[name='filter']").change(function() { $('.filtered li').show(); $("[name='filter']:checked").each(function() { var tag = $(this).val(); $('.filtered li').children(".tags:not(:contains('" + tag + "'))").parent().hide(); }); }); }); The HTML: filter1 filter2 filter3 filter4 filter5 filter6 filter7 filter8 filter9 filter10 filter11 filter12 filter13 filter14 filter15 filter16 filter17 filter18 filter19 filter20 1 filter1 filter5 filter7 filter9 2 filter2 filter15 filter17 filter19
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24995143
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38860536
tagged with: checkbox
tagged with: css
score: 0
has comment: http://stackoverflow.com/comment/38860595
type: Question
has title: Hide unordered list if no checkboxes are checked
tagged with: javascript

http://stackoverflow.com/q/25034083
has comment: http://stackoverflow.com/comment/39136239
tagged with: facebook-graph-api
favorite count: 0
linked to: http://stackoverflow.com/q/14316467
type: UnansweredQuestion
tagged with: facebook
tagged with: php
downvote count: 1
has body: Is there a way realtime store/update Facebook api 'share', 'like' counts each pages on site to database? I just can't figure out how to, and can't see any example... so please any suggestion will be appreciate!! for example it can be sort all data to solve like this How can I get the list of top 10 artciles shared on Facebook using Graph API or FQL? UPDATE If I want to sort all data, (https://api.facebook.com/method/links.getStats?urls=%%URL%%&amp;format=json) I think maybe I have to store all data to my database, Maybe it can't be possible realtime sync my database and fb database, because the share count number is include the Facebook user click shared post share button on Facebook. If so, should I only use crontab execute php file get data store to my database. then I can print on web page? Or some other suggestion? people usually how to do this?
score: 2
has answer: http://stackoverflow.com/a/25217093
upvote count: 3
has title: Is there a way realtime store/update Facebook api 'share', 'like' counts each pages on site to database?
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/24925435
has comment: http://stackoverflow.com/comment/38751260
type: Question
has comment: http://stackoverflow.com/comment/38739275
score: 0
tagged with: jquery-ui-autocomplete
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/38833641
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has title: Custom UL Structure for JQuery Autocomplete
tagged with: jquery-plugins
has comment: http://stackoverflow.com/comment/38773605
answer count: 0
has body: JQuery Autocomplete shows results in form of a UL and items as its LI elements. I have a tree structure of elements which is 2 levels deep and have expand and collapse functionality. It looks something like this: This structure is created from a JSON array of this format: [ { "scope": "1", "active": "true", "id": "T8", "label": "Last Close Price", "type": "TECHNICAL", "value": "Last Close Price", "group": "Price" }, { "scope": "1", "active": "true", "id": "T32", "label": "Open Price", "type": "TECHNICAL", "value": "Open Price", "group": "Price" }] and its html structure is something like this: TECHNICAL Price Item1 Now I want to implement JQuery UI autocomplete on this array and show filtered results in the same array. But by looking at the Documentation, I couldn't find anything which can modify the results of JQuery Autocomplete to this level. Most people just want to modify the html of individual LI elements, here I want to create deep level nesting of UL elements to form the tree structure. I have already written a function which creates this tree but where to put it in Autocomplete and how to get the keyboard keys functioning (i.e. select element with arrow keys) is the question. Thanks.

http://stackoverflow.com/a/25049651
type: Answer
accepted answer of: http://stackoverflow.com/q/25045140
answers question: http://stackoverflow.com/q/25045140
score: 0
type: AcceptedAnswer
has body: One possible solution, use the Google Maps Data Layer to display your GeoJSON. The use it to retrieve the coordinates and get directions between them. The below code assumes 2 points (and uses your example with 2 points): working fiddle function calculate() { var request = { origin: origin, destination: destination, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function (response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); } // global variables var origin = null; var destination = null; var infowindow = new google.maps.InfoWindow(); var directionsDisplay = new google.maps.DirectionsRenderer(); var directionsService = new google.maps.DirectionsService(); function initialize() { // Create a simple map. features = []; map = new google.maps.Map(document.getElementById('map-canvas'), { zoom: 4, center: { lat: -28, lng: 137.883 } }); directionsDisplay.setMap(map); directionsDisplay.setPanel(document.getElementById('directions-panel')); google.maps.event.addListener(map, 'click', function () { infowidow.close(); }); // process the loaded GeoJSON data. google.maps.event.addListener(map.data, 'addfeature', function (e) { if (e.feature.getGeometry().getType() === 'Point') { map.setCenter(e.feature.getGeometry().get()); // set the origin to the first point if (!origin) origin = e.feature.getGeometry().get(); // set the destination to the second point else if (!destination) { destination = e.feature.getGeometry().get(); // calculate the directions once both origin and destination are set calculate(); } } }); map.data.addGeoJson(data); } google.maps.event.addDomListener(window, 'load', initialize);

http://stackoverflow.com/a/25013799
score: 1
type: Answer
upvote count: 1
has body: All features of Highcharts are included in Highstock
answers question: http://stackoverflow.com/q/25013699
downvote count: 0

http://stackoverflow.com/a/25068994
has comment: http://stackoverflow.com/comment/39000767
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25068936
downvote count: 0
has comment: http://stackoverflow.com/comment/39000858
type: Answer
has body: You can not use the variable history change it to something else since window.history clashes.

http://stackoverflow.com/comment/38913374
comment on: http://stackoverflow.com/a/25021423
type: Comment
has text: i think you as the designer/developer place the original coords, and then the plugin alters them as needed... what does the GIT say...https://github.com/stowball/jQuery-rwdImageMaps?
score: 0
type: AnswerComment

http://stackoverflow.com/q/25052280
has answer: http://stackoverflow.com/a/25053040
has comment: http://stackoverflow.com/comment/38969596
score: -4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25052696
has comment: http://stackoverflow.com/comment/38969092
has body: I need to pass the value from one page to another in html. I'm using only div classes. In that one value is shown. I need to pass the value to another page and display it. here is my code SCORE ok Js if (correct_move == 6) { $('.displayno').append(+success).show(); $('#successMessage').show(); $('#successMessage').animate({ left: '458px', top: '200px', width: '400px', height: '100px', opacity: 1 }); }
tagged with: javascript
type: Question
accepted answer: http://stackoverflow.com/a/25052696
answer count: 2
downvote count: 4
upvote count: 0
has comment: http://stackoverflow.com/comment/38968961
tagged with: jquery
has title: how to pass the value from one page to another page in html
favorite count: 0
has comment: http://stackoverflow.com/comment/38969037
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25053040
tagged with: css

http://stackoverflow.com/comment/38712068
comment on: http://stackoverflow.com/a/24915668
score: 0
type: AnswerComment
has text: If you found the answer on another question on Stackoverflow, you should close your question as a duplicate; it's cleaner than posing an answer that says "the answer is over here"
type: Comment

http://stackoverflow.com/q/25041829
tagged with: d3.js
has answer: http://stackoverflow.com/a/26251080
has comment: http://stackoverflow.com/comment/38949494
has comment: http://stackoverflow.com/comment/39025563
has comment: http://stackoverflow.com/comment/38970657
has body: I have a barchart made with NVD3 that shows datas with a huge gap between min value and max value. This makes the chart not really nice/usefull. Example : Y value are between 4,000 and 60,000 then some value are near 3m. I would like to have an Y Axis value increasing logarithmically, that show something like this (see the y Axis): I tried to change yAxis scale, yAxis Domain, but didn't find any working solution (FYI: I use nvd3 through angularJs directives)
upvote count: 2
has comment: http://stackoverflow.com/comment/38962649
answer count: 2
has title: NVD3 Logarithmic Y axis with barchart
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/31659971
has comment: http://stackoverflow.com/comment/38949387
score: 2
tagged with: scale
tagged with: bar-chart
downvote count: 0
linked to: http://stackoverflow.com/q/23474319
favorite count: 0
type: Question
tagged with: nvd3.js

http://stackoverflow.com/comment/38766766
comment on: http://stackoverflow.com/q/24944527
score: 0
has text: @Rahul, its not that its stripped, its still represented, its just 69.00 and 69 and 69.0000 and 69.000000000000 are the same thing. How many decimal points you show is a printing problem which toFixed is all about
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38786083
type: QuestionComment
comment on: http://stackoverflow.com/q/24955333
has text: Have you tried `onunload` from the pages that are trying to navigate to the image?
score: 0
type: Comment

http://stackoverflow.com/comment/38953740
type: Comment
comment on: http://stackoverflow.com/a/25044164
has text: This will work; however, it does not answer the OPs original question. He was specifically asking for how to *print* only #description. This, on the other hand, *retrieves* only #description. It's possible that the OP wanted to get the entire document and only print out specific parts. Using this technique would require multiple HTTP requests if the OP wants to do this many times with different elements.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38910163
has text: Is it possible? "Yes"! Create a select element with some fonts.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25021019

http://stackoverflow.com/comment/38739887
has text: Thanks for your answer. Any way to hack it?
comment on: http://stackoverflow.com/a/24930806
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24925151
has body: So I am adding according to what I know. Here Shape is a function &amp; A function is just a special kind of object, and like any object a function can have properties. Functions automatically get a property called prototype, which is just an empty object. This object gets some special treatment. When you will do a new of a Function the created object inherits all of the properties of its constructor’s prototype. Like bellow var Shape = function () {}; Shape.prototype.name = 'Shape'; Shape.prototype.toString = function () { return this.name; } When you will say var Triangle = new Shape(); So what it does var Triangle = {}; Triangle.name = Shape.prototype.name Triangle.toString = Shape.prototype.toString; "it sets up the object Triangle to delegate to Shape.prototype." So when you will do Triangle.name //Shape Triangle.toString() // Shape But for Shape you will have to say Shape.prototype.name //Shape Shape.prototype.toString() //Shape
downvote count: 0
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24924872
answers question: http://stackoverflow.com/q/24924872
upvote count: 1
has comment: http://stackoverflow.com/comment/38732669
type: Answer

http://stackoverflow.com/comment/42420426
score: 0
type: Comment
has text: unfortunately I can't do +1 several times, I really like your answer!
comment on: http://stackoverflow.com/a/25008031
type: AnswerComment

http://stackoverflow.com/comment/38821667
comment on: http://stackoverflow.com/a/24974037
type: AnswerComment
score: 0
type: Comment
has text: Then the only way to achieve that is to do it purely on the client using javascript.

http://stackoverflow.com/a/24981575
type: Answer
has comment: http://stackoverflow.com/comment/38835320
answers question: http://stackoverflow.com/q/24981521
score: 0
has body: pure js way: var getParamFromURL = function(_url) { var url = _url; var _paraString = url.indexOf("&amp;") &gt; -1 ? url.substring(url.indexOf("?") + 1, url.length).split("&amp;") : url.substring(url.indexOf("?") + 1, url.length).split(''); var _paraObj = {}; for (i = 0; p = _paraString[i]; i++) { _paraObj[p.substring(0, p.indexOf("=")).toLowerCase()] = p.substring(p.indexOf("=") + 1, p.length); } return _paraObj; } via angular js: // Given: // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby // Route: /Chapter/:chapterId/Section/:sectionId // // Then $routeParams ==&gt; {chapterId:'1', sectionId:'2', search:'moby'} Great. @Cooper is right.
has comment: http://stackoverflow.com/comment/38835622

http://stackoverflow.com/q/24993017
has answer: http://stackoverflow.com/a/24993049
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24993049
tagged with: express
has body: Using nodeJs,ExpressJS(~4) This is my structure: controllers/searchController.js public/javascripts/search.js (js client code that will run on browser) public/search.html server.js app.js searchController.js: var express = require('express'); var router = express.Router(); var esService = require('../services/esService'); var Q = require('q'); var html_dir = './public/'; router.get("/home", function (req, res) { res.sendfile(html_dir + 'search.html'); }) router.get("/search", function (req, res) { ... }) module.exports = router; app.js: var express = require('express'); var path = require('path'); var favicon = require('static-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); var searchController = require('./controllers/searchController'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'hjs'); app.use(favicon()); app.use(logger('dev')); app.use(bodyParser.json()); app.use(bodyParser.urlencoded()); app.use(cookieParser()); app.use(require('less-middleware')(path.join(__dirname, 'public'))); app.use(express.static(__dirname, '/public')); app.use('/', searchController); /// catch 404 and forward to error handler app.use(function(req, res, next) { var err = new Error('Not Found'); err.status = 404; next(err); }); /// error handlers // development error handler // will print stacktrace if (app.get('env') === 'development') { app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: err }); }); } // production error handler // no stacktraces leaked to user app.use(function(err, req, res, next) { res.status(err.status || 500); res.render('error', { message: err.message, error: {} }); }); module.exports = app; search.html: .... ........ ... and this is search.js: function handleClick() { var inputParam = document.querySelector("#myinput").value; $.get('search?termToS…
score: 0
answer count: 1
tagged with: client
tagged with: node.js
type: AnsweredQuestion
type: Question
has title: Javascript client not executing the right nodejs/expressjs structure
linked to: http://stackoverflow.com/q/5178334

http://stackoverflow.com/a/24993460
answers question: http://stackoverflow.com/q/24993048
type: Answer
has comment: http://stackoverflow.com/comment/38858245
has comment: http://stackoverflow.com/comment/38866160
has comment: http://stackoverflow.com/comment/38868139
has comment: http://stackoverflow.com/comment/38869824
has comment: http://stackoverflow.com/comment/38857867
score: 0
has comment: http://stackoverflow.com/comment/38890063
has comment: http://stackoverflow.com/comment/38862897
has comment: http://stackoverflow.com/comment/38857766
has body: You must have a way to communicate over HTTP with your server side Python code. This could help. When you do, you communicate over HTTP. You will not invoke Python functions directly.

http://stackoverflow.com/q/24935819
has comment: http://stackoverflow.com/comment/38753232
tagged with: javascript
has comment: http://stackoverflow.com/comment/38751975
score: 0
has comment: http://stackoverflow.com/comment/38785607
has body: I've recorded using loadrunner, and Now I get .Net Framework &amp; script errors when I reload the script I recorded (web/http) in loadrunner I'm getting IE script error (invalid character) with a line number and character position &amp; a URL that starts htlfp:\WebViewer1*c:\script\scriptname\data\t13.html*http*address*webclient c:...\t13.html doesn't contain an invalid character - but it does contain lots of entries that start GrahamTechnology.ui.FormParagraph=function(a).... I guess this means its a reference to a "server command", which I cannot run because I'm no longer connected to the server from whence it was recorded? Does anyone know what htlfp stands for, is it generic or specific to GrahamTechnology? How do I make it go away, I thought I could stop it by disabling display Thumbnails in the scripting options - but that does not work ?
tagged with: loadrunner
has comment: http://stackoverflow.com/comment/38750010
type: UnansweredQuestion
answer count: 0
has title: Whats a url that starts with htlfp & whys it giving me an IE script error
type: Question
has comment: http://stackoverflow.com/comment/38753106
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/38842181
has comment: http://stackoverflow.com/comment/38842133

http://stackoverflow.com/a/24921883
score: 5
type: AcceptedAnswer
upvote count: 5
accepted answer of: http://stackoverflow.com/q/24918629
type: Answer
answers question: http://stackoverflow.com/q/24918629
has body: I think the problem is in the keyword "resources" on line 4 of your second snippet. Based on the documentation, it should be a "resource": * @param {object} params.resource - Request body data
downvote count: 0

http://stackoverflow.com/q/24923383
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38728381
has comment: http://stackoverflow.com/comment/38744975
tagged with: javascript
has comment: http://stackoverflow.com/comment/38728456
score: 0
tagged with: ruby-on-rails-4
has answer: http://stackoverflow.com/a/26622100
accepted answer: http://stackoverflow.com/a/26622100
answer count: 1
tagged with: jquery
tagged with: jquery-easing
has title: Uncaught TypeError: undefined is not a function (jQuery & jQuery Easing)
has comment: http://stackoverflow.com/comment/38726651
has body: I am building out a site. I built out the backend, and now I am doing the front-end. On the front end I have bootstrap, various font awesome icons, and angular. It should also be noted this is a rails app. I want to add 1 page scroll feature using jQuery &amp; jQuery easing, that is powered by a font-awesome arrow. I am obviously not doing something right, because when used it turns blue (thought maybe it was an "active state" because of the href?), and turns all of the font (everything) on my page blue. When in chrome's console, I get the error; Uncaught TypeError: undefined is not a function Which is referring to this line (might be arbitrary) in jQuery; this.pos = eased = jQuery.easing[ this.easing ]( Here is the rest of my code; index.html.erb &lt;div class="page-scroll" id="arrow"&gt;&lt;a href="#clients"&gt;&lt;i class="fa fa-chevron-down"&gt;&lt;/i&gt;&lt;a&gt;&lt;/div&gt; styles.css #arrow { font-size: 25px; color: grey; } main.js $(function() { $('.page-scroll a').bind('click', function(event){ $('html, body').animate({ scrollTop: $("#clients").offset().top }, 1500); event.preventDefault(); }); }); application.html.erb (thanks to another SO question, jQuery &amp; jQuery Easing placed under style sheets) &lt;!-- Easing for Page Scroll --&gt; &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js"&gt;&lt;/script&gt; &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.min.js"&gt;&lt;/script&gt; When I comment out the div in index, all font goes back to normal (it's blue when it's active). When I click on the button, it takes me to the element I want, but it drops you there, it doesn't have the easing aspect (which is why I am adding easing). I have searched a fair amount, and I am baffled about this (especially the changing of the text). Any help would be very appreciated.
tagged with: css
has comment: http://stackoverflow.com/comment/38726723

http://stackoverflow.com/comment/38841121
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24984184
score: 0
has text: Actually, this isn't proper valid HTML markup and the fiddle bugs when you hover the right "click" button.

http://stackoverflow.com/comment/38715774
comment on: http://stackoverflow.com/q/24917644
has text: Define it "on the fly" e.g. `obj.aFunction = function(x,y){....}` before using it
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/q/24999200
upvote count: 1
tagged with: strategy-pattern
type: Question
tagged with: dependency-injection
tagged with: javascript
has title: AngularJS: Inject strategies through dependency injection
downvote count: 0
favorite count: 0
has body: I am new in AngularJS DI, and I am wondering how to do things that I usually do in Ninject. I understand the limitations, so if it is not possible, a workaround will do. I have to create objects that handle different event types, I usually follow the strategy pattern, and with Ninject in C# I can use multi-injection to inject an array of strategies in the constructor of my strategy broker. The idea is that I would like to create more "handlers" (strategies) and add them to the AngularJS DI system, without alter common code. I have done this in JS before, by having an object where I can append the new strategies, but I wonder which is the right way of doing it in Angular. Would be possible somehow in Angular to do something similar?
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
score: 1

http://stackoverflow.com/q/25019149
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/25019960
type: Question
answer count: 2
has body: I have the code below using the script i am making stuff draggable and droppable. currently i have two pieces for draggable content, and two place they can be dropped if correct then the system will change and say correct, I would like to know if there is away that i would be able just create the HTML divs and the code runs through and matches the draggable to the dropable. I have people that have a non-technical backdround, have basic HTML knowledge so thy now how to add divs and remove them but they are able to deal with script, i would like to know, if i had ID of 1-10 for the draggable content and the same for the dropable 1-10 so id 1 draggable can only be added to id one droppable. I'm draggable but can't be dropped Drag me to my target accept: '#draggable' accept: '#draggable2'
possible better answer: http://stackoverflow.com/a/25019842
tagged with: javascript
tagged with: jquery
has title: drag and drop issue jquery
has answer: http://stackoverflow.com/a/25019842
score: 0
accepted answer: http://stackoverflow.com/a/25019960
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38906613

http://stackoverflow.com/q/25068238
has comment: http://stackoverflow.com/comment/39026129
tagged with: javascript
duplicate of: http://stackoverflow.com/q/17728705
score: 0
linked to: http://stackoverflow.com/q/2722159
has title: How can I find which index in an array contains an object whose value for a specific key is x?
type: UnansweredQuestion
answer count: 0
tagged with: underscore.js
has body: I want to find out which index(es) in the following array contains an object whose value for the key "id" is x. var arr1 = [ { "id":42, "name":"Object 42" }, { "id":99, "name":"Object 99" } ] So for that array, I would want to do this; findId(arr, 42); //returns '0' findId(arr, 99); //returns '1' How can I write a function that does that? This is different than the supposed duplicates, because those duplicates talk about filtering a simple array for a certain value. This question is trying to filter an array of objects where a certain key has a value of x. None of the duplicates solve the problem.
has comment: http://stackoverflow.com/comment/39025250
type: Question
linked to: http://stackoverflow.com/q/13594788
tagged with: object
has comment: http://stackoverflow.com/comment/38999235
has comment: http://stackoverflow.com/comment/38999331
linked to: http://stackoverflow.com/q/17728705
tagged with: arrays

http://stackoverflow.com/comment/38944613
comment on: http://stackoverflow.com/q/25039205
has text: it has to be `provideRouteAlternatives` and `stepResults = results.routes[0].legs[0].steps;`
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/24962063
has body: The line sjs --module ./macros.js my_sweet_code.js needs to be run on the command line on a system that has node.js and sweet.js installed. You can install node from here and once that's installed you can use the npm command on the command line to installed sweet.js: npm install -g sweet.js. With sweet.js installed you can then use the sjs command to compile code. Also, sweet.js is a Mozilla project it but works everywhere.
answers question: http://stackoverflow.com/q/24960334
upvote count: 1
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24960334
score: 1

http://stackoverflow.com/q/25045681
answer count: 3
downvote count: 0
possible better answer: http://stackoverflow.com/a/25056365
has comment: http://stackoverflow.com/comment/38957133
favorite count: 0
has comment: http://stackoverflow.com/comment/38956730
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38958473
has answer: http://stackoverflow.com/a/25049194
has body: So there are a handful of questions on StackOverflow addressing this error, but of the 10-15 I checked, I could not find a solution to my exact problem. I am running an Angular app (port 9000) and a Rails app (port 3000) on a remote server. The angular app sends requests to the rails app via a post request. When a request is made, the Javascript console shows this error message: XMLHttpRequest cannot load http://0.0.0.0:3000/api/query. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.241.16.159:9000' is therefore not allowed access. From what I've read, I need to change something about my Rails app so that it can accept connection from other servers (which seems odd because both apps are running on the same ec2 instance). I've tried adding a line like skip_before_filter :verify_authenticity_token to my controller in rails, but this seems to have no effect. How can I resolve this error?
accepted answer: http://stackoverflow.com/a/25049194
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38956961
score: 6
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/53986145
has answer: http://stackoverflow.com/a/25056365
has comment: http://stackoverflow.com/comment/38956878
type: Question
has title: XMLHttpRequest No 'Access-Control-Allow-Origin' header is present on the requested resource
has comment: http://stackoverflow.com/comment/38957418
upvote count: 6
tagged with: javascript

http://stackoverflow.com/comment/39000824
type: QuestionComment
has text: @StefanBaiu Ok, found it! I'm using angular, I was initializing the script like this: `$scope.$on('$includeContentLoaded' ...`. When clicking on `B`, I was firing another include request, resulting in another initialization of the script! Thanks for the hint!
comment on: http://stackoverflow.com/q/25068855
score: 0
type: Comment

http://stackoverflow.com/comment/38773980
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24948429
has text: What you want to do when click on list????

http://stackoverflow.com/a/24948474
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/38774089
has comment: http://stackoverflow.com/comment/38774433
downvote count: 0
has comment: http://stackoverflow.com/comment/38774478
has body: Ember does this with the SortableMixin. You can follow the same pattern. https://github.com/emberjs/ember.js/blob/v1.6.1/packages_es6/ember-runtime/lib/mixins/sortable.js#L247 forEach(sortProperties, function(sortProperty) { addObserver(item, sortProperty, this, 'contentItemSortPropertyDidChange'); }, this); }, this); } return this._super(array, idx, removedCount, addedCount); }, insertItemSorted: function(item) { var arrangedContent = get(this, 'arrangedContent'); var length = get(arrangedContent, 'length'); var idx = this._binarySearch(item, 0, length); arrangedContent.insertAt(idx, item); }, contentItemSortPropertyDidChange: function(item) { var arrangedContent = get(this, 'arrangedContent'), oldIndex = arrangedContent.indexOf(item), leftItem = arrangedContent.objectAt(oldIndex - 1), rightItem = arrangedContent.objectAt(oldIndex + 1), leftResult = leftItem &amp;&amp; this.orderBy(item, leftItem), rightResult = rightItem &amp;&amp; this.orderBy(item, rightItem); if (leftResult &lt; 0 || rightResult &gt; 0) { arrangedContent.removeObject(item); this.insertItemSorted(item); } },
answers question: http://stackoverflow.com/q/24947807
type: Answer

purescript
type: Tag
tags question: http://stackoverflow.com/q/24943335
tag name: purescript

http://stackoverflow.com/q/24964750
has comment: http://stackoverflow.com/comment/38804821
has answer: http://stackoverflow.com/a/24964774
answer count: 1
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/38805081
has title: Javascript array element undefined, it really isn't
has comment: http://stackoverflow.com/comment/38804836
accepted answer: http://stackoverflow.com/a/24964774
type: AnsweredQuestion
score: 1
downvote count: 1
type: Question
tagged with: google-maps
tagged with: javascript
has comment: http://stackoverflow.com/comment/38804922
has body: can someone explain this to me. The image below depicts the output in the Chrome console. When I log out the main object, the console shows all the properties. As you can see the array has a property named "markers", its not undefined, because I can browse through it. But when I try to log out this property, lets say object.markers, it says that the property is undefined. Now I am really confused, because as you can see I log them sequentially. First object is directionsRenderer. The second object is 'j' property of directionsRenderer. Third is 'markers' property of directionsRenderer 'j' property. Here is the source

http://stackoverflow.com/a/25018763
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38909889
answers question: http://stackoverflow.com/q/25018368
has body: How about sending back the updated model: [HttpPost] public ActionResult UpdateValue(MyViewModel model) { model.FileName = "NewValue"; return Json(model); } Then in your $.post you can read the response and update your field. As Brain Mains commented, you can't persist the model. Model is just nice way of accessing POSTed values. Let's assume you are posting more values than FileName. So instead of doing this: Request.Form["FileName"]; Request.Form["Id"]; Request.Form["Size"]; You just do this: model.FileName model.Id model.Size It's a lot cleaner and nicer to work with. So If you follow the process of posting data: User clicks a button > data is submitted via ajax > arrives to the asp.net engine > engine binds submitted data to the model > model is passed to controller > controller returns a result (and in this moment ... hackemate! ... the model is gone)

http://stackoverflow.com/comment/38953837
score: 0
type: Comment
has text: Hi Posted the code in main question, As I am not aware how to post the code in proper way in the comment, apologies for the trouble...
type: AnswerComment
comment on: http://stackoverflow.com/a/25043662

http://stackoverflow.com/comment/38962076
has text: I have a setting where I have multiple phrases. Each one has a corresponding translation. And each block is in a different paragraph, in different sections of the site. If I apply your solution all phrases get highlighted.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25048410

http://stackoverflow.com/q/25024910
has answer: http://stackoverflow.com/a/25123161
answer count: 1
type: UnansweredQuestion
has body: We have an application where we have multiple forms &amp; each form has submit button (ofcourse). The way we have made it work is have common submit button which has an event bound on click of that button to call formSubmit method on an object with name commonObject. Now, each javascript creates object with same name commonObject &amp; the formSubmit method gets called on each page perfectly fine. Complication arises when we have linked use cases &amp; lets say due to business logic, when customer submits formA, we need to redirect them to formB &amp; upon submission of formB, we need to take them back to formA. It can easily create loop, but that's what Business logic needs us to do. Behavior in such cases become very unpredictable &amp; Javascript invokes formSubmit on formA or formB. How do we ensure that it calls formSubmit only on the form that was loaded last?
has title: Need help to fix an issue aroused due to 2 javascript objects having same name but different constructors
tagged with: forms
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38917842

http://stackoverflow.com/comment/38990795
type: Comment
type: QuestionComment
has text: @adeneo in my experience, any _access_ to the `data` attributes causes the cache to be created, it's not just creation that does this.
score: 0
comment on: http://stackoverflow.com/q/25063664

http://stackoverflow.com/a/24910756
has comment: http://stackoverflow.com/comment/38702164
accepted answer of: http://stackoverflow.com/q/24910614
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38703053
upvote count: 1
answers question: http://stackoverflow.com/q/24910614
has body: Before the following $.each(data, function (i, val) { var opt = $("&lt;option&gt;&lt;/option&gt;") .attr("value", val.Value) .text(val.Text); $('#FaqCategorie_Id').append(opt); }); just write: $('#FaqCategorie_Id').empty(); This will remove all the items from your dropdown and then the new ones you have gottent from you ajax request will be appended to your dropdown.
has comment: http://stackoverflow.com/comment/38703690
has comment: http://stackoverflow.com/comment/38703084
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38703763

http://stackoverflow.com/a/24930440
type: Answer
score: 2
upvote count: 2
has body: Try, var test = $(".box span:not([class]), .box span[class='']"); Your code wont give expected result because, the second selector in the multiple selector does not have any context. so that it would search around the entire DOM. Your code can be shortened as, var cAmounts = $(".box span:not([class]").length;
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24930379
answers question: http://stackoverflow.com/q/24930379

http://stackoverflow.com/comment/38876716
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25003410
has text: Are you trying to get the value when the user clicks the anchor or all the values?

http://stackoverflow.com/q/24932938
possible better answer: http://stackoverflow.com/a/24933103
has comment: http://stackoverflow.com/comment/38743995
has title: How to pass data between different c# and javascript
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38744077
has answer: http://stackoverflow.com/a/24933720
accepted answer: http://stackoverflow.com/a/24933097
type: Question
tagged with: c#
has body: I have an ascx page with a div, when the div is clicked it calls a JS function and send an int //HTML Product //JavaScript function function userStartExtend(num) {} I need to use the num from userStartExtend function in a c# (file/page/code). I thought about querystring - set in javascript code and get in c# (possible?). Any other ideas ?? To make things clear : the c# code and javascript code dont share the same page.
has comment: http://stackoverflow.com/comment/38744431
score: -2
has answer: http://stackoverflow.com/a/24933097
has answer: http://stackoverflow.com/a/24933103
tagged with: javascript
answer count: 3
downvote count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38744208
tagged with: jquery
has comment: http://stackoverflow.com/comment/38744021
tagged with: asp.net
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24972901
tagged with: tinymce
possible better answer: http://stackoverflow.com/a/31341203
has answer: http://stackoverflow.com/a/31341203
upvote count: 2
has answer: http://stackoverflow.com/a/24993833
score: 2
type: AnsweredQuestion
tagged with: responsive-filemanager
tagged with: tinymce-4
type: Question
has title: How to set Responsive Filemanager to return absolute url in TinyMCE
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24993833
has body: Im using Responsive Filemanager v9.3 with TinyMCE I need to absolute url for inserting image url or any files. But it return relative path. I need to set image src like &lt;img src="http://domain.com/files/slide.jpg"&gt; but it return &lt;img src="../files/slide.jpg"&gt; My Config: $base_url= 'http://domain.com'; $upload_dir = '/files/'; $current_path = '../../files/'; $thumbs_base_path = '../thumbs/';
favorite count: 0

http://stackoverflow.com/comment/38708104
comment on: http://stackoverflow.com/a/24913805
type: Comment
has text: Urg, I feel the urge to hang myself to have been pushed to ask SO for a dumb error like this...
score: 0
type: AnswerComment

model-view-controller
tags question: http://stackoverflow.com/q/25065916
tags question: http://stackoverflow.com/q/24987383
tag name: model-view-controller
tags question: http://stackoverflow.com/q/24913224
tags question: http://stackoverflow.com/q/24976253
tags question: http://stackoverflow.com/q/25055878
type: Tag
tags question: http://stackoverflow.com/q/24954222
tags question: http://stackoverflow.com/q/25061243

http://stackoverflow.com/comment/38733686
comment on: http://stackoverflow.com/a/24913057
has text: @Pointy: You're quite right. I'll edit to something along the lines of _"an object owns a property, that is assigned a reference to a function object"_. It might be more confusing to the OP, but it is more accurate
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24920251
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24920186
has comment: http://stackoverflow.com/comment/38725052
has comment: http://stackoverflow.com/comment/38724791
has comment: http://stackoverflow.com/comment/38721103
has body: You can use style nodes inside the svg element. Example from MDN: <circle cx="50" cy="50" r="40" /> You can just append them like you would do in HTML. var style = document.createElement('style'); style.setAttribute("type", "text/css"); var svg = document.getElementsByTagName("svg")[0]; svg.appendChild(style);
has comment: http://stackoverflow.com/comment/38725063
has comment: http://stackoverflow.com/comment/38723777
has comment: http://stackoverflow.com/comment/38724045

http://stackoverflow.com/q/25038902
has answer: http://stackoverflow.com/a/25038975
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25039055
tagged with: browser
score: 0
has answer: http://stackoverflow.com/a/25038970
answer count: 3
tagged with: jquery
type: UnansweredQuestion
has title: Fields calculating only after a refresh
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38943354
has body: I apologize in advance for what I assume is a very basic question, but I am very new to scripting and would like to ask for some advice on a problem I am having. Essentially I am creating a website that should sum the dollar amounts of two fields based on hours worked and return a total dollar amount. One of the fields has a fixed dollar amount and the other is a variable. As far as I can tell the code should be working, but the field that should be user generated (esceptionalRate) seems to calculate correctly only after a page refresh, and then only on firefox... instead of automatically updating the total value when a change is made to the user field code as follows: and here's the HTML side: Total Amount Requested thanks in advance for all your wisdom and knowledge.
has comment: http://stackoverflow.com/comment/38943375

http://stackoverflow.com/a/24979869
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24978423
type: Answer
score: 11
upvote count: 11
has body: if (callBack != null) Sure, why not. Notice there are still many non-function values that pass this. if (typeof callBack == 'function') That's exactly what you want. if (callBack !== null) No. Does not work when callBack is undefined. if (callBack != undefined) Rather not. See How to check for "undefined" in JavaScript? for why null is favoured (though equivalent). try{ callBack(); } catch(err) {} Uh, possibly slower and swallowing any errors in the callback. If that is what you want, you should still combine it with one of the other tests. if (callBack && typeof(callBack) == "function") Redundant, but possibly faster than a mere typeof test. You will want to test this if you care about performance, otherwise there's hardly a reason to be so verbose. if (callBack) Sure, why not. Notice there are still many truthy non-function values that pass this. if (typeof window[callBack] === 'undefined') No. This is absolutely doing a very different thing. if (callBack instanceof Function) This should work for everything but some extreme edge cases, but using typeof is safer (and faster).
accepted answer of: http://stackoverflow.com/q/24978423

http://stackoverflow.com/a/25067276
accepted answer of: http://stackoverflow.com/q/25066880
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/25066880
has body: The problem is (besides syntax errors in code snippets) that you're using text binding instead of html binding. So just replace with
score: 0

http://stackoverflow.com/a/25039393
has comment: http://stackoverflow.com/comment/38945433
has comment: http://stackoverflow.com/comment/38946092
upvote count: 1
answers question: http://stackoverflow.com/q/25039308
score: 1
has comment: http://stackoverflow.com/comment/38944563
downvote count: 0
has body: You should use promise in order to write the code in sync way but execute it in async. https://docs.angularjs.org/api/ng/service/$q
type: Answer

http://stackoverflow.com/q/25015714
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38899808
tagged with: android
tagged with: php
has body: I have been searching over the internet and I did not get any answer for launching instagram application from website link in android mobile . I have to launch instagram app from my website. My website will have a link to launch instagram application. I tried "instagram://" hooks .. It is working for ios..I did not find anything for android.Please help me out.
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38900122
downvote count: 0
has title: launch instagram application from website link in android mobile
favorite count: 0

http://stackoverflow.com/comment/78975595
comment on: http://stackoverflow.com/a/28190635
score: 0
type: Comment
has text: `beforeEach` and `afterEach` receive the browser object. `before` and `after` only receive the `done` callback.
type: AnswerComment

http://stackoverflow.com/q/24976702
score: 1
type: Question
tagged with: javascript
has body: I'm trying to have a FileSelect dialogue box pop open without user interaction, but it doesn't work and I don't understand why. In this example, I am trying to have it opened by the window.onload function, but it doesn't do anything. The console output shows that the "simulateclick()" function is executed, but I don't see the dialogue box. When I use the 'test' button instead, it works fine. Also calling "document.getElementById('files').click()" from the console has no effect whatsoever. Can anybody explain? &lt;html&gt; &lt;body&gt; &lt;input type="file" id="files" name="files[]" multiple&gt; &lt;input type="button" id="test" value="test"&gt; &lt;script&gt; function simulateclick(){ console.log("before"); var elem = document.getElementById('files'); console.log(elem); elem.click(); console.log("after"); }; window.onload = simulateclick; document.getElementById('test').onclick = simulateclick; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;
has title: open FileSelect dialog programmatically
has comment: http://stackoverflow.com/comment/38826748
upvote count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
downvote count: 0

http://stackoverflow.com/comment/38904793
comment on: http://stackoverflow.com/q/25018152
type: Comment
type: QuestionComment
has text: you can do ng-repeat on columns
score: 0

http://stackoverflow.com/comment/38936135
type: Comment
type: QuestionComment
has text: I see. Could you show how the `svgGraphic` directive is used inside `ng-repeat`? The `ng-repeat` will call `$destroy()` for each removing item directly, so I guess there is something that introduce a new scope and make the `svgGraphic` has a different scope than the one from `ng-repeat`.
comment on: http://stackoverflow.com/q/25015947
score: 0

http://stackoverflow.com/a/24942031
type: Answer
answers question: http://stackoverflow.com/q/24941735
score: 1
has body: I think it's possible to just drop the declaration of the new row. Delete the second so that more than 3 elements are in your grid row. The new structure would be like this: ... ... ... ... ... ... Updated fiddle: http://jsfiddle.net/WekyP/
upvote count: 1
has comment: http://stackoverflow.com/comment/38761963
has comment: http://stackoverflow.com/comment/38762841
accepted answer of: http://stackoverflow.com/q/24941735
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38763081

http://stackoverflow.com/q/25067898
has body: I have a controller in my Angular app: (function (angular) { function MyController() { this.name = 'Dave'; // I want to have code like this: /* $scope.$watch('name', function (newValue, oldValue) { console.log(oldValue, "changed to", newValue); }); */ } window.myApp = angular.module('myApp', []) .controller('MyController', [MyController]); })(angular); Is there a way to use the features of $scope.$watch when attaching values to the MyController prototype? I did notice that in my code, if I add something like ng-controller="MyController as myCtrl", and change my $scope.$watch statement to $scope.$watch('myCtrl.name', ...), it'll work after I add the $scope dependency, but that feels like tying my controller to my views, which feels wrong. Edit To attempt to clarify on what I'm asking. My HTML is something like this: &lt;div ng-app="myApp"&gt; &lt;div ng-controller="MyController as myCtrl"&gt; &lt;input type="text" ng-model="myCtrl.name" /&gt; &lt;p&gt;{{myCtrl.helloMessage}}&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; My controller is something like this: angular.module('myApp', []) .controller('MyController', ['$scope', function ($scope) { this.name = 'World'; this.helloMessage = "Hello, " + this.name; var self = this; $scope.$watch('myCtrl.name', function () { self.helloMessage = "Hello, " + self.name; }); }]); That currently works, but as you can see, in the $watch call, I have to reference my controller by the controllerAs name from my view, which is less than ideal. I've setup an example on Plunkr
tagged with: javascript
tagged with: angularjs-scope
possible better answer: http://stackoverflow.com/a/25068588
has answer: http://stackoverflow.com/a/25068588
score: 5
answer count: 3
has title: Using $scope.$watch when using `this` scope in controller
upvote count: 5
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39044245
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25069044
has answer: http://stackoverflow.com/a/25068008
accepted answer: http://stackoverflow.com/a/25069044
favorite count: 0
type: Question

http://stackoverflow.com/comment/38962684
comment on: http://stackoverflow.com/q/25047497
has text: Incidentally, CSS3 animations are not supported in IE<10. http://caniuse.com/css-animation
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25053669
has body: This will give you what you want to return var key = Object.keys(data.query.pages)[0] //return 856 data.query.pages[key].revisions[0]["*"]
has comment: http://stackoverflow.com/comment/38971568
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38971412
accepted answer of: http://stackoverflow.com/q/25053584
type: Answer
answers question: http://stackoverflow.com/q/25053584

http://stackoverflow.com/comment/38771080
score: 0
type: Comment
has text: Yes: you need a backend technology. I don't know what are you using (PHP, NodeJS, Python, Java, ...). I don't know what preconfigured packages or app do you have, but accessing a database involves a password, and in such way... you need server-side (this means: having a database password in client-side is an open door for malicius lammers to your site). So: once you decide what server-side technology to use, you'll discover on your own what technology fits your needs.
type: AnswerComment
comment on: http://stackoverflow.com/a/24945027

http://stackoverflow.com/comment/38826543
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24976123
has text: I left that `writeHead()` code commented, but there in case it helps. Should I remove that to make the code snippet more readable?
score: 1

http://stackoverflow.com/q/25007599
upvote count: 1
has comment: http://stackoverflow.com/comment/38884614
has comment: http://stackoverflow.com/comment/38884565
score: 1
tagged with: traversal
type: Question
tagged with: infinite-loop
has comment: http://stackoverflow.com/comment/38884632
downvote count: 0
answer count: 1
tagged with: javascript
has title: Javascript infinite loop traversing Javascript object
favorite count: 0
has body: This process, traversing a Javascript object is causing an infinite loop. The same code seems to work if I call it on initialize instead of on the key up event...Thanks for any help! &lt;form&gt; &lt;input id="searchBox" name="searchText" placeholder="Search" onkeyup="search()"&gt; &lt;/form&gt; &lt;script src="http://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt; &lt;script&gt; var searchText = "" function search(){ searchText = document.getElementById('searchBox').value; traverse(jsonData,process); } //traverse JSON object function traverse(json,func) { for (var i in json) { func.apply(this,[i,json[i]]); if (json[i] !== null &amp;&amp; typeof(json[i])=="object") { console.log("STEP IN"); traverse(json[i],func); } } }
has comment: http://stackoverflow.com/comment/38885126
has comment: http://stackoverflow.com/comment/38884647
has answer: http://stackoverflow.com/a/25007799
type: UnansweredQuestion

http://stackoverflow.com/q/25046912
type: Question
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38959192
answer count: 2
downvote count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25046949
type: UnansweredQuestion
has title: What is correct syntax for Jquery done()?
has body: I have the following syntax: And am receiving the following error on line 6: Uncaught SyntaxError: Unexpected token { I read the api docs on done() and I can't see what I am doing wrong here.
upvote count: 0
has answer: http://stackoverflow.com/a/25046951

http://stackoverflow.com/comment/38780992
score: 0
has text: @JaimeGómez: Actually it does matter. Order of loading in JavaScript matters a lot.
comment on: http://stackoverflow.com/q/24952031
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25002023
type: Question
has comment: http://stackoverflow.com/comment/38874239
has answer: http://stackoverflow.com/a/36535033
tagged with: javascript
has comment: http://stackoverflow.com/comment/38875025
tagged with: express
has comment: http://stackoverflow.com/comment/38876931
answer count: 3
has answer: http://stackoverflow.com/a/25007831
upvote count: 1
favorite count: 0
has title: Express js external javascript file not loading
has comment: http://stackoverflow.com/comment/38877979
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25008925
tagged with: node.js
downvote count: 0
score: 1
has body: I use an express app to serve an static pre-compiled jade file. which includes a external javascript file. but its not loaded while the page gets loaded. but i can access the javascript by the express static/public url. Why its not loading on the html? app.js var express = require('express'), path = require('path'), sass = require('node-sass'); var app = express(); /* default configurations */ app.set('views', __dirname + '/public'); app.engine('html', require('ejs').renderFile); app.use(express.static(path.join(__dirname, 'public'))); /* routes */ app.get('/', function(req, res) { res.send('Hello World'); }); app.get('/home', function(req, res) { res.render('index.html'); }); module.exports = app; index.html &lt;body&gt; &lt;script type="text/javscript" src="/scripts/site.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; window.onload = function() { Site.View.init(); } &lt;/script&gt; &lt;/body&gt; site.js var Site = Site || {}; Site.View = { init : function() { alert('view'); } }; When i open the page in browser i get ReferenceError: Site is not defined Thanks.

http://stackoverflow.com/q/24950589
tagged with: javascript
tagged with: jquery
has title: How can I run function for each element in different time?
accepted answer: http://stackoverflow.com/a/24950656
possible better answer: http://stackoverflow.com/a/24950644
has answer: http://stackoverflow.com/a/24950644
has answer: http://stackoverflow.com/a/24950655
has body: I need to know, how can I run one function for each element I select. This is my jQuery code: $(function() { $(".line").each(function() { var dot = $(this).find('.dot'); setTimeout(function () { moveDot(dot); }, 250); }); }); It could run moveDot() for each element (every after 250ms), but now, all elements starts at the same time. Here is JSFIDDLE.
answer count: 5
has answer: http://stackoverflow.com/a/24950668
type: AnsweredQuestion
score: 0
has answer: http://stackoverflow.com/a/24951513
has answer: http://stackoverflow.com/a/24950656
type: Question

http://stackoverflow.com/q/25019874
score: 2
downvote count: 0
has body: I have a scene with many Object3D objects containing blocks, cylinders and meshes. I also have a perspective camera and use trackballcontrols. What I need is a way to set the camera position without modifying the FOV or the camera angle and insure that all objects in the scene are visible on screen. I have successfully done this with preset top, bottom, left and right views using the bounding box of the entire scene, but I need this to work from any camera angle since the user can rotate the view using trackball controls into any position. If there were a way to get a 2d bounding rectangle based on the camera position, target and the list of objects, I think I could get it to work, but I am having trouble finding how to do this. The functionality would work like this: With a scene containing many objects, the user rotates the camera with the mouse to some arbitrary position and then clicks a "Zoom All" button. Then, the camera is zoomed(moved) out or in(keeping FOV constant) to make all objects fit to the screen.
type: Question
upvote count: 2
answer count: 1
tagged with: javascript
tagged with: zooming
has answer: http://stackoverflow.com/a/29945489
has title: How can I implement ZoomAll functionality from any camera angle in Three.js?
favorite count: 0
tagged with: perspectivecamera
type: UnansweredQuestion
tagged with: three.js

http://stackoverflow.com/comment/38940868
score: 2
has text: `var spclchars = Array.apply(0,Array(256)).reduce(function(s,_,i){ var v=String.fromCharCode(i); return /[a-zA-Z0-9\-\_]/.test(v) ? s+v : s }, "")`
comment on: http://stackoverflow.com/q/25037608
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38998704
has text: @I didn't understand: yes it's only digits
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25067756
score: 0

http://stackoverflow.com/a/51128609
answers question: http://stackoverflow.com/q/24943159
score: 0
type: Answer
has body: Tyger, You are going about this wrong. This is how one captures the output html of a Server.Execute command: Dim sw As New StringWriter() Server.Execute("SvgForm.aspx", sw) Dim htmlCode As String = sw.ToString Be careful about passing data around as session variables. I think I ran into troubles because Server.Execute() seems to cache replies into the context of the current session. So subsequent changes to session variables may not lead to subsequent changes of the content generated by Server.Execute(), at least in the scope of the current user. Although empirical, this is the only viable explanation for some rather crazy behavior I've seen. Safer might be to append a random to the requested URI, to bust the cached session (user) specific response. Server.Execute("SvgForm.aspx?rand=" &amp; MyRandomNumberGenerator(), sw) I'm going to test this theory to find out for sure...

http://stackoverflow.com/q/24974491
downvote count: 0
duplicate of: http://stackoverflow.com/q/8181061
score: 1
has comment: http://stackoverflow.com/comment/38826267
has comment: http://stackoverflow.com/comment/38829743
type: Question
tagged with: browser
upvote count: 1
tagged with: javascript
tagged with: jquery
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/38822582
has title: Execute javascript on whole dom is loaded
favorite count: 0
answer count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8181061
has body: I am working on my google chrome extension i wanted my script which is in "content_scripts" to be start executing after the whole dom(window) is loaded , i have tried to add window.onload on my javascript but it did not work?
tagged with: google-chrome

http://stackoverflow.com/a/24940924
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/24940798
score: -1
upvote count: 0
has body: You could change your selectors to tr.Yes:not(.override) so that they do not take effect when the override class is in effect. Otherwise, both the tr.Yes and the tr.override styling will be merged, and anything from tr.Yes that is not overridden by tr.override will remain.

http://stackoverflow.com/a/24923124
downvote count: 0
upvote count: 8
type: AcceptedAnswer
has body: The getDataTable method returns whatever object is passed to the ChartWrapper's dataTable parameter. In the case of Dashboards, the ChartWrapper actually receives a DataView, not a DataTable. There are a couple of different approaches you can take to "remove" the column, depending on what you want to accomplish by removing it. If all you need to do is read from the data, ignoring the first column, the simplest solution is to iterate over the columns starting at index 1, not 0. You can also create a new DataView based on the existing data and restrict the columns in the view, eg: var view = new google.visualization.DataView(dataTableTmp); view.setColumns([1, 2, 3, 4 /* etc... */]); You can also convert the DataView to an actual DataTable, and then remove the column from the DataTable: var dt = dataTableTmp.toDataTable(); dt.removeColumn(0);
answers question: http://stackoverflow.com/q/24913145
type: Answer
accepted answer of: http://stackoverflow.com/q/24913145
score: 8

http://stackoverflow.com/a/25046367
type: Answer
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38958076
answers question: http://stackoverflow.com/q/25046269
has comment: http://stackoverflow.com/comment/38958481
has body: The code you have provided provides an array. If this is is representative of your code, you can then iterate over the objects in the array using a for loop: If you assign the provided code to a variable named array, you can use this code to iterate over the items in the array. Once you do that, you can then access the properties of the objects inside using the dot operator, locating and updating the correct item. function echo (text){ document.getElementById("output").innerHTML += text + "&lt;br/&gt;" } var array = [ { "_id":68917, "Distance":8.81, "Lat":"42.65322175", "Lon":"-73.77398886" }, { "_id":131277, "Distance":"9.86", "Lat":"42.654658", "Lon":"-73.805866" }, { "_id":62450, "Distance":6.58, "Lat":"42.67457566", "Lon":"-73.74902171" }]; echo("First item's distance " + array[0].Distance); for(var i = 0; i &lt; array.length; i++){ if(array[i]._id === 68917){ echo("Found item "+array[i]._id); array[i].Distance = 4.45; } } echo("First item's distance " + array[0].Distance); I created a JS Fiddle that demonstrates this solution works; http://jsfiddle.net/gB5Nn/2/
downvote count: 0

http://stackoverflow.com/a/25057088
has comment: http://stackoverflow.com/comment/38978134
upvote count: 2
has comment: http://stackoverflow.com/comment/38977916
answers question: http://stackoverflow.com/q/25056441
has comment: http://stackoverflow.com/comment/38979033
has body: You are looking for Providers. There are three different types: Factories, Services, and Providers. Each is a bit different you can take a look at this summary. Providers can allow you to share common methods, functions and data between different areas of your application without duplicating code. Short example - Fiddle html Random {{display.value}} javascript angular.module('myApp', []) .controller('testController', ['$scope','myService', function($scope, myService) { $scope.display =new myService(); $scope.ClickMe = function() { $scope.display.apiMethod1(); }; }]) .factory('myService', function() { function factory() { this.value = "Hello World"; this.apiMethod1 = function() { this.value = Math.floor( Math.random() * 2 ); }; } return factory; });
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/38981399
score: 0
type: QuestionComment
has text: After reading through your edited question, this doesn't seem to be a prefligth issue. This seems to be some issue with the emulator. You could try to capture the http request sent by the emulator to the server, to compare with the http request sent by your browser.
comment on: http://stackoverflow.com/q/25039515
type: Comment

rtmp
tag name: rtmp
type: Tag
tags question: http://stackoverflow.com/q/24973342

http://stackoverflow.com/q/25058992
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25059113
has body: akjdfalfkdj akjdfautlfkdkjkhkj akjdfalfkdiyukjkhkj akjdfalfkdkkljjkhkj prev next CSS #slider-wrapper {width:500px; height:200px;} #slider {width:500px; height:200px; position:relative;} .sp {width:500px; height:200px; position:absolute;} #nav {margin-top:20px; width:100%;} #button-previous {float:left;} #button-next {float:right;} JQUERY $(document).ready(function(){ $('.sp').first().addClass('active'); $('.sp').hide(); $('.active').show(); $('#button-next').click(function(){ $('.active').removeClass('active').addClass('oldActive'); if ( $('.oldActive').is(':last-child')) { $('.sp').first().addClass('active'); } else{ $('.oldActive').next().addClass('active'); } $('.oldActive').removeClass('oldActive'); $('.sp').fadeOut(); $('.active').fadeIn(); }); $('#button-previous').click(function(){ $('.active').removeClass('active').addClass('oldActive'); if ( $('.oldActive').is(':first-child')) { $('.sp').last().addClass('active'); } else{ $('.oldActive').prev().addClass('active'); } $('.oldActive').removeClass('oldActive'); $('.sp').fadeOut(); $('.active').fadeIn(); }); }); I have the above jquery slider all i need to have a timeout function which the slider slides automatically and as well i need it to slide according to the prev and next buttons. Thanks in advance DEMO
type: Question
has answer: http://stackoverflow.com/a/25059590
accepted answer: http://stackoverflow.com/a/25059590
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/25059295
has answer: http://stackoverflow.com/a/25059295
tagged with: javascript
tagged with: jquery
has title: Slider need animation on timeout function
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38793729
type: Comment
has text: Sorry, I meant an error response is returned, as apposed to success, when the title and embed code of the video have been successfully stored in the database - right now, no insert takes place
type: QuestionComment
comment on: http://stackoverflow.com/q/24959266
score: 0

http://stackoverflow.com/q/24995268
score: 4
has title: Automatic properties
possible better answer: http://stackoverflow.com/a/24995706
upvote count: 4
answer count: 2
downvote count: 0
favorite count: 0
has body: I am creating an application using Backbone which follows the structure below: App = { Models: {}, Views: {}, Collections: {}, Routers: {} }; When designing an object – in this case, a View –, I do the following: App.Views.ProductsView = Backbone.Model.extend(); But, I want something like: App.Views.Products.IndexView = Backbone.Model.extend(); What's the big deal? If I previously declare App.Views.Products = {}, everything will work – but I want to do it automatically; without any previous declaration. Based on my problem, can you give me an idea?
tagged with: backbone.js
has answer: http://stackoverflow.com/a/24995706
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24995296
accepted answer: http://stackoverflow.com/a/24995296
tagged with: javascript

http://stackoverflow.com/comment/39106938
comment on: http://stackoverflow.com/a/25090453
type: AnswerComment
score: 0
type: Comment
has text: Here is the same fiddle with `#wrapper` removed, notice it won't work because nothing is scrollable. [JSFiddle](http://jsfiddle.net/PalinDrome555/2h7Zt/4/)

http://stackoverflow.com/a/25037987
has body: You have only to include dragdealer.js and dragdealer.css. Yasmine and simulate are for unit testing. Demo: http://jsfiddle.net/IrvinDominin/9za8m/
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25037570
accepted answer of: http://stackoverflow.com/q/25037570
upvote count: 2
type: AcceptedAnswer

http://stackoverflow.com/comment/39152642
type: AnswerComment
has text: Thanks @MaX. I did replace in the jsfiddle and had originally tried this too... I still see "ori is:undefined " in the console log.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25125725

http://stackoverflow.com/q/24960345
has body: I'm learning programming starting with Javascript, and my instructor had us doing a random dice roll, a simple Math.ceil(6*Math.random()) I was trying to slightly gameify it and judge the result. So, if you roll a 7, you win, any other roll you lose. The ultimate result would be, "You rolled a: 7 You win!" However, I attempt to accomplish by saying approximately: console.log("You rolled a: " + diceSum); if (dicesum() == 7) { console.log("You win!"); } else { console.log("Aw... you lose. Better luck next time"); } diceSum() function evaluates each time, so I may get "You rolled a: 7" and "Aw... you lose" because the first roll was a 7, but by the time the if statement came in, the diceSum was something different. How do I generate a random number like a dice roll and then reuse its value over and over? Here's my current code (there is far more than necessary because I'm trying to display the values so I know if it is returning the correct answer): //Functions //Generate a random single roll of a dice var getDieRoll = function() { return Math.ceil(6*Math.random()); }; //Sum up two dice rolls var diceSum = function() { var firstDie = getDieRoll(); var secondDie = getDieRoll(); return firstDie+secondDie; }; // //Variables //Check to see if total sum of the roll is 7 var winMsg = "Winner!" var loseMsg = "Aw... you lose. Better luck next time." // //Outputs //show total sum to compare with message below console.log(diceSum()) //Return a message stating the result console.log("You rolled a " + diceSum()) //View true false status to compare with message returned below console.log(diceSum()==7) //If diceSum is a 7, give winning message, otherwise give losing message if (diceSum()==7){ console.log(winMsg); } else { console.log(loseMsg); }
tagged with: node.js
has comment: http://stackoverflow.com/comment/38795728
has comment: http://stackoverflow.com/comment/38795803
score: 0
has title: How to generate a random number only once, and reuse its output?
has comment: http://stackoverflow.com/comment/38795669
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24960500
possible better answer: http://stackoverflow.com/a/24960378
tagged with: random
answer count: 2
has answer: http://stackoverflow.com/a/24960378
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24960500

http://stackoverflow.com/a/24951247
has body: You can set typeahead-editable="false" and add ng-blur directive please see here: http://plnkr.co/edit/vcJsfd5ZuwYvirpIGAOx?p=preview HTML: Model: &lt;input type="text" typeahead-editable="false" ng-blur="clear()" ng-model="selected" typeahead="state for state in states | filter:$viewValue | limitTo:8" class="form-control"&gt; js: $scope.clear = function() { if ($scope.selected === undefined) { $scope.selected = ''; }
type: Answer
answers question: http://stackoverflow.com/q/24949862
has comment: http://stackoverflow.com/comment/38798307
score: 0
has comment: http://stackoverflow.com/comment/38798814

http://stackoverflow.com/comment/38782795
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24952664
has text: @hkhan you have to upload aspx page, to CRM Server either as a separate Website or to the ISV folder. and then use IFrame to display page.

http://stackoverflow.com/a/25120655
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25067186
has comment: http://stackoverflow.com/comment/75523255
upvote count: 2
answers question: http://stackoverflow.com/q/25067186
type: AcceptedAnswer
has body: You need to add the JavaScript "nature" to the project (basically, tell Eclipse to treat it as a JavaScript project). Right-click on the project and choose Configure > Convert to JavaScript Project.... After doing that you should see a Builder named "JavaScript Validator" and have the JavaScript section in the properties.
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/79248949

http://stackoverflow.com/q/25030046
downvote count: 1
accepted answer: http://stackoverflow.com/a/25030114
tagged with: jsfiddle
tagged with: javascript
has body: I am looking for an installable code playground, possibly for HTML, CSS and Javascript. I am a computer science professor and in one of my courses I teach basic HTML, CSS and some Javascript. I would like to introduce my students to code playgrounds such as jsfiddle or jsbin. Additionally, I would like to deliver final exams through a similar tool, so that we replace tests written on paper with tests performed, self-assessed and refined on a browser-based tool. The problem is that I do not want to let students access the Internet during the exam, and look for existing answers online or even establish communication channels among themselves or with experts at home, so I need to isolate the lab from Internet during the exams. This means that I need to install a local copy of the playground tool on one of my servers. Do you know of any tool that provides their code (free or commercially, not relevant) for a local installation? I don't need anything fancy, no automatic includes, no libraries, nothing special, just the possibility to install something on my server that runs without Internet dependencies. Thanks in advance for your suggestions.
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: jsbin
favorite count: 0
has answer: http://stackoverflow.com/a/25030114
type: Question
upvote count: 1
tagged with: css
answer count: 1
score: 0
has title: Installable code playground

http://stackoverflow.com/q/24986608
tagged with: javascript
type: Question
has body: With Socket.io, I'm querying all connected clients to get a status on whether or not they are ready to do something. Once they have all responded back, I want to emit an event. How can I check whether or not each client has responded, assuming that I already know how many clients are connected? Right now, the code looks like this: var totalClients = 2; //countClientSockets(); var readyClients = 0; socket.on("syncReady", function() { debug.log("Client is ready!"); readyClients++; debug.log("Ready Clients: " + readyClients + "/" + totalClients.length); if (readyClients == totalClients.length) { debug.log("Room is synced! Sending start event..."); io.sockets.emit("play"); } else { debug.log("Room is not synced yet! Waiting..."); } }); However, this results in the console output (after both clients have gotten ready and responded): [Debug][Handler]: Client is ready! [Debug][Handler]: Ready Clients: 1/2 [Debug][Handler]: Room is not synced yet! Waiting... [Debug][Handler]: Client is ready! [Debug][Handler]: Ready Clients: 1/2 [Debug][Handler]: Room is not synced yet! Waiting... I would like it to output: [Debug][Handler]: Client is ready! [Debug][Handler]: Ready Clients: 1/2 [Debug][Handler]: Room is not synced yet! Waiting... [Debug][Handler]: Client is ready! [Debug][Handler]: Ready Clients: 2/2 [Debug][Handler]: Room is synced! Sending play event... What would be a better way to do this?
score: 0
has answer: http://stackoverflow.com/a/24986939
has title: Socket.io: How can I check to see if a certain number of clients have emitted an event?
answer count: 1
tagged with: node.js
tagged with: socket.io
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24986939

http://stackoverflow.com/comment/38820377
type: Comment
comment on: http://stackoverflow.com/a/24973294
type: AnswerComment
has text: Well, I don't see any s in the code your provided. If you had some of them and they were clicked, it would return their id attribute.
score: 0

http://stackoverflow.com/a/24988499
answers question: http://stackoverflow.com/q/24988270
upvote count: 3
has comment: http://stackoverflow.com/comment/38848919
has comment: http://stackoverflow.com/comment/38848997
score: 3
has comment: http://stackoverflow.com/comment/38849612
has body: The jQuery addClass method has an overloaded method which accepts a function as a parameter. You can leverage that to set the class for all of the elements at once: $(function() { $('select[name="SELECT___ENG_SVC___52"] option').addClass(function() { return 'f' + $(this).val(); }); });
has comment: http://stackoverflow.com/comment/38849453
accepted answer of: http://stackoverflow.com/q/24988270
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38849585
type: Answer
has comment: http://stackoverflow.com/comment/38849029

http://stackoverflow.com/comment/38936859
type: QuestionComment
comment on: http://stackoverflow.com/q/25035197
has text: You added a timeout, so 'Auth' is not set when calling console.log, could you give use the controller which loads Auth in your case ?
score: 0
type: Comment

http://stackoverflow.com/comment/38859062
comment on: http://stackoverflow.com/q/24990076
score: 0
type: Comment
type: QuestionComment
has text: Oops I think I was wrong. As per the documentation, it says Ext.get returns Dom element and not Ext Component. I need to find Ext Component. Any help please?

http://stackoverflow.com/comment/47460882
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/27415497
score: 4
has text: @HarryMoreno buy an android!

http://stackoverflow.com/q/25013378
has body: ClickableRectangle.qml import QtQuick 2.0; Rectangle { width: 40; height: 40; x: 0; y: 0; // Fluorescent green color:'#23FF23'; border.color: 'black'; border.width: 2; radius: 100 property int key; signal iHaveBeenCalled (var key); MouseArea { anchors.fill: parent; onClicked: { iHaveBeenCalled.call (0, key) } } } GUIControllers.js .import "GlobalVariablesAndFunctions.js" as GlobalVariablesAndFunctions function createDynamicRectangles () { /// Returns a Component object created using the QML file at the specified url, or null if an empty /// string was given. var component = Qt.createComponent ("ClickableRectangle.qml"); /// The returned component's Component::status property indicates whether the component was /// successfully created. if (component.status === Component.Ready) { /// arrayOfXAxixOfPoints and arrayOfYAxixOfPoints are the arrays holding x and y axis coordinates /// of the rectangles (respectively) to be plotted. /// Both these arrays are techincally supposed to have equal number of points which will the /// determine number of rectangles to be plotted. for (var i = 0; i &lt; GlobalVariablesAndFunctions.arrayOfXAxixOfPoints.length; i++) { dynamicRectangles[i] = component.createObject (vehicleDrivingAreaRect, {x: 0, y: 0}) /// After an object of the component is created at a specified default position (0, 0) in our /// case, we can calculate and reset its position and other properties at leisure as follows. dynamicRectangles[i].x = GlobalVariablesAndFunctions.arrayOfXAxixOfPoints[i] - (dynamicRectangles[i].width / 2) dynamicRectangles[i].y = GlobalVariablesAndFunctions.arrayOfYAxixOfPoints[i] - (dynamicRectangles[i].height / 2) } numberOfDynamicRectanglesActive = GlobalVariablesAndFunctions.arrayOfXAxixOfPoints.length } } main.qml import QtQuick 2.0 import "GUIControllers.js" as GUIControllers Rectangle { id: rootContainer width: 360 height: 360 Text { text: qsTr("Hello World") anchors.centerIn: parent } MouseArea { anchors.fill: parent onClicked: { GUIC…
has answer: http://stackoverflow.com/a/25014028
type: AnsweredQuestion
downvote count: 0
favorite count: 0
has title: ReferenceError: Component is not defined - QML Dynamic object creation
type: Question
score: 5
accepted answer: http://stackoverflow.com/a/25014028
answer count: 1
tagged with: qt
tagged with: qml
upvote count: 5
tagged with: javascript
tagged with: qtquick2

http://stackoverflow.com/comment/38985542
type: AnswerComment
has text: [No, it's not](http://stackoverflow.com/a/16105890/1048572) - imagine your `Class` does not overwrite `SuperClass::do`, you'll get infinite recursion similar to [this example](http://stackoverflow.com/a/24700014/1048572)
type: Comment
score: 2
comment on: http://stackoverflow.com/a/25060720

http://stackoverflow.com/comment/38899618
type: AnswerComment
has text: While on the point of exception handling - I'd also recommend this http://stackoverflow.com/questions/21800010/how-do-i-handle-errors-with-promises and http://stackoverflow.com/questions/22519784/how-do-i-convert-an-existing-callback-api-to-promises/22519785#22519785
type: Comment
comment on: http://stackoverflow.com/a/25014748
score: 0

http://stackoverflow.com/a/59256171
has comment: http://stackoverflow.com/comment/134142143
downvote count: 0
answers question: http://stackoverflow.com/q/24939623
score: 9
has body: Much has changed with hooks, e.g. componentWillReceiveProps turned into useEffect+useRef (as shown in this other SO answer), but Props are still Read-Only, so only the caller method should update it.
type: Answer
upvote count: 9

http://stackoverflow.com/q/24986814
has comment: http://stackoverflow.com/comment/38845740
possible better answer: http://stackoverflow.com/a/24986912
accepted answer: http://stackoverflow.com/a/24986891
type: AnsweredQuestion
has body: I want to create a mutable reverse method for a javascript string. TL; DR: Here is my attempt that did not work: String.prototype.reverse = function() { var reversed = {}; j = 0; for (i = this.length - 1; i &gt;= 0; i--) { reversed[j++] = this[i]; } for (i in reversed) { this[i] = reversed[i]; } }; ... str1 = "hello"; str1.reverse(); console.log(str1); //hello, not olleh It doesn't change the string at all, as further evidenced by this small test: String.prototype.makeFirstCharX = function() { console.log(this[0]); //h this[0] = 'x'; //no error console.log(this[0]); //h ?? }; str1.makeFirstCharX(); console.log(str1); //hello, not xello Is there anyway to overwrite values of this in a new protoype function for a native JS type? Why doesn't something like this[0]='x' give an error instead of just silently failing? ---This is what I tried on a custom JS object that did work as expected, which is what I based the above off of: I can create a custom revsersible string that behaves similarly to a native string like this: function MyString(str) { //set string content and length var l = 0; for (i in str) { this[i] = str[i]; l++; } this.length = l; } MyString.prototype.toString = function() { var retVal = ''; for (i = 0; i &lt; this.length; i++) { retVal += this[i]; } return retVal; }; MyString.prototype.reverse = function() { var reversed = {}; j = 0; for (i = this.length - 1; i &gt;= 0; i--) { reversed[j++] = this[i]; } for (i in reversed) { this[i] = reversed[i]; } }; So as expected: str = new MyString('string'); console.log(str); // MyString { 0="s", 1="t", 2="r", more...} console.log("" + str); //string console.log(str.length); //6 str.reverse(); console.log(str); // MyString { 0="g", 1="n", 2="i", more...} console.log("" + str); //gnirts But if I try the same thing on a "real" javascript string, it does not work.
type: Question
answer count: 2
tagged with: javascript
tagged with: prototype
score: 0
has title: Cannot overwrite "this" in javascript when extending String with String.prototype
has answer: http://stackoverflow.com/a/24986891
has answer: http://stackoverflow.com/a/24986912
tagged with: string
tagged with: immutability

http://stackoverflow.com/comment/38730903
score: 0
type: Comment
has text: I'm not setting it to 1. I'm setting it to a result of (correct.charAt(i) == "1") comparison which is a boolean value: true or false
comment on: http://stackoverflow.com/a/24925531
type: AnswerComment

http://stackoverflow.com/comment/38794980
score: 1
has text: `preventDefault` is not necessary
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24960081

http://stackoverflow.com/q/24940798
has answer: http://stackoverflow.com/a/24940862
tagged with: javascript
has title: Override a CSS Class
has comment: http://stackoverflow.com/comment/38759249
score: 0
has body: I have created a few classes in my javascript file that will be essentially referenced in the CSS file as "tr.Yes" "tr.No" and the new one "tr.override". I want to override the values of tr.Yes and tr.No with tr.override due to a few added constraints in the JS file. Basically, how would I override them with tr.override that has a background of green? Thanks guys. My CSS so far looks as follows: tr.Yes td.IndicatedDispatch { background: yellow; } tr.No td.IndicatedDispatch { background: red; }
has answer: http://stackoverflow.com/a/24940924
tagged with: web
has comment: http://stackoverflow.com/comment/38759301
has comment: http://stackoverflow.com/comment/38759247
accepted answer: http://stackoverflow.com/a/24940862
has answer: http://stackoverflow.com/a/24940852
answer count: 5
tagged with: css
possible better answer: http://stackoverflow.com/a/24940901
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24940901
has comment: http://stackoverflow.com/comment/38759519
type: Question
has answer: http://stackoverflow.com/a/24941091

http://stackoverflow.com/q/25015441
has comment: http://stackoverflow.com/comment/38899373
downvote count: 0
has answer: http://stackoverflow.com/a/25015701
possible better answer: http://stackoverflow.com/a/34687815
accepted answer: http://stackoverflow.com/a/25015701
type: Question
has answer: http://stackoverflow.com/a/34687815
has title: Nodejs: Global variables across multiple files
linked to: http://stackoverflow.com/q/24274186
tagged with: javascript
upvote count: 3
answer count: 2
tagged with: singleton
has comment: http://stackoverflow.com/comment/38914646
favorite count: 0
linked to: http://stackoverflow.com/q/21438207
has body: I have written my code across several files for my node server. If I have a file, say basket.js: var Basket = { fruits : 0, addFruit : function() { fruits++; }, removeFruit : function() { fruits--; }, printFruit : function() { console.log(this.fruits); } } module.export = Basket; And I have another file called give.js: var Basket1 = require("./basket.js"); Basket1.addFruit(); Basket1.printFruit(); And another file called take.js: var Basket2 = require("./basket.js"); Basket2.removeFruit(); Basket2.printFruit(); Will both files write into the same instance of Basket? In other words, will they both have control over the property, fruits? Does node manage race conditions on its own? i.e. if two commands to modify fruit come in at the same time from add and sub, does node know how to handle it? If I want to make a way in which two files can look at a singleton at the same time and access it, is this the way to go?? Or how else does one do it?
has comment: http://stackoverflow.com/comment/38904495
tagged with: node.js
type: AnsweredQuestion
score: 3

http://stackoverflow.com/comment/38748227
type: Comment
has text: `I have tried a lot of things` can you update your question with any one try you did?
comment on: http://stackoverflow.com/q/24935133
type: QuestionComment
score: 0

wcf
tags question: http://stackoverflow.com/q/24916319
type: Tag
tag name: wcf
tags question: http://stackoverflow.com/q/24930815
tags question: http://stackoverflow.com/q/25004791
tags question: http://stackoverflow.com/q/24969696

http://stackoverflow.com/q/25021396
has title: AngularJS soltuion to determining if any element in array1 exists in array2
has body: I am working on an angularJS widget (my first) and I currently am looking for an angularJS solution to my problem. Basically I have one array containing a list of string values. var array1 = [ "Need to Know", "Test Category 2", "News" ]; and another array containing another list of string values var array2 = [ "need to know", "release notes", "NEWS" ]; I need a true statement if any element from one array matches any element from the other array. The result also needs to be case insensitive. Here is my current solution and works great. angular.module("myWidget", function(...){ // angular code here }) .service('arrayService', function() { function arrayToLowerCase(array) { return array.join("~!~").toLowerCase().split("~!~"); } function arrayElementIsInArray(array1, array2) { for (var i in array1) { if (array2.indexOf(array1[i]) &gt;= 0) { return true; } } return false; } function arrayCompare(array1, array2) { return arrayElementIsInArray(arrayToLowerCase(array1), arrayToLowerCase(array2)); } return { arrayToLowerCase: arrayToLowerCase, arrayElementIsInArray: arrayElementIsInArray, arrayCompare: arrayCompare }; }) the problem is my javascript coders (I primary work in c#) feel there is a more angularJS way to do this but they have brought nothing to the table as a definitive solution. It was suggested that the $filter module might be useful but I didn't see how it would exactly solve my problem. If I already have the best solution, then awesome. If not please let me know what you think and lets go from there. Thanks in advance. EDIT: In response to some of the answers, I felt that I might have misinterpreted my request. What I am asking is there a built in function that angular provides that does this out of the box? After researching this a bit more; the $filter Module will probably do it with a custom comparater implemented but that seems like way overkill for what I am looking for. The current responses are all good stuff though. Thanks again!
type: AnsweredQuestion
downvote count: 1
type: Question
linked to: http://stackoverflow.com/q/1885557
accepted answer: http://stackoverflow.com/a/25022436
has comment: http://stackoverflow.com/comment/38910878
score: -1
has comment: http://stackoverflow.com/comment/38911151
possible better answer: http://stackoverflow.com/a/25021943
answer count: 3
upvote count: 0
has answer: http://stackoverflow.com/a/25021943
tagged with: arrays
tagged with: javascript
has answer: http://stackoverflow.com/a/25022196
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25022436

http://stackoverflow.com/comment/38783324
type: AnswerComment
score: 0
type: Comment
has text: I'm new to Google Analytics, AJAX & JavaScript so could you exlplain what will be the reason?
comment on: http://stackoverflow.com/a/24951818

http://stackoverflow.com/a/29910601
score: 0
answers question: http://stackoverflow.com/q/24997889
type: Answer
has body: Goto, Your first assumption regarding SVG will not update on DOM modification is not entirely true. I have an entire SVG web application built with knockout and we have anything from path to circles and images which are bound to View Models. These graphics do change without any issues in new browsers such as latest versions of Chrome and Firefox. In our case we're not too concerned about older versions of IE, so we haven't done sufficient testing in that front. But this is mostly a browser engine issue rather than 'SVG' technology. Different engines are very likely to respond differently. You're final edit is correct. You need to have the attribute in there, but I suggest putting a placeholder value. What I use is : &lt;image data-bind="attr:{'xlink:href':icon.href,x:icon.x,y:icon.y,icon.height,width:icon.width}" xlink:href="whitedot.png"&gt;&lt;/image&gt; I've created whitedot.png as a 1x1 pixel white dot which appears initially until the binding takes place. This is probably a good idea over leaving it empty to avoid getting the image missing replacement icon you sometimes see in Firefox or Chrome until your actual image get loaded.

http://stackoverflow.com/q/24916496
tagged with: browser-extension
favorite count: 0
has body: Is it possible to get list of all scripts injected by browser? Or at least detect them somehow. I mean sometimes on Windows there are various viruses which inject scripts in fly modifying eg. click actions to display ads. I'm writing kind of advanced website so I'd like to warn user about other scripts which most likely: will crash as my webapp is modifying basic native browser APIs like document.getElement* or even listeners may make webapp unstable and in wors case make it crash. could be performance overkill I'm talking also about scripts modifying site content like eg. Ponify or XKCD numbers. I know about navigator.plugins but it doesn't seem to be what am I looking for.
upvote count: 2
tagged with: http://stackoverflow.com/tag/html
has title: JavaScript get list of external scripts (like extensions)
score: 2
type: AnsweredQuestion
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24916576
accepted answer: http://stackoverflow.com/a/24916576
answer count: 1
downvote count: 0

http://stackoverflow.com/q/25023846
has comment: http://stackoverflow.com/comment/39615444
upvote count: 3
downvote count: 1
answer count: 1
has title: TypeError: Cannot read property 'slice' of undefined
has body: I use this script for page pagination like in this tutorial http://fdietz.github.io/recipes-with-angular-js/common-user-interface-patterns/paginating-through-client-side-data.html app.filter('offset', function() { return function(input, start) { start = parseInt(start, 10); return input.slice(start); }; }); Everything went fine, except that I got an error TypeError: Cannot read property 'slice' of undefined at k.&lt;anonymous&gt; (http://www.foo.com/43267ztX/default/:18:17) at e (http://www.foo.com/43267ztX/default/js/angular.min.js:171:180) at db.| (http://www.foo.com/43267ztX/default/js/angular.min.js:160:65) at F.constant (http://www.foo.com/43267ztX/default/js/angular.min.js:170:82) at db.| (http://www.foo.com/43267ztX/default/js/angular.min.js:160:70) at F.constant (http://www.foo.com/43267ztX/default/js/angular.min.js:170:82) at Object.$watch.p (http://www.foo.com/43267ztX/default/js/angular.min.js:107:159) at k.$digest (http://www.foo.com/43267ztX/default/js/angular.min.js:109:78) at k.$apply (http://www.foo.com/43267ztX/default/js/angular.min.js:112:173) at h (http://www.foo.com/43267ztX/default/js/angular.min.js:72:300) &lt;/pre&gt;
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25023949
score: 2
has comment: http://stackoverflow.com/comment/77017298
has comment: http://stackoverflow.com/comment/38915847
favorite count: 0
has comment: http://stackoverflow.com/comment/64740151
tagged with: angularjs
type: Question

http://stackoverflow.com/comment/38884364
type: Comment
type: QuestionComment
has text: That's a broad question. But it's safe to say nested directives is more manageable than a single directive, especially if the interactions between the model, view, and controller are complex and non-trivial. Without knowing too much about your app, I would say you could create custom (nested) directives, using transclusion and templates, and limit your DOM manipulation to the compile/link function and/or template function
comment on: http://stackoverflow.com/q/25007415
score: 0

http://stackoverflow.com/q/24913502
has comment: http://stackoverflow.com/comment/38708518
type: Question
has body: I use html2canvas.js to save images. I knwo how to use this if is in the same location/server with the php files. But now I want to use the script in eBay listing template and save the image to my server. Is this possible? This is my php file: <?php function ImageFillAlpha($image, $color) { imagefilledrectangle($image, 0, 0, imagesx($image), imagesy($image), $color); } function imageCreateCorners($sourceImageFile, $name, $radius) { # test source image if (file_exists($sourceImageFile)) { $res = is_array($info = getimagesize($sourceImageFile)); } else $res = false; # open image if ($res) { $w = $info[0]; $h = $info[1]; switch ($info['mime']) { case 'image/jpeg': $src = imagecreatefromjpeg($sourceImageFile); break; case 'image/gif': $src = imagecreatefromgif($sourceImageFile); break; case 'image/png': $src = imagecreatefrompng($sourceImageFile); break; default: $res = false; } } # create corners if ($res) { $q = 10; #change this if you want $radius *= $q; $r = 0; $g = 0; $b = 0; $nw = $w * $q; $nh = $h * $q; $img = imagecreatetruecolor($nw, $nh); $alphacolor = imagecolorallocate($img, 0, 0, 0); imagealphablending($img, false); imagesavealpha($img, true); imagefilledrectangle($img, 0, 0, $nw, $nh, $alphacolor); imagefill($img, 0, 0, $alphacolor); imagecopyresampled($img, $src, 0, 0, 0, 0, $nw, $nh, $w, $h); # resize image down $dest = imagecreatetruecolor($w, $h); imagealphablending($dest, false); imagesavealpha($dest, true); imagefilledrectangle($dest, 0, 0, $w, $h, $alphacolor); imagecopyresampled($dest, $img, 0, 0, 0, 0, $w, $h, $nw, $nh); # output image $res = $dest; imagedestroy($src); imagedestroy($img); imagepng($res, 'cart/'.$name); } return $res; } $image = $_POST['plate_image']; $ebay_user = $_POST['ebay_user']; $decoded = base64_decode(str_replace('data:image/png;base64,', '', $image)); $date = date('m-d-Y', time()); $name = "evgrave-".$ebay_user."-".$date.".png"; file_put_contents("/var/www/html/SERVERLOCATION/img/" . $name, $decoded); $full_path = "/var/ww…
has title: How can I save a file on remote server with js and php?
has comment: http://stackoverflow.com/comment/38708448
has comment: http://stackoverflow.com/comment/38708782
score: 0
tagged with: php
has answer: http://stackoverflow.com/a/24913606
has comment: http://stackoverflow.com/comment/38707522
type: UnansweredQuestion
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38706904
type: QuestionComment
has text: Its ok! the article you pointed me too helped me a lot.
score: 0
comment on: http://stackoverflow.com/q/24912426
type: Comment

http://stackoverflow.com/a/25029571
score: 0
type: Answer
has body: Giving you an approach which can be used for any number of elements. Generate random numbers between 0 and 1 and based on it, either append or prepend your element $('.apple').each(function(){ var j = Math.floor(Math.random() * 2); if(j== 0) $('.container').append($(this)); else $('.container').prepend($(this)); });
answers question: http://stackoverflow.com/q/25029503

http://stackoverflow.com/comment/38975404
has text: I used javascript and I managed to alert the values of "Yes","No" etc. Like this: js(document).ready(function(){ js('#form-table').submit(function(event){ alert($("jform_question10").value); document.form2.submit(); }); }); But If I try to get the value of the checked radio with jform_question1 it prints nothing. I tried also with fieldset like: document.getElementById("jform_question1") but it doesn't work.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25012457
score: 0

http://stackoverflow.com/comment/38856721
comment on: http://stackoverflow.com/a/24987777
score: 0
type: Comment
has text: This seems like exactly what I need, thanks a million
type: AnswerComment

http://stackoverflow.com/q/24990254
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24992203
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has body: I have two queries that are sent one after the other. If I use send method, than I get the response in onmessage and I need to know which response it was - from the first query or from the second. Is it possible?
has answer: http://stackoverflow.com/a/24992203
type: AnsweredQuestion
has title: Is it possible to identify web-socket request on receive?
type: Question
tagged with: websocket

http://stackoverflow.com/a/25022230
score: 0
answers question: http://stackoverflow.com/q/25021963
type: Answer
has body: Assuming you mean that you want to prevent any empty element to be output to the final result tree, you can simply add the following to your stylesheet (works in XSLT 1.0, 2.0 and 3.0): &lt;xsl:template match="*[not(node())]" /&gt; Of course, this also assumes that somewhere else you have an xsl:apply-templates that selects those empty elements. If all you want is to process your input XML above and remove the empty &lt;div /&gt; elements, you can use a modified copy idiom: &lt;xsl:template match="node() | @*"&gt; &lt;xsl:apply-templates select="@* | node()"/&gt; &lt;/xsl:template&gt; &lt;xsl:template match="div[not(node())]" /&gt;

http://stackoverflow.com/q/25024570
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38944899
type: UnansweredQuestion
tagged with: three.js
has body: I have a model that I exported from Blender in the Three.js JSON format. I have it loading correctly in a browser. The model is of a control panel with buttons, switches, etc. Each of these buttons and switches is a subpart of the mesh. How do I access these subparts(to make the switches move and such)?
answer count: 0
has comment: http://stackoverflow.com/comment/39405667
type: Question
has comment: http://stackoverflow.com/comment/38996070
has comment: http://stackoverflow.com/comment/38917734
has title: How to access subparts of a Three.js JSON mesh?
has comment: http://stackoverflow.com/comment/38961761
tagged with: javascript
has comment: http://stackoverflow.com/comment/38943995

http://stackoverflow.com/a/25001619
answers question: http://stackoverflow.com/q/25001520
has body: You have an array containing 1 object. stringify turns this object into a string - you need it parsed so you can use it. (I'm not sure if the object is parsed already, so to cover all bases, we'll parse it) var Jsoninvoice = JSON.parse(data); alert(Jsoninvoice[0].VATRate); You have to specify the arrays index before you can access the properties.
score: 3
upvote count: 3
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38813578
type: Comment
comment on: http://stackoverflow.com/a/24969926
score: 0
type: AnswerComment
has text: I think he needs an answer without jQuery in it.

http://stackoverflow.com/q/24996731
has body: I have a tree graph very similar to the one here: http://bl.ocks.org/mbostock/999346 and I would like to limit the spacing vertically of the nodes; if you look at the tree you will see that when there are just two nodes, they take up the entire canvas (the link between the two nodes is very long), and as other nodes are inserted, the link(s) are resized to fit. I would like to limit the link length to some max number so that the tree is more compact with fewer nodes.
answer count: 1
has answer: http://stackoverflow.com/a/33745856
tagged with: javascript
type: UnansweredQuestion
upvote count: 4
has comment: http://stackoverflow.com/comment/38864312
downvote count: 0
favorite count: 0
type: Question
tagged with: d3.js
score: 4
has title: Setting Max Length of Links in D3 Tree Layout

http://stackoverflow.com/comment/38863620
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24994953
has text: Thanks! would upvote 100x times if i could :) Why you say it's not elegant?

http://stackoverflow.com/comment/38919276
type: AnswerComment
type: Comment
has text: for animation, shouldn't that 0 be i or maybe (i*10) ?
score: 0
comment on: http://stackoverflow.com/a/25025789

http://stackoverflow.com/q/24941618
tagged with: javascript
has comment: http://stackoverflow.com/comment/38761757
has comment: http://stackoverflow.com/comment/38760966
score: 0
answer count: 1
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24941796
has title: Form Submitting Via AJAX Despite Failing Validation
has comment: http://stackoverflow.com/comment/38760940
tagged with: forms
has body: I'm new to Ajax and I wanted to use it with a contact form currently in use. The form is set up to run JS (fieldchk()) to validate the require fields and then sends an email to the appropriate party. I have set up the Ajax correctly, in that the email is sent and a message is displayed on the same page: $('form').on('submit', function(event) { event.preventDefault(); return fieldchk(); var url = $(this).attr('action'); var formData = $(this).serialize(); $.post(url, formData, function(response){ $('#feedback_form').html(" Thanks for contacting us! "); }); }); Edit: now the form gets validated and if it's valid, it does not send the email. Validation works correctly now. Here is my form code: This is the code I use to validate the form: function fieldchk() { errmsg = ''; if (document.feedback.name.value == ''){ errmsg = errmsg + 'You must enter your name.\n'; } ... all the fields get checked like this ... if (errmsg > ''){ alert(errmsg); return false; } }
type: Question

http://stackoverflow.com/q/25026134
upvote count: 1
downvote count: 1
has body: I have an iframe from anoter page in another domain.: For example: &lt;iframe id="myframe" src="http://stackoverflow.com/"&gt; &lt;/iframe&gt; and in jQuery, i have this: $(document).ready(function(){ $("#myframe").load(function(){ var obj = $("#myframe").contents().find('#hlogo'); div.append('&lt;img src="http://www.my-domain.com/img/myimage.jpg" /&gt;'); }); }); But it is not adding an image. What can I do? In this fiddle, I am trying to change the image to something else -Same problem, different sources.
linked to: http://stackoverflow.com/q/1796619
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38920001
tagged with: jquery
has answer: http://stackoverflow.com/a/25026193
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25026197
favorite count: 0
has title: jQuery: change the image of an iFrame
has comment: http://stackoverflow.com/comment/38920084
has comment: http://stackoverflow.com/comment/38919929
type: UnansweredQuestion
tagged with: iframe

http://stackoverflow.com/q/25037586
has body: Hello, I'm trying to make a string appear and disappear char by char. First I use lettering.js which split my string in as much span element as my string length. Second I use velocity to put some effects on them. So for example Rainbow It works well and my 2 first caracters move and disappear yiha! But there is no way to loop on all of this. If you look at the doc of velocity, the only way to put several effects on something is to call as much .velocity as you want to add effects...A loop attribute exists but you can't put all of your velocity call in a row. Does anyone has a clue of how i can do this with velocity? I actually don't want to use animate. Thanks for your help! Thomas
has title: how to loop on a set of animations with velocity.js
has comment: http://stackoverflow.com/comment/39550258
answer count: 1
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: velocity.js
favorite count: 0
has answer: http://stackoverflow.com/a/25038399
type: Question
upvote count: 1

http://stackoverflow.com/comment/57508169
type: QuestionComment
comment on: http://stackoverflow.com/q/24962272
has text: Not sure if this will solve your problem—or if you even care a year and a half later ;) —, but at first glance [$interpolate](https://docs.angularjs.org/api/ng/service/$interpolate) appears to quite possibly provide a solution.
score: 0
type: Comment

http://stackoverflow.com/comment/38954921
type: Comment
comment on: http://stackoverflow.com/a/25044594
score: 1
type: AnswerComment
has text: Actually, I am not the one who shattered those delusions, now, am I? If I would be here for that, I would only go through any post that claims to know something and then answer them telling them that they are wrong. It was a perfect demonstration of the term that our knowledge is just an illusion, I only applaud that, when I see it.

http://stackoverflow.com/comment/40390885
score: 0
type: QuestionComment
has text: I am having the exact same issue! Did you end up finding out any more on this? Any help would be greatly appreciated!
type: Comment
comment on: http://stackoverflow.com/q/25008690

http://stackoverflow.com/comment/65026999
score: 0
type: Comment
has text: Thanks, I meant an example how to get the contents of the certificate variable which you pass to the function. E.g. how to load the pdf file with js. However, I think I got it to work already.
type: AnswerComment
comment on: http://stackoverflow.com/a/25034254

http://stackoverflow.com/a/24975564
accepted answer of: http://stackoverflow.com/q/24975475
answers question: http://stackoverflow.com/q/24975475
type: Answer
upvote count: 3
score: 3
has body: It's just var line = document.getElementById("line"); line.setAttribute("x1", "5"); etc.
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24930621
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24933268
has title: Count how many keys are pressed at the same time in JavaScript
accepted answer: http://stackoverflow.com/a/24933268
favorite count: 0
has answer: http://stackoverflow.com/a/24930888
answer count: 4
has body: Is it possible to count how many keys are pressed at the same time? I've come quite far but I get some unwanted behavior when tabbing away from my browser window. If I hold down x number of keys when tabbing away from the browser window and then release the keys in a different window the numKeys array stays the same when I tab back to the browser window. Maybe you can check how many keys are pressed when returning to the browser window or something? My code so far: var numKeys = []; $(document).keydown(function(e){ if(numKeys.indexOf(e.keyCode) == -1){ numKeys.push(e.keyCode); } document.getElementById('test').innerHTML = numKeys.length; }); $(document).keyup(function(e){ if(numKeys.indexOf(e.keyCode) &gt; -1){ var index = numKeys.indexOf(e.keyCode); if(index &gt; -1){ numKeys.splice(index, 1); } } document.getElementById('test').innerHTML = numKeys.length; });
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38740191
has comment: http://stackoverflow.com/comment/38744620
downvote count: 0
type: Question
has comment: http://stackoverflow.com/comment/38744370
possible better answer: http://stackoverflow.com/a/24930888
score: 1
has comment: http://stackoverflow.com/comment/38741438
has answer: http://stackoverflow.com/a/24931426
has comment: http://stackoverflow.com/comment/38740658
upvote count: 1
has answer: http://stackoverflow.com/a/24931488

http://stackoverflow.com/a/34316904
score: 0
type: Answer
has body: for example: alert(123); window.alert(123); they are equal. alert 123. in browser environment, if y don't add function prefix, the default is the window prefix. for your question, in Zepto，if window.$ isn't occupied that assigned to Zepto.
answers question: http://stackoverflow.com/q/24923898

http://stackoverflow.com/q/24965195
has body: I'm new to javascript. I am trying to lazy load some large background images on my page so that people will see the "loading" gif when the image is loading. I know how to do this on the HTML image tags but not on CSS background-image. I looked at a few answers and none seem to be sufficient. Some don't even work when I view the demo/jsfiddle. Again, all I want to do is have a loading gif behind my CSS specified background-images when they are loading so there will be no gaping black holes that lead my visitors to think the site is broken. I am using LanguidLoad for my html tag images. So if you guys can get it to work with LanguidLoad, that would be best! Thanks a bunch!
upvote count: 3
has comment: http://stackoverflow.com/comment/38805285
answer count: 1
favorite count: 0
has title: How can I lazy load or preload large background images on my site?
tagged with: lazy-loading
type: UnansweredQuestion
tagged with: css
score: 3
downvote count: 0
tagged with: background-image
type: Question
has answer: http://stackoverflow.com/a/24965340
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24988758
downvote count: 0
favorite count: 0
has body: Within my code below how can I make it read name="item[]" and name="amount[] from my HTML? I have seen a few conflicting things on here how to do it is there a simple way? HTML: Item* Amount* jQuery: $(document).ready(function () { $(' ', { 'class': 'menuDetails', html: getMenuHTMLDetails() }).appendTo('#addMoreItemsButton'); $('#addItem').click(function () { $(' ', { 'class': 'extraMenuItem', html: getMenuHTMLDetails() }).hide().appendTo('.appendMoreItems').slideDown('slow'); }); }) function getMenuHTMLDetails() { var len = $('.extraMenuItem').length; var $clone = $('.menuDetails').clone(); $clone.find('[name=item]')[0].name = "item" + len; $clone.find('[name=amount]')[0].name = "item" + len; return $clone.html(); }
possible better answer: http://stackoverflow.com/a/24988806
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24988791
has answer: http://stackoverflow.com/a/24988806
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
answer count: 2
has title: input array within jquery
has answer: http://stackoverflow.com/a/24988791

http://stackoverflow.com/q/24924032
type: Question
has answer: http://stackoverflow.com/a/24924083
tagged with: if-statement
score: 1
has comment: http://stackoverflow.com/comment/38727659
has title: How to loop if/else statements (JavaScript)?
has answer: http://stackoverflow.com/a/24924144
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38727674
favorite count: 0
has answer: http://stackoverflow.com/a/24924272
has comment: http://stackoverflow.com/comment/38727657
has body: Ok, so I am creating a text-based exploration type game. I want to know how to loop an if/else statement along with resetting the variable. I have it so the character you play as starts in his bedroom and you have to type in commands for your character to follow such as looking around. If you could also help me with java recognizing the same word in all types of forms(CAPS in any place). if (begin === 'look around') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === 'look') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === 'examine room') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === 'examine the room') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === '?') { confirm('If you have not already noticed, this game is completely Text-based. In order to progress through the game, you will need to type in commands that you think the character you are playing as should do.Example: look around.') }
has answer: http://stackoverflow.com/a/24926285
answer count: 5
tagged with: reset
has comment: http://stackoverflow.com/comment/38727631
downvote count: 0
has answer: http://stackoverflow.com/a/24924133
type: UnansweredQuestion
tagged with: loops

http://stackoverflow.com/comment/38912450
comment on: http://stackoverflow.com/q/25021379
score: 0
type: Comment
type: QuestionComment
has text: @Droïdeka What would prevent you from accessing the values of the second constructor if the `valide()` is called right away? I think it should works.

http://stackoverflow.com/comment/38726586
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24922058
has text: Seems like the 'domready' doesn't work. If I [add a setTimeout to give the DOM time to render](http://jsfiddle.net/qJZe5/3/) I get the infowindow and the dialog (but no chart).

http://stackoverflow.com/a/25066459
accepted answer of: http://stackoverflow.com/q/25065916
answers question: http://stackoverflow.com/q/25065916
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38995893
type: Answer
score: 0
has body: Please consider expanding your question and maybe include some code. Are you using razor to build your input element? I love angularJS for this you can have an MVC input element and get instant feedback from it. &lt;input type="text" name="myInput" ng-model="theInput"&gt; {{theInput}} Angular binding will cause you to get instant feedback of exactly what's in your input element, of course you can just look at the input element too LOL. But in the above case myInput is your model variable ie Model.myInput, and theInput is your angular scope variable, ie. $scope.theInput.

http://stackoverflow.com/q/24996452
tagged with: parsley.js
linked to: http://stackoverflow.com/q/12272123
has answer: http://stackoverflow.com/a/24996574
tagged with: forms
type: AnsweredQuestion
score: 2
has body: I just discovered that my form isn't submitting when i give the submit element the name="submit" attribute. When I change the the name to something else, it works perfectly! I am using parsley.remote.min.js * Version 2.0.3 - built Mon Jul 21 2014 11:58:33 Sorry I cannot provide code right now, I just wanted to throw that out there. Is it possibly I am doing something wrong?
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/24996574
type: Question
has comment: http://stackoverflow.com/comment/38863504
upvote count: 3
answer count: 1
downvote count: 1
has title: parsley form not submitting when submit button has name="submit"

http://stackoverflow.com/q/24974048
score: 1
type: Question
has comment: http://stackoverflow.com/comment/58577958
tagged with: javascript
has comment: http://stackoverflow.com/comment/38833996
tagged with: google-chrome-extension
upvote count: 1
tagged with: websocket
has comment: http://stackoverflow.com/comment/38848252
has comment: http://stackoverflow.com/comment/38828347
has title: Qt secure web sockets
has comment: http://stackoverflow.com/comment/58585238
favorite count: 0
has body: I'm working on a Qt application which communicates with my web browser (currently Google Chrome) through websockets. I have a Chrome extension that injects javascript scripts into some webpages (such as youtube) and open a websocket to my Qt application: var websock = new WebSocket('ws://localhost:52132'); And on the Qt side, I have a QWebSocketServer: server = new QWebSocketServer("My Server", QWebSocketServer::SslMode::NonSecureMode, this) ; connect(server, &amp;QWebSocketServer::newConnection, this, &amp;MyWidget::onNewConnection) ; And the onNewConnection slot: QWebSocket *socket = server-&gt;nextPendingConnection () ; This is not the exact code but it's currently working. Unfortunately, I can't inject my javascript on https page, because I am using non-secure websockets. So I tried using secure websockets, changing ws://localhost:52132 to wss://localhost:52132 and NonSecureMode to SecureMode, but it's not working either if the server is successfully started on the specified port. I got the following information from Qt when starting my application: QSslSocket: cannot resolve TLSv1_1_client_method QSslSocket: cannot resolve TLSv1_2_client_method QSslSocket: cannot resolve TLSv1_1_server_method QSslSocket: cannot resolve TLSv1_2_server_method QSslSocket: cannot resolve SSL_select_next_proto QSslSocket: cannot resolve SSL_CTX_set_next_proto_select_cb QSslSocket: cannot resolve SSL_get0_next_proto_negotiated What am I doing wrong here? Is there a way to either: Use websockets the way I want? (i.e. a javascript secure websocket communicating with a QWebSocketServer Use non secure websockets on https pages? Only within scripts injected by my Chrome extension. Thanks,
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/58584042
tagged with: qt
tagged with: c++
has comment: http://stackoverflow.com/comment/38856704
has comment: http://stackoverflow.com/comment/58575331
downvote count: 0
answer count: 0

http://stackoverflow.com/q/25008845
has body: i am trying to store the value of selected radio button in session storage in JavaScript.And later i want that value to be used in angularjs function .Is it possible.If yes then please help me
tagged with: angularjs
type: Question
has answer: http://stackoverflow.com/a/25008869
score: 0
has comment: http://stackoverflow.com/comment/38886974
answer count: 1
tagged with: session
tagged with: javascript
type: UnansweredQuestion
has title: Is it possible to store session in simple JavaScript function and then access that session attribute in angularjs?

http://stackoverflow.com/comment/38705240
comment on: http://stackoverflow.com/q/24911902
score: 0
type: QuestionComment
type: Comment
has text: One thing I immediately notice is that in your example, you state that you are making an AJAX call from example1.com, however your AJAX url is for example2.com. Are you in fact attempting to make a cross-domain AJAX request, or is that a typo?

http://stackoverflow.com/q/24955350
score: 0
answer count: 1
tagged with: glassfish-4
has answer: http://stackoverflow.com/a/25378130
type: AnsweredQuestion
tagged with: java
type: Question
has body: I have a weird problem with my Glassfish-Web application. Most of the time, my index.jsp site loads really fast. But sometimes (especially after updating a new version of the application), I get a bunch of TimeOutExceptions in Glassfish. In the Chrome developer console, all JavaScript files are on state 'Pending', the .jsp and .css files however, are loaded very quickly. After exactly 1 minute (or sometimes 1.5 minutes) most of the JavaScript files are on state '200'. Some of them remain on state 'Failed'. After reloading the page again, everything works fine. See screenshots from Chrome. Pending state: http://s30.postimg.org/ngr85kuk1/pending.png Done state: http://s17.postimg.org/dvdgxmppr/done.png These errors appear on glassfish: [#|2014-07-25T13:51:12.321+0200|WARNING|glassfish 4.0|javax.enterprise.web._vs.server|_ThreadID=27;_ThreadName=Thread-7;_TimeMillis=1406289072321;_LevelValue=900;|StandardWrapperValve[default]: Servlet.service() for servlet default threw exception java.io.IOException: java.util.concurrent.TimeoutException at org.glassfish.grizzly.utils.Exceptions.makeIOException(Exceptions.java:81) at org.glassfish.grizzly.http.io.OutputBuffer.blockAfterWriteIfNeeded(OutputBuffer.java:958) at org.glassfish.grizzly.http.io.OutputBuffer.write(OutputBuffer.java:682) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:355) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:342) at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:161) at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java:2069) at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:1092) at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:518) at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682) at org.apac…
accepted answer: http://stackoverflow.com/a/25378130
tagged with: jsp
tagged with: javascript
tagged with: glassfish
has title: Glassfish loads JavaScript files really slow (> 1 minute)

http://stackoverflow.com/a/24935825
has body: I got the pdf viewer to work. Instead of using: PDFJS.workerSrc = "/js/pdf.worker.js"; I just disabled the worker like this: PDFJS.disableWorker = true; Now it magically works. Not sure why though.
answers question: http://stackoverflow.com/q/24912734
type: Answer
upvote count: 2
downvote count: 1
accepted answer of: http://stackoverflow.com/q/24912734
score: 1
type: AcceptedAnswer

http://stackoverflow.com/a/24917334
upvote count: 1
answers question: http://stackoverflow.com/q/24917188
has body: You're trying to get the value (val()) which is only applicable for input elements. Change to html() - $("#txtName").val($($(elem).closest('table').attr('id')+"_cname").html()); If #txtName is not an input you will need to change the method there too. plus it appears that there are some typos. See this example: http://jsfiddle.net/2axfN/ $("#txtName").html( $('td:first').closest('table').attr('id') ); Updated with an input field: http://jsfiddle.net/2axfN/1/ $('input[name="foo"]').val( $('td:first').closest('table').attr('id') ); One more update to add '_cname' to the end of the value: $("#txtName").html( $('linkbutton').closest('table').attr('id') + "_cname"); http://jsfiddle.net/2axfN/3/
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/38933332
score: 0
comment on: http://stackoverflow.com/q/25033645
type: QuestionComment
has text: your question is unclear
type: Comment

http://stackoverflow.com/comment/38929565
type: Comment
comment on: http://stackoverflow.com/a/25031406
type: AnswerComment
has text: I believe that this tutorial is a good start for you: http://hmkcode.com/java-servlet-send-receive-json-using-jquery-ajax/
score: 0

http://stackoverflow.com/a/25011037
has body: You can use a GET variable: if (w1 &lt; minw) {location.href = '../minw.php?goBack=' + yourGoBackVarHere}; Then just read it from PHP: $goBack = $_GET['goBack']; If you don't want to mess the URLs with GET queries, using session will work, of course.
accepted answer of: http://stackoverflow.com/q/25010994
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25010994
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38891063
has comment: http://stackoverflow.com/comment/38891192

http://stackoverflow.com/q/25067716
tagged with: selenium-webdriver
has title: IEWebdriver: Cannot click on option element. Executing JavaScript click function returned an unexpected error
answer count: 0
upvote count: 3
type: UnansweredQuestion
tagged with: selenium
has comment: http://stackoverflow.com/comment/39147325
score: 3
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/39068760
tagged with: forms
type: Question
has comment: http://stackoverflow.com/comment/39100030
has body: I am testing web page with large number of forms. The page has main form and couple of sub-forms. Specific sub-forms are rendered only when specific values are selected in main form. Lately, the page was rebuilt, in a way that sub-forms are not visible in static page source. They are injected and rendered dynamically (most likely by java script, not sure though). Below is a code sample from my tests. The tests work on Firefox and Chrome but fail on IE if (!keyType.isEmpty()) { System.out.println(keyTypeInput.isDisplayed()); Select keyTypeSelector = new Select(keyTypeInput); keyTypeSelector.selectByVisibleText(keyType); } Note: keyTypeInput is WebElement. keyTypeInput.isDisplayed() returns true, but any call on keyTypeSelector of selectByIndex, selectByVisibleText etc. throws the following error: 2014-07-31 21:23:34,119 [pool-3-thread-1] INFO c.a.q.c.t.CustomTestListener log - LOG LISTENER: folder=com.qa.devportal.tests.regression.RunAQuery;browser=INTERNET_EXPLORER10;test=verifyResponse;result=Failure;TESTHOST=local;SESSIONID=4a6cb35b-b0ef-4681-a6ea-64eaac64520c;SCREENSHOT=Can't save screenshot.;ERROR=org.openqa.selenium.WebDriverException: Cannot click on option element. Executing JavaScript click function returned an unexpected error, but no error could be returned from Internet Explorer's JavaScript engine. (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 110 milliseconds Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39' System info: host: 'war-lpt-pstepn', ip: '10.138.1.72', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_45' Session ID: 4a6cb35b-b0ef-4681-a6ea-64eaac64520c Driver info: org.openqa.selenium.ie.InternetExplorerDriver Capabilities [{platform=WINDOWS, javascriptEnabled=true, elementScrollBehavior=0, ignoreZoomSetting=false, enablePersistentHover=true, ie.ensureCleanSession=false, browserName=internet explorer, e…
has comment: http://stackoverflow.com/comment/39098135
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/39102856
has comment: http://stackoverflow.com/comment/39028542

http://stackoverflow.com/comment/38768500
has text: That's full working example you can compare your code
comment on: http://stackoverflow.com/q/24945422
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/39034133
type: QuestionComment
has text: See [express generator](http://expressjs.com/guide.html#executable) for the standard way of creating express apps.
score: 0
comment on: http://stackoverflow.com/q/25046736
type: Comment

http://stackoverflow.com/comment/38823498
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24970557
type: AnswerComment
has text: @user61026 yes you can, the syntax is like `{{> myPartialName}}` not exactly sure the default path to them. There is also a second param to the render method which can take partials as an option but I think that is optional - docs are a little vague: http://twitter.github.io/hogan.js/. Try just adding one and you might get an error that will tell you where it expected the partial to be located.

http://stackoverflow.com/q/25063222
has comment: http://stackoverflow.com/comment/38989940
type: Question
score: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38989724
has comment: http://stackoverflow.com/comment/38989675
has title: How to deal with "this" context with functions used in event listeners?
has comment: http://stackoverflow.com/comment/38989690
type: UnansweredQuestion
answer count: 0
has body: I have an object that I construct that applies click and key press event listeners to specified elements on a page. The events fire a function that uses data stored in the object. I need to be able to use the "this" keyword (surely?) but due to how the functions are called the "this" keyword points towards the window object. To solve this problem I have "handlers" saved in my object that reference the functions and also apply .bind(this) to them. this.handlers = { inputMouseMoveHandler: this.inputMouseMove.bind( this ), inputDownHandler: this.inputDown.bind( this ), inputUpHandler: this.inputUp.bind( this ) } and then I can use remove and add event listeners on them while keeping the context of this pointing towards my object. document.addEventListener( "mousemove", this.handlers.inputMouseMoveHandler ); document.addEventListener( "keydown", this.handlers.inputDownHandler ); document.addEventListener( "keyup", this.handlers.inputUpHandler ); and document.removeEventListener( "mousemove", this.handlers.inputMouseMoveHandler ); document.removeEventListener( "keydown", this.handlers.inputDownHandler ); document.removeEventListener( "keyup", this.handlers.inputUpHandler ); Essentially I'm wondering if this is the correct way to do things?

http://stackoverflow.com/a/24935966
upvote count: 1
downvote count: 0
has body: You have to use jQuery.ajax and set async: false a simple example: result = ''; function FunctionTwo() { jQuery.ajax({ url: 'url', success: function(data) { result = data; console.dir(result); }, async: false }); alert(result); }
type: Answer
score: 1
answers question: http://stackoverflow.com/q/24935498

http://stackoverflow.com/q/24964807
has title: js variables found as undefined
has answer: http://stackoverflow.com/a/25020462
type: Question
has answer: http://stackoverflow.com/a/24964897
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/24964891
has body: I'm working on creating a contact us form using a modal with a partial view in .Net. I have everything else working other than this js. I'm having issues with getting this js to recognize cuLink and cuLinkClass. The ContactUs function is based on the QuickView the only difference between the two (in theory) is ContactUs is not creating a button and a modal, just the modal. Any assistance would be greatly appreciated. var ContactUs = (function () { var cuLinkClass = 'ico ico-email contact-form'; function obj(item) { ContactUs.initialize(item); return this; }; obj.onClick = function (evt) { var target = evt.currentTarget || evt.srcElement; var url = target.getAttribute('data-rel'); var modal = jQuery('#contactUsModal.modal-content'); modal.innerHTML = ' Loading... '; QuickView.centerElement(modal.parentNode); jQuery.ajax({ url: url, sucess: function (m, html) { setTimeout(function () { m.innerHTML = html; QuickView.centerElement(m.parentNode); }, 30); }.bind(null, modal) }); }; obj.composeButton = function() { var cuLink = document.getElementsByClassName(cuLinkClass); cuLink.setAttribute('data-target', '#contactUsModal'); cuLink.setAttribute('data-rel', item.getAttribute('rel')); } obj.initialize = function (item) { item.appendChild(cuLink); if (cuLink.addEventListener) cuLink.addEventListener('click', ContactUs.onClick); if (cuLink.attachEvent) cuLink.attachEvent('onclick', ContactUs.onClick); } return obj; })(); var QuickView = (function () { var buttonClassName = 'quick-view-btn'; //var modalContentClassName = 'modal-content'; var miniClassName = 'mini'; var windowWidth = 750; function obj(item) { QuickView.initialize(item); return this; }; obj.centerElement = function (elem) { elem.style.marginLeft = parseInt(windowWidth / -2) + 'px'; elem.style.marginTop = parseInt(parseInt(jQuery(elem).height()) / -2) + 'px'; }; obj.composeButton = function (isMini) { var button = document.createElement('button'); button.setAttribute('class', buttonClassName); button.setAttribut…
has answer: http://stackoverflow.com/a/24964891
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25020462
has comment: http://stackoverflow.com/comment/38804316
has comment: http://stackoverflow.com/comment/38804340
type: AnsweredQuestion

http://stackoverflow.com/comment/38895679
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25011593
has text: yes sir, i wanted overflow:hidden is remove when .slider-img is hover, and, i wanted overflow:hidden is use when .left is click, that is it ok.
type: AnswerComment

http://stackoverflow.com/comment/38888136
score: 0
has text: Here is a jsfiddle that better explains my problem. http://jsfiddle.net/2ZLse/6/
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25008753

http://stackoverflow.com/q/25013829
has comment: http://stackoverflow.com/comment/38896607
has comment: http://stackoverflow.com/comment/38896407
type: Question
has answer: http://stackoverflow.com/a/25016219
accepted answer: http://stackoverflow.com/a/25016219
tagged with: asp.net-mvc-5
has comment: http://stackoverflow.com/comment/38896617
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Loader on a link ASP.NET MVC 5
has body: I'm trying to do something very simple, but it doesn't work for all browser... I need your help here : Accept Here is a simple button, When I click on, it gonna send an Email to user with data from database. The fact is, if I press on this button few times, it's gonna send few mails. So, I'd like to put a loader or something like this, so the user know he have to wait few secs, and he won't be able to click on that link again. I tried something like this but that's not working.. I'm really new with JS.. Edit : Ok I just updated my code and I have this : Accept That's not working, I see the ajax loader even if I don't click on the link.. Thanks for helping,
score: 0
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38896417

http://stackoverflow.com/comment/38825114
score: 0
type: Comment
has text: So what's not working?
type: QuestionComment
comment on: http://stackoverflow.com/q/24976013

http://stackoverflow.com/comment/38979933
type: Comment
score: 0
has text: Thank you very much. I have this option already on, but it never pauses anywhere. Note that this is not an exception but a syntax error, maybe that's the reason?
comment on: http://stackoverflow.com/a/25057872
type: AnswerComment

http://stackoverflow.com/comment/38957697
type: QuestionComment
comment on: http://stackoverflow.com/q/25039243
type: Comment
score: 0
has text: @runTarm The ordering is what was the important clue here. I added a full solution below. Thanks!

google-maps-api-3
tags question: http://stackoverflow.com/q/25028778
tags question: http://stackoverflow.com/q/24919121
tags question: http://stackoverflow.com/q/24920198
tags question: http://stackoverflow.com/q/24990531
tags question: http://stackoverflow.com/q/25052044
tags question: http://stackoverflow.com/q/24944412
tags question: http://stackoverflow.com/q/24961836
tags question: http://stackoverflow.com/q/24950528
tags question: http://stackoverflow.com/q/24968469
tags question: http://stackoverflow.com/q/25062920
tags question: http://stackoverflow.com/q/24987590
tags question: http://stackoverflow.com/q/25021881
tags question: http://stackoverflow.com/q/24947059
tags question: http://stackoverflow.com/q/24909862
tags question: http://stackoverflow.com/q/25012029
tags question: http://stackoverflow.com/q/25063803
tags question: http://stackoverflow.com/q/24998659
tags question: http://stackoverflow.com/q/24975485
tags question: http://stackoverflow.com/q/24949545
tags question: http://stackoverflow.com/q/24933046
tags question: http://stackoverflow.com/q/24946635
tags question: http://stackoverflow.com/q/24993588
tags question: http://stackoverflow.com/q/24912796
tags question: http://stackoverflow.com/q/24984011
tags question: http://stackoverflow.com/q/25020479
tags question: http://stackoverflow.com/q/24944187
tags question: http://stackoverflow.com/q/24958304
tags question: http://stackoverflow.com/q/25017463
tags question: http://stackoverflow.com/q/24972848
tags question: http://stackoverflow.com/q/25065268
tags question: http://stackoverflow.com/q/24922157
tags question: http://stackoverflow.com/q/24922058
tags question: http://stackoverflow.com/q/24951991
tags question: http://stackoverflow.com/q/25004637
tag name: google-maps-api-3
tags question: http://stackoverflow.com/q/24998299
type: Tag
tags question: http://stackoverflow.com/q/25059077
tags question: http://stackoverflow.com/q/24943576
tags question: http://stackoverflow.com/q/24913277
tags question: http://stackoverflow.com/q/24956616
tags question: http://stackoverflow.com/q/24954973
tags question: http://stackoverflow.com/q/24942624
tags question: http://stackoverflow.com/q/25056183
tags question: http://stackoverflow.com/q/25033353
tags question: http://stackoverflow.com/q/24943482
tags question: http://stackoverflow.com/q/25040942
tags question: http://stackoverflow.com/q/24945544
tags question: http://stackoverflow.com/q/24935946
tags question: http://stackoverflow.com/q/25017779
tags question: http://stackoverflow.com/q/24936037
tags question: http://stackoverflow.com/q/25015130

mobile-safari
tags question: http://stackoverflow.com/q/25018633
tags question: http://stackoverflow.com/q/24965011
tag name: mobile-safari
tags question: http://stackoverflow.com/q/24942499
tags question: http://stackoverflow.com/q/24977575
type: Tag
tags question: http://stackoverflow.com/q/25039064

http://stackoverflow.com/comment/38865930
type: Comment
comment on: http://stackoverflow.com/q/24993777
type: QuestionComment
score: 1
has text: @Dan they're still working on it but they've demoed it. It you're able to use github devel version of meteor you may be able to play around with it. It was demoed in this video: https://www.youtube.com/watch?v=NBp72NFzHL0

http://stackoverflow.com/comment/38737229
type: QuestionComment
comment on: http://stackoverflow.com/q/24925450
score: 0
has text: Are you looking for something like typeaheadjs?
type: Comment

http://stackoverflow.com/q/24927868
score: 0
has comment: http://stackoverflow.com/comment/38735755
has comment: http://stackoverflow.com/comment/38735518
answer count: 1
has comment: http://stackoverflow.com/comment/38735024
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38734613
has body: When the navbar is resized, the dropdown doesn't seem to work. Is there anything wrong with my codes? Is there any solution for this? This is my HTML code. &lt;!-- Fixed navbar --&gt; &lt;div class="navbar navbar-default navbar-fixed-top" role="navigation"&gt; &lt;div class="container"&gt; &lt;div class="navbar-header"&gt; &lt;button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"&gt; &lt;span class="sr-only"&gt;Toggle navigation&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;span class="icon-bar"&gt;&lt;/span&gt; &lt;/button&gt; &lt;a class="navbar-brand" href="home.php"&gt;company&lt;/a&gt; &lt;/div&gt; &lt;div class="navbar-collapse collapse"&gt; &lt;ul class="nav navbar-nav"&gt; &lt;li class="active"&gt;&lt;a href="home.php"&gt;&lt;i class="glyphicon glyphicon-home"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="order.php"&gt;&lt;i class="glyphicon glyphicon-pencil"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;Order&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="cart.php"&gt;&lt;i class="glyphicon glyphicon-shopping-cart"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;Cart&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="contactus.php"&gt;&lt;i class="glyphicon glyphicon-earphone"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;Contact Us&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="about.php"&gt;&lt;i class="glyphicon glyphicon-search"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;About Us&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;ul class="nav navbar-nav navbar-right"&gt; &lt;li&gt;&lt;a href="register.php"&gt;&lt;i class="glyphicon glyphicon-registration-mark"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;Register&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li class="active"&gt;&lt;a href="login.php"&gt;&lt;i class="glyphicon glyphicon-user"&gt;&lt;/i&gt;&lt;span&gt;&amp;nbsp;Login&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;&lt…
tagged with: twitter-bootstrap
has title: Dropdown Navbar in Bootstrap not working
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24928184

http://stackoverflow.com/a/25056537
has comment: http://stackoverflow.com/comment/38977020
has comment: http://stackoverflow.com/comment/38977755
has body: Try like this, $('#btnReload').click(function (e) { var grid = $("#datagrid_Roads").data("kendoGrid"); grid.dataSource.filter({}); grid.dataSource.read(); grid.refresh(); });
has comment: http://stackoverflow.com/comment/38977659
has comment: http://stackoverflow.com/comment/38976966
score: 0
answers question: http://stackoverflow.com/q/25055051
has comment: http://stackoverflow.com/comment/38977564
has comment: http://stackoverflow.com/comment/38976904
type: Answer

http://stackoverflow.com/comment/107293321
type: Comment
has text: also for simplicity, you can also do fs.createReadStream(file, { start, end})
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24977085

http://stackoverflow.com/a/25013778
upvote count: 1
has body: there's an attributes property in the DOM if you had &lt;svg id="svg" preserveAspectRatio="none" width="100%"/&gt; you can do this... var svg = document.getElementById("svg"); for (var i=0, attrs=svg.attributes, l=attrs.length; i&lt;l; i++){ s1.attr(attrs.item(i).nodeName, attrs.item(i).value); } presumably in your case it would be var svg = svg.node;
has comment: http://stackoverflow.com/comment/39056480
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38898157
accepted answer of: http://stackoverflow.com/q/25013379
type: Answer
answers question: http://stackoverflow.com/q/25013379
score: 1
has comment: http://stackoverflow.com/comment/39045530

http://stackoverflow.com/q/24950551
answer count: 1
has comment: http://stackoverflow.com/comment/38777700
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38777693
linked to: http://stackoverflow.com/q/14337351
has body: I have get a request from an API, some times I would get the EXIF information, but sometimes I will get error message {"error":"no exif data"} How can I hide this error message. In chrome, the error is 400 (Bad Request) $http.get(res.getQNUrl(domain, key, "exif")) .success(function(data){ $scope.imageExifMap[key] = data }).error(function(data,status,headers,config){})
tagged with: bad-request
downvote count: 0
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38777798
has title: How to hide error message in angularjs http request?
tagged with: javascript
has answer: http://stackoverflow.com/a/29489467
has comment: http://stackoverflow.com/comment/38778126
upvote count: 1

http://stackoverflow.com/q/25032282
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38931077
tagged with: angular-promise
has answer: http://stackoverflow.com/a/25032598
type: AnsweredQuestion
has body: In angular code, I have a chained promise like this: // a function in LoaderService module. var ensureTypesLoaded= function(){ return loadContainerTypes($scope).then(loadSampleTypes($scope)).then(loadProjectList($scope)).then(loadSubjectTypes($scope)); } Each of these functions return a promise, that loads things from a resource and additionally modifies $scope on error and success, e.g.: var loadProjectList = function ($scope) { // getAll calls inside a resource method and returns promise. return ProjectService.getAll().then( function (items) { // succesfull load console.log("Promise 1 resolved"); $scope.projectList = items; }, function () { // Error happened CommonService.setStatus($scope, 'Error!'); }); }; I intent to use in in a code in a controller initialziation as such: // Part of page's controller initialization code LoaderService.ensureTypesLoaded($scope).then(function () { // do something to scope when successes console.log("I will do something here after all promises resolve"); }, function () { // do something when error }); However, this does not work as I'd like to. Ideally message "I will do something here after all promises resolve" must appear after all promises resolve. Instead, I can see that it appears earlier than messages from resolved promises within functions that are listed ensureTypesLoaded. I would like to create a function ensureTypesLoaded such, that: it returns a promise that is resolved when all chained loads are resolved; if any of "internal" promises fail, the function should not proceed to next call, but return rejected promise. obviously, if I call ensureTypesLoaded().then(...), the things in then() must be called after everything inside ensureTypesLoaded is resolved. Please help me with correct building of chained promises.
has title: How to correctly chain promises in complex resource loading sequence?
type: Question
accepted answer: http://stackoverflow.com/a/25032598
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/24938610
has body: It seems like the issue is you are subscribing to the event incorrectly. jQuery hover handles the mouseenter and mouseleave events like so: $('#carousel-view-window').hover(function(){ //Stop Animation here $("#carousel-frame-holder").stop(); clearInterval(roundabout); }, function(){ //Restart Animation here roundabout = setInterval(function(){spin()}, 3000); }); You don't need to subscribe to the mouseout event separately. UPDATE Make sure you store the interval id in the mouseleave handler so you can clear it again.
has comment: http://stackoverflow.com/comment/38757111
has comment: http://stackoverflow.com/comment/38755245
has comment: http://stackoverflow.com/comment/38755017
accepted answer of: http://stackoverflow.com/q/24938377
answers question: http://stackoverflow.com/q/24938377
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38755175
has comment: http://stackoverflow.com/comment/38755049
type: Answer
has comment: http://stackoverflow.com/comment/38755316
score: 0

http://stackoverflow.com/comment/38934034
score: 0
type: Comment
type: QuestionComment
has text: @nietonfir tried that one too.
comment on: http://stackoverflow.com/q/25033263

http://stackoverflow.com/comment/38778842
type: Comment
comment on: http://stackoverflow.com/q/24950517
type: QuestionComment
score: 0
has text: @EricB sorry!!! I'm not native speaker so (too) often I can't really catch the "tone" of a sentence. Yes, intent was to _hint_ (I appreciate it for myself when learning something), not to criticize. :)

http://stackoverflow.com/a/24918486
has body: Duh! Changing the request type from "GET" to "POST" solves the problem. Guessing IE was caching the response. Not the same question, but Error with Internet Explorer and Jquery Ajax has a similar answer. Sorry for the noise.
downvote count: 0
has comment: http://stackoverflow.com/comment/38721280
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24918117
has comment: http://stackoverflow.com/comment/38753306
has comment: http://stackoverflow.com/comment/38744926
score: 1

http://stackoverflow.com/a/24948964
has body: I think what you need is the contextmenu event $("#div-login").on('contextmenu',function (e) { e.stopPropagation(); }); Demo: Fiddle Also see: Can't use jquery's click event handler to detect right click
answers question: http://stackoverflow.com/q/24948898
has comment: http://stackoverflow.com/comment/38775037
type: Answer
score: 0

http://stackoverflow.com/comment/38742460
comment on: http://stackoverflow.com/q/24932216
type: Comment
type: QuestionComment
has text: Please add code which shows what you've tried yet.
score: 1

http://stackoverflow.com/comment/38965988
type: QuestionComment
score: 0
has text: Can you show your requirement as a image?
comment on: http://stackoverflow.com/q/25050608
type: Comment

http://stackoverflow.com/comment/38783843
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24953145
has text: @wick3d Thanks. Doesn't work. Only empty fields produce the wrong username or password error. Everything else does nothing

http://stackoverflow.com/comment/38836511
comment on: http://stackoverflow.com/q/24981946
type: Comment
type: QuestionComment
has text: I think you're looking for `.val()` instead of `.attr('value', ..)`
score: 0

http://stackoverflow.com/a/24984982
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24984811
has comment: http://stackoverflow.com/comment/38842521
type: Answer
downvote count: 0
score: 1
has body: filter() is the most controllable way. Your first approach is only pulling the text() of first element in the collection. This is the same for all getters when there are more than one element in the collection. filter() will loop over all elements and let you run more involved conditions Make sure to quote fonts that have spaces in them or they will be misinterpreted by browser $('.grab-font-family').on('keyup change', function() { var font=this.value; $('.grab-typography a').filter(function(){ return this.title === font;/* return ones that match font */ }).css('font-family', '"'+font+'"'}); })
answers question: http://stackoverflow.com/q/24984811
upvote count: 1

http://stackoverflow.com/q/24916577
has comment: http://stackoverflow.com/comment/38713735
score: 2
downvote count: 0
has title: mousemove to touchmove isn't working
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24917066
type: Question
upvote count: 2
has body: I have a very simple script where two images overlay each other, then by sliding the mouse horizontally, the top image either fades or re-appears. This is used for a then/now mashup. The script works perfect on desktop, but I can't get it to work on mobile. On mobile, the "mouse" is picked up only on the initial touch, but not the slide. I've tried touch-punch.js, tried modifying my code to work with it, but so far I haven't had ANY luck at all... Here's my code &lt;script type="text/javascript" language="JavaScript"&gt; $(document).ready(function() { $('.trackMe').each(function(){ //$(this).children("img:last").mousemove(function(e) { $(this).children("img:last").on("mousemove touchmove", function(e) { var offset = $(this).offset(); var xpos = (e.pageX - offset.left); var ypos = (e.pageY - offset.top); //now to get the first child image width.. var thisImage = $(this); var thisWidth = thisImage.width(); var pct = Math.round((xpos/thisWidth)*100)/100; var ipct = Math.abs(Math.round(((xpos-thisWidth)/thisWidth)*100)/100); thisImage.css({ 'opacity' : ipct }); }); }); }); &lt;/script&gt; I don't have it publicly accessible, but the only components missing are the styles and an over/under image. &lt;style type="text/css"&gt; .trackMe img.packard { width:100% !important; top:0 !important; left:0 !important; position:absolute; margin:0 !important; } .trackMe img.now{ width:100% !important; margin:0 !important; } &lt;/style&gt; &lt;div style="position:relative; min-width:320px; height:auto; overflow:hidden;" class="trackMe"&gt; &lt;img src="1a.jpg" class="now" /&gt; &lt;img src="1b.jpg" class="packard" /&gt; &lt;/div&gt;
tagged with: mobile
has comment: http://stackoverflow.com/comment/38713877
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38713888
has answer: http://stackoverflow.com/a/24917066
favorite count: 0

http://stackoverflow.com/q/25060173
tagged with: twitter-bootstrap
tagged with: datepicker
has answer: http://stackoverflow.com/a/27753024
has title: Prevent deselect date (Bootstrap-datepicker sandbox)
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: jquery
has body: I have a question about the bootstrap-datepicker. When I select a random Date and then open the Popup again and click the same Date, the Input-Field clears. Is there any way to prevent this from happening? I need this because in my case the Input-Field is not allowed to be empty.
favorite count: 0
linked to: http://stackoverflow.com/q/24775260

http://stackoverflow.com/comment/38796033
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24960472
has text: See this [question](http://stackoverflow.com/questions/5210033/show-div-on-hover-with-only-css) for more info
score: 2

http://stackoverflow.com/q/24957393
tagged with: angularjs
type: AnsweredQuestion
type: Question
tagged with: google-maps
has answer: http://stackoverflow.com/a/24958840
has body: I'm trying to create an app in AngularJS that has multiple locations and you click on one and it takes you to the location in Google Maps. I'm having an issue with relocating the Map when a location is clicked. I think I need to add an event listener but i'm not sure. The code creating the map is located in initialize(). Here is the code: var app = angular.module('app', []); app.controller('firstCtrl', function($scope) { $scope.ASiteLocs = [Locations Contained Here...]; $scope.SSiteLocs = [Locations Contained Here...]; $scope.SiteLocs = $scope.SSiteLocs.concat($scope.ASiteLocs); angular.forEach($scope.SiteLocs, function(location) { var clength = location.Point.coordinates.length; if (location.Point.coordinates.substring(clength - 2, clength) === ",0") { location.Point.coordinates = location.Point.coordinates.substring(0, clength - 2).split(","); Lat = location.Point.coordinates[0]; Lon = location.Point.coordinates[1]; Com = ","; location.Point.coordinates = Lon.concat(Com, Lat); } angular.forEach($scope.SSiteLocs, function(object) { object.carrier = 'Sprint'; }); angular.forEach($scope.ASiteLocs, function(object) { object.carrier = 'AT&T'; }); }); function initialize() { var mapOptions = { center: new google.maps.LatLng(41.894465, -88.460500), zoom: 12 }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); var marker = new google.maps.Marker({ position: site.Point.coordinates, map: map, title: 'Click to zoom' }); google.maps.event.addListener(map, 'center_changed', function() { window.setTimeout(function() { map.panTo(site.Point.coordinates); }, 1000); }); google.maps.event.addListener(marker, 'click', function() { map.setZoom(8); map.setCenter(site.Point.coordinates); }); } google.maps.event.addDomListener(window, 'load', initialize); $scope.headerShow = false; $scope.tableAttrs = { hide: false }; }); And HTML: Site ID Site ID Site Finder Back To Search Name Carrier {{site.name}} {{site.carrier}}
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Google Maps Changing Center
tagged with: events
accepted answer: http://stackoverflow.com/a/24958840

http://stackoverflow.com/comment/51160282
has text: Please avoid code-only answers and provide an explanation with the code.
type: AnswerComment
comment on: http://stackoverflow.com/a/31604571
type: Comment
score: 0

http://stackoverflow.com/a/25035801
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25030780
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25030780
has comment: http://stackoverflow.com/comment/38972659
has comment: http://stackoverflow.com/comment/38969489
type: Answer
score: 4
upvote count: 4
has body: One can use colspan in the footer too. It's important to understand that jqGrid set the footer once during creating the grid and then just can change the width of columns on the footer if the user resized the column width. To simplify the code I suggest to set resizable: false property on the columns where we use colspan. The demo demonstrates the solution: In the demo I added resizable: false property in "Client" and "Date" columns ("name" and "invdate" columns) and used the following code after jqGrid is created: var $footRow = $("#list").closest(".ui-jqgrid-bdiv").next(".ui-jqgrid-sdiv").find(".footrow"); var $name = $footRow.find('&gt;td[aria-describedby="list_name"]'), $invdate = $footRow.find('&gt;td[aria-describedby="list_invdate"]'), width2 = $name.width() + $invdate.outerWidth(); $invdate.css("display", "none"); $name.attr("colspan", "2").width(width2); $footRow.find('&gt;td[aria-describedby="list_tax"]').css("border-right-color", "transparent"); $footRow.find('&gt;td[aria-describedby="list_total"]').css("border-right-color", "transparent"); $footRow.find('&gt;td[aria-describedby="list_closed"]').css("border-right-color", "transparent"); $footRow.find('&gt;td[aria-describedby="list_ship_via"]').css("border-right-color", "transparent");
has comment: http://stackoverflow.com/comment/38974698

http://stackoverflow.com/comment/38940960
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25035145
has text: How can I do this? It seems I am not inside the right scope?! ``this.setData1(data)`` returns me an error: ``TypeError: Unable to get property 'setData1' or undefined or null reference``.

http://stackoverflow.com/comment/38975667
comment on: http://stackoverflow.com/q/25055933
score: 0
type: Comment
has text: Your use of buttons[i] as a parameter within a loop is not adequate, You will find all the eventlisteners are using the same button. You can fix this by immediately calling a new function with button[i] as its argument, and then add the eventlistener there.
type: QuestionComment

http://stackoverflow.com/a/25058689
accepted answer of: http://stackoverflow.com/q/25056769
answers question: http://stackoverflow.com/q/25056769
upvote count: 2
type: AcceptedAnswer
has body: Figured this out myself. Without posting all of my code, here is the gist of it: function easeInQuart(t, b, c, d) { return c*(t/=d)*t*t*t + b; } var deltaY // The distance the element is from the bottom of // the screen expressed as a factor of 1 var origY // The original position var distanceY // The distance it can move var y = easeInQuart(deltaY, origY, distanceY, 1);
type: Answer
score: 2
downvote count: 0

http://stackoverflow.com/comment/38850819
has text: @Ashoksri, just replace them with your date fields
score: 0
comment on: http://stackoverflow.com/a/24989228
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/38858181
comment on: http://stackoverflow.com/q/24993189
score: 0
type: Comment
type: QuestionComment
has text: @ dystroy, I use Snap svg.

google-maps
tags question: http://stackoverflow.com/q/24980094
tags question: http://stackoverflow.com/q/24936037
tags question: http://stackoverflow.com/q/25015130
tag name: google-maps
tags question: http://stackoverflow.com/q/25028778
tags question: http://stackoverflow.com/q/24920198
tags question: http://stackoverflow.com/q/25015431
tags question: http://stackoverflow.com/q/24990531
tags question: http://stackoverflow.com/q/24913277
tags question: http://stackoverflow.com/q/25052044
tags question: http://stackoverflow.com/q/24961836
tags question: http://stackoverflow.com/q/25039205
tags question: http://stackoverflow.com/q/24952151
tags question: http://stackoverflow.com/q/24913854
tags question: http://stackoverflow.com/q/24962148
tags question: http://stackoverflow.com/q/24935946
tags question: http://stackoverflow.com/q/25045140
tags question: http://stackoverflow.com/q/24950528
tags question: http://stackoverflow.com/q/24980491
tags question: http://stackoverflow.com/q/25042900
tags question: http://stackoverflow.com/q/25021881
tags question: http://stackoverflow.com/q/25012029
tags question: http://stackoverflow.com/q/24970774
tags question: http://stackoverflow.com/q/24986815
tags question: http://stackoverflow.com/q/25034959
tags question: http://stackoverflow.com/q/24942885
tags question: http://stackoverflow.com/q/24949545
tags question: http://stackoverflow.com/q/24933046
tags question: http://stackoverflow.com/q/25039786
tags question: http://stackoverflow.com/q/24952593
tags question: http://stackoverflow.com/q/25037296
tags question: http://stackoverflow.com/q/25062920
tags question: http://stackoverflow.com/q/24984011
tags question: http://stackoverflow.com/q/24975917
tags question: http://stackoverflow.com/q/25030507
tags question: http://stackoverflow.com/q/24987590
tags question: http://stackoverflow.com/q/24915010
tags question: http://stackoverflow.com/q/24947059
tags question: http://stackoverflow.com/q/24964750
tags question: http://stackoverflow.com/q/24944187
tags question: http://stackoverflow.com/q/24958304
tags question: http://stackoverflow.com/q/24914513
tags question: http://stackoverflow.com/q/24975485
tags question: http://stackoverflow.com/q/25018845
tags question: http://stackoverflow.com/q/25004637
tags question: http://stackoverflow.com/q/25012578
type: Tag
tags question: http://stackoverflow.com/q/25059077
tags question: http://stackoverflow.com/q/24993588
tags question: http://stackoverflow.com/q/24912796
tags question: http://stackoverflow.com/q/24943576
tags question: http://stackoverflow.com/q/25012659
tags question: http://stackoverflow.com/q/25020479
tags question: http://stackoverflow.com/q/24956616
tags question: http://stackoverflow.com/q/24960034
tags question: http://stackoverflow.com/q/25061959
tags question: http://stackoverflow.com/q/24942624
tags question: http://stackoverflow.com/q/24974897
tags question: http://stackoverflow.com/q/25056183
tags question: http://stackoverflow.com/q/25033353
tags question: http://stackoverflow.com/q/24965000
tags question: http://stackoverflow.com/q/24957393
tags question: http://stackoverflow.com/q/24922157
tags question: http://stackoverflow.com/q/25040942
tags question: http://stackoverflow.com/q/24922058
tags question: http://stackoverflow.com/q/25010228
tags question: http://stackoverflow.com/q/24945544
tags question: http://stackoverflow.com/q/25017779
tags question: http://stackoverflow.com/q/24912108
tags question: http://stackoverflow.com/q/25018846

http://stackoverflow.com/a/24925284
has body: You can use ic-ajax to define the mocked response as well. Additionally you can stop and start testing for asynchronous problems like this. test('barObserver', function() { var ctrl = FooController.createWithMixins(); // I was to lazy to set up ember qunit equal(ctrl.get('baz'), null, 'baz initially null'); ic.ajax.defineFixture('/api/bar', { response: { baz: 'something' }, jqXHR: {}, textStatus: 'success' }); ctrl.set('bar', 2); // allow everything else to run (skip a beat) // and then continue testing (essentially allowing ic-ajax to resolve) stop(); Em.run.next(function(){ start(); equal(ctrl.get('baz'), 'something', 'baz set to returned value'); }); }); Pseudo Example: http://jsbin.com/OxIDiVU/853/edit
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24925006
has comment: http://stackoverflow.com/comment/38731919
accepted answer of: http://stackoverflow.com/q/24925006
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38730296
type: Answer

http://stackoverflow.com/a/24951168
accepted answer of: http://stackoverflow.com/q/24951137
has comment: http://stackoverflow.com/comment/38778835
score: 5
upvote count: 5
has comment: http://stackoverflow.com/comment/38778931
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Regex isn´t necessary here, you shorter and cleaner myString = myString.replace('{{', '&lt;span&gt;'); myString = myString.replace('}}', '&lt;/span&gt;'); Another possibility (thx @Artyom Neustroev for comment): myString = myString.replace('{{', '&lt;span&gt;').replace('}}', '&lt;/span&gt;');
has comment: http://stackoverflow.com/comment/38778874
answers question: http://stackoverflow.com/q/24951137
has comment: http://stackoverflow.com/comment/38778771

http://stackoverflow.com/a/25055281
answers question: http://stackoverflow.com/q/25055086
has body: Scope scope and scope Javascript is a fun language. And one of the realy cool things is the binding of this. this is defined on function call. So depending on how you call a method. this can change. You can even change it on the fly. Given the following objects: var Obj = { foo: { myFunc: function () { return this.bar; }, bar: "bar" }, bar: "BAR" } var Obj2 = { foo: { bar: "foobar" }, bar: "FOOBAR" } we can have some fun: Obj.foo.myFunc(); // "bar" but we could use call the method binding a different scope Obj.foo.myFunc.call(Obj); // "BAR" Here Obj is bound to this. We can even bind completly different objects: Obj.foo.myFunc.call(Obj2); // "FOOBAR" Obj.foo.myFunc.call(Obj2.foo); // "foobar" or call it ouside of it's scope: var bar = "something completly different"; var func = Obj.foo.myFunc; func(); // "something completly different" so much fun :)
has comment: http://stackoverflow.com/comment/38977749
has comment: http://stackoverflow.com/comment/38975454
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38979645
type: Answer
has comment: http://stackoverflow.com/comment/38980618
has comment: http://stackoverflow.com/comment/38977634
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38974931
accepted answer of: http://stackoverflow.com/q/25055086

http://stackoverflow.com/q/24977681
tagged with: jquery
has comment: http://stackoverflow.com/comment/38828354
upvote count: 2
answer count: 2
favorite count: 0
has answer: http://stackoverflow.com/a/24977750
has title: Save integers as floats
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24977862
duplicate of: http://stackoverflow.com/q/24977499
downvote count: 4
type: Question
has body: function prec(numb){ var numb_string = numb.toString().split('.') return numb_string[(numb_string.length - 1)].length } function randy(minimum, maximum) { var most_accurate = Math.max ( prec(minimum), prec(maximum) ); return ( ( Math.random() * ( maximum - minimum ) + minimum ).toFixed( most_accurate ) ); } // returns random numbers between these points. 1 decimal place of precision: console.log( randy(2.4,4.4) ); // returns random numbers between these points. 3 decimal places of precision: console.log( randy(2.443,4.445) ); // returns random numbers between these points. Want 3 decimal places of precision. However, get 0: console.log( randy(2.000,4.000) ); // Why do I get 0 decimal places? Because floats are rounded into integers automatically: console.log( 4.0 ); // want 4.0 to be logged. Instead I get '4' You don't need to read how the functions work. Just the console logs. Basically, I need to return a random number between two points to a degree of precision. The precision is automatically derived from the most precise float passed to the randy function. This works fine when the number range is 3.5 3.7 or 34.4322 800.3233 but not 2.0, 3.0 or 4.0000, 5.0000 Then the number is appears to be automatically saved as an integer: console.log( 2.0 ) //=&gt; 2 I want to extend the Number prototype so that 2.0 is saved as 2.0 so that this function can find the precision: function prec(numb){ var numb_string = numb.toString().split('.') return numb_string[(numb_string.length - 1)].length } It currently thinks that 3.000000000 has a precision of 0 decimal places because if 3E8 is passed in as the numb parameter, it's read as 3. I want it read as 3.000000000 While I can do this randy(2.toFixed(3),3.toFixed(3)) it gets unreadable and it would be undeniably nicer to do this for smaller precisions: randy(2.000,3.000). Is this possible? Fiddle
score: -2
tagged with: javascript

string
tags question: http://stackoverflow.com/q/24953158
tags question: http://stackoverflow.com/q/24927285
tags question: http://stackoverflow.com/q/24920185
tags question: http://stackoverflow.com/q/24932345
tags question: http://stackoverflow.com/q/24982323
tags question: http://stackoverflow.com/q/24949128
tags question: http://stackoverflow.com/q/25046110
tags question: http://stackoverflow.com/q/25001451
tags question: http://stackoverflow.com/q/24943580
tags question: http://stackoverflow.com/q/24939131
tag name: string
tags question: http://stackoverflow.com/q/25042532
tags question: http://stackoverflow.com/q/24959210
tags question: http://stackoverflow.com/q/24947471
type: Tag
tags question: http://stackoverflow.com/q/25046271
tags question: http://stackoverflow.com/q/25020354
tags question: http://stackoverflow.com/q/24954588
tags question: http://stackoverflow.com/q/25015548
tags question: http://stackoverflow.com/q/25020495
tags question: http://stackoverflow.com/q/25009142
tags question: http://stackoverflow.com/q/25037635
tags question: http://stackoverflow.com/q/25010901
tags question: http://stackoverflow.com/q/25012629
tags question: http://stackoverflow.com/q/24986814
tags question: http://stackoverflow.com/q/24960384
tags question: http://stackoverflow.com/q/25039452
tags question: http://stackoverflow.com/q/25016084

http://stackoverflow.com/comment/38886583
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24992067
score: 0
has text: @Bjorn, can you show how you added FineUploader as a separate file? When I add it with a simple script tag either before or after my RequireJS markup, I get a "*jQuery is not defined*" at line 13206 of `fineuploader.js`. Did you simply not use the [JQuery plugin](http://docs.fineuploader.com/integrating/jquery.html) in FineUploader?

http://stackoverflow.com/comment/38999055
type: QuestionComment
has text: let me do an example, wait a min :P, you can alert in `$(document).ready` the value of the var successfulMessage and see which is the content
comment on: http://stackoverflow.com/q/25067593
type: Comment
score: 0

http://stackoverflow.com/comment/38819099
type: Comment
has text: Didnt worked, do i need to run these files on server. I am directly opening the file in browser
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24972511

http://stackoverflow.com/comment/38789901
has text: `today` is returning an array of the csv data. `totalSales` must be the sum of each sale of each element in `today`. Debug and look at `today` to see what the variables are called. Loop through it and sum up the correct attribute into `totalSales`
type: Comment
comment on: http://stackoverflow.com/a/24935535
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38925696
comment on: http://stackoverflow.com/q/25029101
score: 0
type: Comment
type: QuestionComment
has text: @ArunPJohny Well i'm impressed with your methodology..

http://stackoverflow.com/a/24933902
has body: Merge script: var merged = (function(key){ var res = []; for(var i=0;i&lt;data.length;i++){ for(var j=0;j&lt;data[i].seriesData.length;j++){ var obj = data[i].seriesData[j]; for(var prop in obj){ if(prop != key &amp;&amp; obj.hasOwnProperty(prop)) { if(res[obj[key]] === undefined){ res[obj[key]] = {}; res[obj[key]][key] = obj[key]; res.push(obj[key]); } res[obj[key]][prop] = obj[prop]; } } } } for(var k=0;k&lt;res.length;k++){ var date = res[k]; res[k] = res[date]; delete res[date]; } return res; })('DATE'); Result: [ { "DATE": "2013-12-10T00:00:00", "Euler GT2": 10, "Newton": 45, "Copernicus GT": 100 }, { "DATE": "2013-12-10T01:00:00", "Euler GT2": 11, "Newton": 34, "Copernicus GT": 0 }, { "DATE": "2013-12-10T02:00:00", "Euler GT2": 0.59, "Newton": 47, "Copernicus GT": 100 } ] Demo: JSFiddle
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24932752

http://stackoverflow.com/comment/38967372
type: QuestionComment
has text: To those who voted to close, are you sure the answer on the other post is valid?
comment on: http://stackoverflow.com/q/25040337
score: 0
type: Comment

http://stackoverflow.com/comment/38928835
has text: You're right, and yeah you usually don't want that (it may well be the main source of javascript bugs), that's why that technique I mentioned was originally conceived. And there are other approaches you can use if you need to share state, to avoid using actual global variables.
type: Comment
comment on: http://stackoverflow.com/a/25030629
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38790215
type: QuestionComment
score: 1
has text: Yes, it has that cache, but it will no longer be able to locate the element in the DOM. If you overwrite the DOM with `.html()`, the library will first call `.empty()` and I'm pretty sure that gets rid of anything in the data cache for the obliterated elements. If you want to keep the DOM nodes, then use `.remove()` or something.
comment on: http://stackoverflow.com/q/24957419
type: Comment

http://stackoverflow.com/q/24963565
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24963595
has body: I am using the following code to programmatically uncheck a checkbox: $('#someid').removeAttr('checked'); Here is the checkbox that is bound to an Angular model: &lt;input id="someid" ng-model="model.property" type="checkbox" value="true"&gt; I can see that the checkbox is indeed unchecking. Why is the Angular model property not also updating (changing from true to false) and how can I obtain this desired behavior? I can update the model and have the checkbox update no problem.
type: AnsweredQuestion
upvote count: 3
has title: Programmatically unchecking checkbox does not update angular model
type: Question
score: 3
has answer: http://stackoverflow.com/a/24963595
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24967816
favorite count: 0
has answer: http://stackoverflow.com/a/24967816

http://stackoverflow.com/q/24990263
upvote count: 1
has answer: http://stackoverflow.com/a/24990374
has answer: http://stackoverflow.com/a/24990567
tagged with: case-insensitive
has comment: http://stackoverflow.com/comment/38852496
type: Question
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24990431
has comment: http://stackoverflow.com/comment/38851982
answer count: 3
tagged with: uppercase
tagged with: getelementbyid
score: 1
has title: How to get elements in java script with case insensitiveness?
favorite count: 0
has comment: http://stackoverflow.com/comment/38851859
has comment: http://stackoverflow.com/comment/38851919
has body: I have a query. I want to get element in java script using it's ID. I can use getElementById. But the problem is that, the ID could be case in sensitive. i.e. Suppose my ID = "Test" then I want to get the element with IDs "Test", "test", "tEsT", "TeSt" and all other case combinations. There is a surety that there would be only one element with the ID among all of above. Can you please help how can I get such element such that I can get the element case insensitively? Thanks in advance.
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/19465157

http://stackoverflow.com/comment/38870671
type: Comment
type: QuestionComment
has text: it says moveToLoc(); is not defined... @Renan
score: 0
comment on: http://stackoverflow.com/q/25000004

http://stackoverflow.com/q/25000553
type: Question
possible better answer: http://stackoverflow.com/a/25000697
tagged with: javascript
has comment: http://stackoverflow.com/comment/38871411
upvote count: 3
answer count: 3
has answer: http://stackoverflow.com/a/25000702
accepted answer: http://stackoverflow.com/a/25000702
has answer: http://stackoverflow.com/a/25000710
has title: Angular Service Injection
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/12295983
score: 3
downvote count: 0
has body: I am working on a trivial task (that I got working) which adds an an .active class to dom elements in a tab nav. Simple. Got it working by following https://stackoverflow.com/a/12306136/2068709. Reading over the answer provided and comparing their controller to example controllers on angular's website I came across something interesting that I don't quite understand. On the AngularJS website, $scope and $location (and other services) are injected into the controller along with an anonymous function which defines the controller. But on the answer, the services are not injected, rather they are passed via the anonymous function. Why does this work? Shouldn't the service always be injected? In terms of an example: Why does this angular.module('controllers', []) .controller('NavigationController', ['$scope', '$location', function($scope, $location) { $scope.isActive = function(route) { return route === $location.path(); }; }]) and this angular.module('controllers', []) .controller('NavigationController', function($scope, $location) { $scope.isActive = function(route) { return route === $location.path(); }; }) both work? This may be trivial but its throwing my brain for a loop that I can't figure out.
has answer: http://stackoverflow.com/a/25000697

http://stackoverflow.com/q/25023202
type: AnsweredQuestion
tagged with: hashtag
has answer: http://stackoverflow.com/a/25023352
accepted answer: http://stackoverflow.com/a/25023352
type: Question
has body: I have found a lot of info on URL's with Hash, but nothing to solve this. I have divs that are hidden then shown when you click it's parent. What I want to add in is if you come in with a #Hash tag that matches the anochor's href attr - trigger it was clicked. Code I have now: $('.speaker_container').on('click','.speaker_img',function(){ $(this).siblings('.speaker-bios').toggle(150);}); Text Name Text Hidden text Text Name Text Hidden text and so on.... `
tagged with: javascript
tagged with: show-hide
score: 0
answer count: 2
has title: Show/Hide Divs based on Anchor Href attr that matches the Hash in the URL
tagged with: jquery
has comment: http://stackoverflow.com/comment/38916117
possible better answer: http://stackoverflow.com/a/25023260
has answer: http://stackoverflow.com/a/25023260

http://stackoverflow.com/q/24918629
has body: I am trying to insert events via the Google Calendar API with a service account. The goal is to have one calendar that all users view: a server-to-server setup. As of now, I can properly call the calendar API and list the events on said calendar: var moment = require("moment"), googleapis = require("googleapis"), googleCal = googleapis.calendar("v3"); serviceEmail = "********@developer.gserviceaccount.com", serviceKeyFile = "./key.pem"; var authClient = new googleapis.auth.JWT( serviceEmail, serviceKeyFile, null, ["https://www.googleapis.com/auth/calendar"] ); authClient.authorize(function (err, tokens) { if (err) { console.log(err); } else { googleCal.events.list({ auth: authClient, calendarId: "********@gmail.com", fields: { items: ["end","start","summary"] } }, function (err, CL) { if (err) { console.log(err); } else { console.log(CL); } }); } }) This properly returns a JSON object that lists all the different objects on the calendar. However, when I try to insert an event directly below the googleCal.events.list call: googleCal.events.insert({ auth: authClient, calendarId: "primary", resources: { start: { dateTime: "2014-07-23T18:25:00.000-07:00", timeZone: "America/New_York" }, end: { dateTime: "2014-07-23T19:25:00.000-07:00", timeZone: "America/New_York" }, summary: "winning @ life", description: "winning @ life description" } }, function (err, something) { if (err) { console.log(err); } else { console.log(something); // do something else } }) The following 400 is returned: { errors: [ { domain: 'global', reason: 'required', message: 'Missing end time.' } ], code: 400, message: 'Missing end time.'} How do I go about fixing this? The authorization is clearly working—I know because I've used up my unauthorized requests for the day and because I can list all the events. I have also specified an endTime. Why is the google calendar API telling me that I haven't?
answer count: 1
has title: Inserting an event with the nodejs google calendar API returns 400: "Missing end time"
favorite count: 0
has answer: http://stackoverflow.com/a/24921883
tagged with: google-api
tagged with: google-api-nodejs-client
tagged with: google-calendar-api
accepted answer: http://stackoverflow.com/a/24921883
tagged with: node.js
score: 2
type: AnsweredQuestion
upvote count: 3
downvote count: 1
has comment: http://stackoverflow.com/comment/38719335
type: Question
tagged with: javascript

arrays
tags question: http://stackoverflow.com/q/24977089
tags question: http://stackoverflow.com/q/25050556
tags question: http://stackoverflow.com/q/24979054
tags question: http://stackoverflow.com/q/25000094
tags question: http://stackoverflow.com/q/25021389
tags question: http://stackoverflow.com/q/24931129
tags question: http://stackoverflow.com/q/24919292
tags question: http://stackoverflow.com/q/25042105
tags question: http://stackoverflow.com/q/25026645
tags question: http://stackoverflow.com/q/25021396
tags question: http://stackoverflow.com/q/24976029
tags question: http://stackoverflow.com/q/25051629
type: Tag
tags question: http://stackoverflow.com/q/25004122
tags question: http://stackoverflow.com/q/24993561
tags question: http://stackoverflow.com/q/24925461
tags question: http://stackoverflow.com/q/24922884
tags question: http://stackoverflow.com/q/24972610
tags question: http://stackoverflow.com/q/25057053
tags question: http://stackoverflow.com/q/25063466
tags question: http://stackoverflow.com/q/24943229
tags question: http://stackoverflow.com/q/24913857
tags question: http://stackoverflow.com/q/25034364
tags question: http://stackoverflow.com/q/24945599
tags question: http://stackoverflow.com/q/24996443
tags question: http://stackoverflow.com/q/24929264
tags question: http://stackoverflow.com/q/25046445
tags question: http://stackoverflow.com/q/24913272
tags question: http://stackoverflow.com/q/24945710
tags question: http://stackoverflow.com/q/24936361
tags question: http://stackoverflow.com/q/24946169
tags question: http://stackoverflow.com/q/24946832
tags question: http://stackoverflow.com/q/24980578
tags question: http://stackoverflow.com/q/24921173
tags question: http://stackoverflow.com/q/25045853
tags question: http://stackoverflow.com/q/25065490
tags question: http://stackoverflow.com/q/25064317
tags question: http://stackoverflow.com/q/25008509
tags question: http://stackoverflow.com/q/24946711
tags question: http://stackoverflow.com/q/25067173
tags question: http://stackoverflow.com/q/24909670
tags question: http://stackoverflow.com/q/25043860
tags question: http://stackoverflow.com/q/24971518
tags question: http://stackoverflow.com/q/24931640
tags question: http://stackoverflow.com/q/24943200
tags question: http://stackoverflow.com/q/24971092
tags question: http://stackoverflow.com/q/24997518
tags question: http://stackoverflow.com/q/25054538
tags question: http://stackoverflow.com/q/24929935
tags question: http://stackoverflow.com/q/25045638
tags question: http://stackoverflow.com/q/25048330
tags question: http://stackoverflow.com/q/24957721
tags question: http://stackoverflow.com/q/24958960
tags question: http://stackoverflow.com/q/24946020
tags question: http://stackoverflow.com/q/25028008
tags question: http://stackoverflow.com/q/24979045
tags question: http://stackoverflow.com/q/25011981
tags question: http://stackoverflow.com/q/24956324
tags question: http://stackoverflow.com/q/25062672
tags question: http://stackoverflow.com/q/25067737
tags question: http://stackoverflow.com/q/24952759
tags question: http://stackoverflow.com/q/25039353
tags question: http://stackoverflow.com/q/25004895
tags question: http://stackoverflow.com/q/25045131
tags question: http://stackoverflow.com/q/24979508
tags question: http://stackoverflow.com/q/24981934
tags question: http://stackoverflow.com/q/25002596
tags question: http://stackoverflow.com/q/24966996
tags question: http://stackoverflow.com/q/24982067
tags question: http://stackoverflow.com/q/25047463
tags question: http://stackoverflow.com/q/25067346
tags question: http://stackoverflow.com/q/24977827
tags question: http://stackoverflow.com/q/24976838
tags question: http://stackoverflow.com/q/25029156
tags question: http://stackoverflow.com/q/25059301
tags question: http://stackoverflow.com/q/24981626
tag name: arrays
tags question: http://stackoverflow.com/q/25007928
tags question: http://stackoverflow.com/q/25050184
tags question: http://stackoverflow.com/q/24970017

http://stackoverflow.com/a/24951571
type: Answer
has body: A few things to try: Rails prevents random model attributes from being sent from forms and has a list of ones that will be allowed through into the params variable. In Rails 3, this is set via attr_accessible in the model. In Rails 4, it's set via the strong_params gem in the controller like this. If you have not set facebook_share as whitelisted, it will be stripped out silently. Or... :remote =&gt; true Is a rails thing where it will take care of the ajax for you as long as you include the ujs script. You shouldn't need to do the Jquery bit to send the data, just to handle the returned stuff. More info here. If you have this enabled and are also doing some jQuery on top, there may be some conflict. Either way: To get an insight into what is actually coming back via AJAX, I'd recommend getting RubyMine installed and enabling the debugger so you can pause on a breakpoint in the controller and see what's happening. Tends to take the headache out of this sort of thing :)
score: 0
answers question: http://stackoverflow.com/q/24949493

http://stackoverflow.com/q/25016900
tagged with: javascript
score: 0
has body: i am new in front end developing. i am currently working on ajax requests in javascript, trying to add TABLEs and OLs of an html page in another page. the coding is as follows ... main html page get all tables and ordered list's html page which is requested by XMLHttpRequest in javascript code sr. no topic comment 1 blah blah blah from div i dont know blah blah blah..from div other blah blah blah.... and an another blah blah blah.... sr. no topic comment 1 blah blah blah i dont know javascript code making ajax request var request = new XMLHttpRequest(); request.open("GET", "HtmlCopyFrom.html", true); request.send(null); var count = 0; request.onreadystatechange = function () { if (request.readyState === 4 && request.status === 200) { //alert("hi "); var newDoc = document.implementation.createHTMLDocument("example"); newDoc.documentElement.innerHTML = request.responseText; var tableElements = newDoc.getElementsByTagName('Table'); var olElements = newDoc.getElementsByTagName('ol'); document.getElementById("ato").onclick = function () { //document.getElementById("ato").onclick = function () for (var i = 0; i < tableElements.length; i++) { document.body.appendChild(tableElements[i]); } for (var i = 0; i < olElements.length; i++) { document.body.appendChild(olElements[i]); } } } } **Problem** i need to click 2 times to get all the table and ol elements for this page. i just want to click once and get all table and ol elements instead.. please help. thanks in advance..
type: UnansweredQuestion
has title: button onclick button working weirdly
type: Question
has answer: http://stackoverflow.com/a/25017102
answer count: 1

http://stackoverflow.com/a/25043155
type: Answer
downvote count: 0
score: 1
has body: Maybe this is what you're looking for: $('.cos_validate_button').click(function(){ var total6 = parseFloat($("#cos6_slider1").val()) + parseFloat($("#cos6_slider2").val()) + parseFloat($("#cos6_slider3").val()) + parseFloat($("#cos6_slider4").val()) + parseFloat($("#cos6_slider5").val()) + parseFloat($("#cos6_slider6").val()); var total4 = parseFloat($("#cos4_slider1").val()) + parseFloat($("#cos4_slider2").val()) + parseFloat($("#cos4_slider3").val()) + parseFloat($("#cos4_slider4").val()); var total = total6+total4; alert("total 6: "+total6+"\ntotal 4: "+total4+"\ntotal: "+total); }); Working fiddle here
accepted answer of: http://stackoverflow.com/q/25042868
answers question: http://stackoverflow.com/q/25042868
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/comment/38822121
comment on: http://stackoverflow.com/q/24974308
type: Comment
type: QuestionComment
score: 2
has text: http://momentjs.com/.

e10s
tag name: e10s
tags question: http://stackoverflow.com/q/24954664
type: Tag

http://stackoverflow.com/a/25023351
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/25023149
downvote count: 0
has body: Since you are doing .details { display: none }, and are simply showing/hiding the text when hover over the image, here's what I would do. $('.photo img').on ({ mouseenter: function () { $(this).parent().find(".details").show(); }, mouseleave: function () { $(this).parent().find(".details").hide(); } }); See working jsFiddle demo
score: 1

http://stackoverflow.com/comment/54056970
type: QuestionComment
has text: An update for others, Brad opened this [issue on HitGub](https://github.com/angular/protractor/issues/1125) which was closed as resolved in cucumber v0.4.7.
comment on: http://stackoverflow.com/q/25026532
score: 0
type: Comment

http://stackoverflow.com/comment/97866191
score: 2
has text: @DevRenanGaspar it's late but for bigger profile picture you can use FB.api('/me', {fields: 'id,name,email,picture.width(500).height(500)'}, function (response) { var picture_url = response.picture.data.url; });
comment on: http://stackoverflow.com/a/45335234
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25068172
type: Question
upvote count: 1
has title: Putting a "resolve" on an angular-ui-router view isn't working - the page simply doesn't render
answer count: 1
has answer: http://stackoverflow.com/a/25081087
tagged with: angular-ui-router
has body: $stateProvider .state('root', { url: '', views: { 'root.base': { templateUrl: '/templates/root/root.html' }, 'root.sidebar': { templateUrl: '/templates/root/root-sidebar.html', controller: 'SomeDataController', resolve: { someData: function(DataService) { // DataService is an angular service for data retrieval return DataService.getDataList(); // returns an array } }, } } }); If I attempt to run a resolve on a subview with angular-ui-router, the page simply comes up blank. If I omit the resolve, it loads fine -- but I need to resolve for some data before my controller is instantiated. Do I have my syntax correct? I've searched for examples high and low but can't seem to find any that match my situation. Given my above example, shouldn't the "root-sidebar.html" have the scope of "SomeDataController", and shouldn't SomeDataController have the data resolved in the route definition declared above?
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
tagged with: angular-ui
score: 1
has comment: http://stackoverflow.com/comment/38999244
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/q/25067266
has title: Script works fine in any WebKit based browser but doesn't in Firefox
tagged with: wordpress
has comment: http://stackoverflow.com/comment/39028791
tagged with: php
linked to: http://stackoverflow.com/q/15932650
has comment: http://stackoverflow.com/comment/38997687
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25067700
has comment: http://stackoverflow.com/comment/39015459
type: Question
accepted answer: http://stackoverflow.com/a/25084198
answer count: 2
has comment: http://stackoverflow.com/comment/38997832
tagged with: firefox
linked to: http://stackoverflow.com/q/988363
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39008439
has body: I have a script in (using wordpress) header.php which looks like this: window.addEventListener("DOMContentLoaded", function(event) { fixedMenu.init("header-container", 0); fixedMenu.init("event-type-wrapper", 20); window.addEventListener('scroll', function(fid){ fixedMenu.top("header-container"); fixedMenu.top("event-type-wrapper"); }); var sessionvar = "&lt;?php echo $_SESSION['lang'] ?&gt;"; }); after this script I include a longer one script with the script scr="" tag. In that script I have window.addEventListener("DOMContentLoaded", function(event) { todays = document.getElementById("todays-events"); upcomming = document.getElementById("upcomming-events"); past = document.getElementById("past-events"); texter = document.getElementById("event-type"); changeMessage(); }); It works fine in any webkit browser, the code is launched, but firefox doesn't load second event listener (I do not know how to debug if it loads or not, but I don't see result in the webpage). Any ideas? UPDATE If there is need, here is the full source for the script embedded through script src= var todays; var upcomming; var past; var texter; window.addEventListener("DOMContentLoaded", function(event) { todays = document.getElementById("todays-events"); upcomming = document.getElementById("upcomming-events"); past = document.getElementById("past-events"); texter = document.getElementById("event-type"); changeMessage(); }); window.onscroll = function(){ changeMessage(); } function isElementInViewport (el) { var rect = el.getBoundingClientRect(); return ( rect.top &gt;= 0 &amp;&amp; rect.left &gt;= 0 &amp;&amp; rect.bottom &lt;= document.body.scrollHeight &amp;&amp; rect.right &lt;= (window.innerWidth || document.documentElement.clientWidth) ); } function changeMessage(){ if(texter &amp;&amp; todays &amp;&amp; isElementInViewport(todays)){ texter.textContent = returnString("Šiandien", "Today", "Сегодня"); } else { if(texter &amp;&amp; upcomming &amp;&amp; isElementInViewport(upcomming)){ texter.t…
has answer: http://stackoverflow.com/a/25084198
has answer: http://stackoverflow.com/a/25067700

http://stackoverflow.com/comment/38774454
type: Comment
comment on: http://stackoverflow.com/a/24948521
type: AnswerComment
has text: @Gamemorize `idNameDialogDiv = $(this).attr("id");` Code inside the .each is irritating my eyes.. Since id is a unique thing, we don't need to write code like that.. :)
score: 0

http://stackoverflow.com/comment/38865339
has text: What about in a cookie? Can one page set a cookie and another page retrieve it?
comment on: http://stackoverflow.com/q/24997292
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38836246
has text: `console.log(vm.projectskey, vm.folderskey);` after your preventDefault and tell us what is in there. As `$('...').val('new');` is right.
comment on: http://stackoverflow.com/q/24981691
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/24924166
downvote count: 0
type: Answer
has body: I have added your code and created a jsfiddle for you... changed code:- function sizeTbl(h) { var tbl = document.getElementById('container'); tbl.style.display = h; if (h == "block") { document.getElementById('down').style.display = 'none'; document.getElementById('up').style.display = 'block'; } else { document.getElementById('up').style.display = 'none'; document.getElementById('down').style.display = 'block'; } } working example:- click to see example:-http://jsfiddle.net/XUjAH/1089/ thanks
upvote count: 2
score: 2
has comment: http://stackoverflow.com/comment/38729105
answers question: http://stackoverflow.com/q/24923912

http://stackoverflow.com/comment/38942767
type: Comment
score: 0
type: AnswerComment
has text: @user47581 yes, exactly, that's what i'm *trying* to explain here.
comment on: http://stackoverflow.com/a/25038354

http://stackoverflow.com/comment/38739480
has text: logically id can not be same for more than one checkbox. So I suggest you should use Class or Name of the checkbox.
type: Comment
comment on: http://stackoverflow.com/a/24929933
score: 0
type: AnswerComment

http://stackoverflow.com/q/24938377
has answer: http://stackoverflow.com/a/24938610
has title: Animation stop on hover, begin on mouseout but can't hover again to repeat stop animation
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38754544
tagged with: animation
tagged with: css
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24938610
has comment: http://stackoverflow.com/comment/38754706
score: 0
type: Question
has body: Working on a carousel, I have the animation and div wrapping working, but I wanted to add the ability to stop the carousel on hover and restart the animation on mouseout, however it's only working once. Hover stops the animation, mouseout starts again, but if I hover again it won't stop. var roundabout = setInterval(function(){ spin() }, 3000); function spin(){ var kerosene = document.getElementById('carousel-frame-holder'); var s = kerosene.offsetLeft; if (s &gt;= -1700 ){ $("#carousel-frame-holder").animate({left: (s - 600 +'px')}); } else{ $("#carousel-frame-holder").animate({left: (s + 1800 +'px')}); } // interruption $("#carousel-view-window" ).hover(function() { $("#carousel-frame-holder").stop(); clearInterval(roundabout); }); $("#carousel-view-window" ).mouseout(function() { setInterval(function(){spin()}, 3000); }); }; //wrap $('#nav-left').click(function(){ var kerosene = document.getElementById('carousel-frame-holder'); var s = kerosene.offsetLeft; if (s &lt;= -1 ){ $("#carousel-frame-holder").animate({left: (s + 600 +'px')}); } else {$("#carousel-frame-holder").animate({left: (s - 1800 +'px')});} }); $('#nav-right').click(function(){ var kerosene = document.getElementById('carousel-frame-holder'); var s = kerosene.offsetLeft; if (s &gt;= -1700 ){ $("#carousel-frame-holder").animate({left: (s - 600 +'px')}); } else {$("#carousel-frame-holder").animate({left: (s + 1800 +'px')});} });
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/24952216
downvote count: 0
answers question: http://stackoverflow.com/q/24952112
has body: Return just aborts the function called in forEach, not your addPackings function. function addPacking(item){ var isInPackings = false; data.packings.forEach(function(entry){ if(item.name == entry.name){ isInPackings = true; } }); if (!isInPackings) data.packings.push(item); }
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/38814158
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24946789
has text: Well then it would be just `.domain([0, semaine[i].disponibilite])`, where `i` denotes the current chart.
type: Comment

http://stackoverflow.com/comment/38717591
type: Comment
type: QuestionComment
has text: Not that I know of, but you could get the information when the page loads and store it in a variable.
score: 0
comment on: http://stackoverflow.com/q/24918526

http://stackoverflow.com/comment/38733862
has text: ok...so is the animation with slidetoggle is useable for you ??
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24927199

http://stackoverflow.com/a/25017830
answers question: http://stackoverflow.com/q/25017733
type: Answer
downvote count: 0
score: 2
has body: You're mixing up the syntax for then here. If you use then it expects two arguments, the first being a success-handler and the second being an error-handler. $scope.button_clicked = function () { var currentObject = $scope.getCurrentObject; $http.post(ENV.server_prefix + 'object/addObject/', currentObject) .then(function (data, status) { //Doing something!! }, function(data, status, params) { alert(data); }); }); };
upvote count: 2

http://stackoverflow.com/comment/39007139
type: Comment
type: QuestionComment
score: 0
has text: Flexslider has base css where the image is 100%, you can apply more specifity on your flexslider such as .flexslider.my-slider img {width:auto;} or whatever
comment on: http://stackoverflow.com/q/25053861

http://stackoverflow.com/comment/96414008
type: Comment
has text: For new users landing here: they now run neck-and-neck. Just use whichever makes sense in your context, it shouldn't matter for performance.
comment on: http://stackoverflow.com/a/25041672
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38971580
comment on: http://stackoverflow.com/q/25053639
has text: when i try to submit form onload of , the "displayPage.php" is not displayed when "fncAutoSubmitForm()" is called
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25051896
has answer: http://stackoverflow.com/a/25051917
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25051956
has title: Swedish character issue
linked to: http://stackoverflow.com/q/1365526
has body: I have a requirement where we need to fetch data using ajax and display in drop down which may contain Swedish characters. In IE Swedish characters are shown as square box, if i read it again using JavaScript it is showing as &amp;#65533; I have used encoding html content UTF8 as below. &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; If i display same data or character on html page directly, it showing correctly. Problem occurs only when JavaScript comes into picture. All inputs are appreciated.
possible better answer: http://stackoverflow.com/a/25051917
type: Question
answer count: 2
tagged with: javascript
tagged with: tomcat
accepted answer: http://stackoverflow.com/a/25051956
tagged with: http://stackoverflow.com/tag/html
score: 0

http://stackoverflow.com/a/24957310
type: Answer
accepted answer of: http://stackoverflow.com/q/24946856
has comment: http://stackoverflow.com/comment/38839382
score: 0
has comment: http://stackoverflow.com/comment/38864907
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24946856
has body: Solved the problem... Used Jquery modal. This prevented me from having to create multiple modals. In the modal I have a "click" method that determines which item got clicked, then outputs that specific message. See code below. index.gsp <%-- Some code (saving space for body) --%> Error Checking User ID Task ID Error Message <g:each in="${lists}" var="list"> ${list.userId} ${list.taskId} <g:if test="${(list.errorMsg).contains("400")}"> ${list.errorMsg} </g:if> <g:elseif test="${(list.errorMsg).contains("500")}"> ${list.errorMsg} </g:elseif> </g:each> <r:require modules="jquery"/>

http://stackoverflow.com/q/24923713
has comment: http://stackoverflow.com/comment/38727277
score: 0
has comment: http://stackoverflow.com/comment/38727279
has comment: http://stackoverflow.com/comment/38727205
has comment: http://stackoverflow.com/comment/38727701
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38727496
answer count: 0
tagged with: javascript
tagged with: jquery
has body: New to playing with jQuery and javascript (and stackOverflow). My project is basically a scrolling page with linked divs. For aesthetic reasons, I wold like to have each div fill the size of window and I decided that jQuery would be an easy way to do this. The basic structure is this: IF the div is shorter than the window THEN grow to the size of the window. ELSE use an auto height I can get a single div to behave this way, the problem is I am applying this to a class and the other objects do not seem to want to behave in the same manner. Here is a fiddle (first time making a fiddle so if the link is not working let me know - http://jsfiddle.net/ksaiyo/VBMVQ/3/ This fiddle shows the exact opposite: http://jsfiddle.net/ksaiyo/6YYFU/1/ My script is here, but the fiddle seems to show the effect well enough. The heights stay at the auto height. (I have a fixed navigation header and unelegantly used padding on top so the linked elements in the page line up correctly - thus the extraneous variables) $(document).ready(function() { var divHeight = $( ".content" ).height(); var winHeight = $( window ).height(); var headerHeight = $( "header" ).height(); var viewHeight = winHeight - headerHeight var newHeight = winHeight + headerHeight; if (divHeight &lt;= viewHeight ) { $( ".content" ).height(newHeight); }; )} I have searched around and I can't seem to nail down the exact reason to why this is occurring. I tried to use an else statement in conjunction, but then everything including the small elements adopt the auto height. (I tried it in the fiddle as well) Thanks in advance for your help.
has comment: http://stackoverflow.com/comment/38727295
has comment: http://stackoverflow.com/comment/38727491
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: jQuery element height calculation behaving unexpectedly
has comment: http://stackoverflow.com/comment/38727682

http://stackoverflow.com/comment/38771690
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24947283
type: AnswerComment
has text: http://jsfiddle.net/yX4AF/ sir, i tried, but why the input is gone,the set was set to td only

http://stackoverflow.com/q/24975084
score: 0
answer count: 2
tagged with: real-time
has comment: http://stackoverflow.com/comment/38823394
has title: how to click submit on achor tag without it refreshing the data on page php, sql and javascript
tagged with: jquery
has body: when ever I click send on the anchor tag the whole data on the page coming from the database refreshes. How do I prevent this. I have tried several options online but none works. my JavaScript code is below. In some way I'm trying to get it like a facebook activity feed where the reatime info is being pushed out and the content that is already there does not disappear and appear on refresh. here is the anchor tag being echod by php send
has answer: http://stackoverflow.com/a/24975293
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/38823415
has answer: http://stackoverflow.com/a/24975122
type: Question
has comment: http://stackoverflow.com/comment/38823372
tagged with: javascript
has comment: http://stackoverflow.com/comment/38823454

http://stackoverflow.com/comment/38848468
score: 0
has text: Alright, appreciate it!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24987791

gulp
tags question: http://stackoverflow.com/q/25019955
tags question: http://stackoverflow.com/q/24966781
tags question: http://stackoverflow.com/q/24964727
tags question: http://stackoverflow.com/q/24951637
type: Tag
tags question: http://stackoverflow.com/q/24937136
tag name: gulp
tags question: http://stackoverflow.com/q/25007130
tags question: http://stackoverflow.com/q/24985826
tags question: http://stackoverflow.com/q/24992980
tags question: http://stackoverflow.com/q/25043067
tags question: http://stackoverflow.com/q/24999662
tags question: http://stackoverflow.com/q/24994830
tags question: http://stackoverflow.com/q/24999744
tags question: http://stackoverflow.com/q/25022412
tags question: http://stackoverflow.com/q/25005279
tags question: http://stackoverflow.com/q/25023793
tags question: http://stackoverflow.com/q/24977822
tags question: http://stackoverflow.com/q/24979799

http://stackoverflow.com/a/24983561
score: 0
has body: Go with Lucas' answer or modify your own code crtButton is a jquery object so it doesn't have onclick property. Edit onclick property of the DOM element instead (which is crtButton[0]) Or just skip jQuery and use getElementById window.onload = function() { prepareEventHandlers(); } function prepareEventHandlers() { var hideDiv = document.getElementById("menu"); var crtButton = document.getElementById("hide"); crtButton.onclick = function() { hideDiv.style.display = 'none' }; }
has comment: http://stackoverflow.com/comment/38839659
has comment: http://stackoverflow.com/comment/38839543
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38839464
type: Answer
accepted answer of: http://stackoverflow.com/q/24983416
answers question: http://stackoverflow.com/q/24983416
has comment: http://stackoverflow.com/comment/38840220

http://stackoverflow.com/q/24958886
has comment: http://stackoverflow.com/comment/38802127
type: AnsweredQuestion
upvote count: 3
score: 1
has body: I've been searching the Highmaps Map Collection and can't find the map data for the UK. Does anyone know where to find this? It seems strange that they would have country maps for so many different countries, but not have one for the UK.
type: Question
tagged with: highcharts
accepted answer: http://stackoverflow.com/a/24963562
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/38804600
favorite count: 0
downvote count: 2
has title: Highmaps UK map data
has comment: http://stackoverflow.com/comment/70152320
has answer: http://stackoverflow.com/a/24963562

http://stackoverflow.com/a/25086726
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25036140
score: 4
answers question: http://stackoverflow.com/q/25036140
has body: You can use the callback to tokenizeCard to send an XHR request to your back end, much like you would with onSubmitEncryptForm. Here's an example with a rudimentary PHP backend: Client Side (documentation) var client = new braintree.api.Client({clientToken: "&lt;%= @client_token %&gt;"}); // use the card details to request a nonce, passing in the callback we define below: client.tokenizeCard({number: "4111111111111111", expirationDate: "10/20"}, onCardTokenization); function onCardTokenization (err, nonce) { if (err) { return; } // we've gotten the nonce // let's go ahead and send it to our backend // to process the transaction $.post('/checkout', { nonce: nonce, }) .success(function () { document.body.innerHTML = 'success.' }) } Server Side (documentation) $nonce = $_POST["nonce"] $result = Braintree_Transaction::sale(array( 'amount' =&gt; '100.00', 'paymentMethodNonce' =&gt; $nonce ));
type: Answer
has comment: http://stackoverflow.com/comment/39042349
upvote count: 4
type: AcceptedAnswer

client-server
tags question: http://stackoverflow.com/q/25035260
tags question: http://stackoverflow.com/q/24993048
tags question: http://stackoverflow.com/q/24914455
type: Tag
tags question: http://stackoverflow.com/q/24961452
tag name: client-server
tags question: http://stackoverflow.com/q/25002410

http://stackoverflow.com/q/25046145
tagged with: javascript
has body: Can someone please put me out of my misery and 'fix' or 'solve' my issue: as you can see via my JSfiddle link http://jsfiddle.net/SJkmh/312/ jQuery(document).ready(function ($) { var h = $("#main-menu").height() * 1.25; $(".scroll").click(function (event) { event.preventDefault(); $('html,body').animate({ scrollTop: $(this.hash).offset().top - h }, 300); }); I can't seem to get it to work - all I want to do is change the colour of the link text to identify what section of the page the user is on. please help me? Thanks in advance
score: 0
has comment: http://stackoverflow.com/comment/38958130
answer count: 3
has answer: http://stackoverflow.com/a/25046466
has answer: http://stackoverflow.com/a/25046456
type: UnansweredQuestion
tagged with: scroll
has title: Change link attribute when scrolling to anchor
tagged with: anchor
has answer: http://stackoverflow.com/a/25046462
type: Question

http://stackoverflow.com/a/25046554
answers question: http://stackoverflow.com/q/25046301
has comment: http://stackoverflow.com/comment/121608564
accepted answer of: http://stackoverflow.com/q/25046301
has body: This information is outdated as of now, but cannot be deleted. You can create File instances just by specifying a path when your code is chrome-privileged: new File("/path/to/file"); File is a sub-class of Blob, so all File instances are also valid Blobs. Please note that this requires a platform path, and not a file URL. Yes, FileReader is available to addons. File and FileReader are available in all windows. If you want to use them in a non-window scope (like bootstrap.js or a code module), you may use nsIDOMFile/nsIDOMFileReader.
type: AcceptedAnswer
downvote count: 24
type: Answer
has comment: http://stackoverflow.com/comment/76936441
score: 14
has comment: http://stackoverflow.com/comment/54406293
upvote count: 38
has comment: http://stackoverflow.com/comment/88812546

http://stackoverflow.com/comment/38917217
type: Comment
score: 1
has text: @Mils ah got it... Yeah i guess it is because the component doesn't handle click outside to hide it...
type: AnswerComment
comment on: http://stackoverflow.com/a/25006979

http://stackoverflow.com/comment/38945177
score: 0
comment on: http://stackoverflow.com/q/25039281
has text: [`[javascript] onunload ajax`](https://stackoverflow.com/search?q=[javascript]+onunload+ajax)
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38709900
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24914513
has text: I want to get my location using HTML 5 geolocation API and then center a map to my location, I know I could directly use Google Maps API, but I need to use iframe, because of placemarks in my map.

http://stackoverflow.com/comment/38989201
has text: I'm pretty sure that `div` elements can only obtain focus through tab. And if they don't have focus to begin with, they obviously cannot lose it.
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25063023

http://stackoverflow.com/q/24970730
has answer: http://stackoverflow.com/a/24971101
has answer: http://stackoverflow.com/a/24970902
accepted answer: http://stackoverflow.com/a/24970902
type: Question
possible better answer: http://stackoverflow.com/a/24970800
has title: How to extract only grouped text using regex with 'g' option in JavaScript
tagged with: javascript
has answer: http://stackoverflow.com/a/24970909
score: 0
linked to: http://stackoverflow.com/q/5006716
answer count: 4
has body: Let's say I have a url like this: url = http://www.example.com/listing.html?pid=1234&amp;pid=1235&amp;pid=1236 How can extract only the value after 'pid=' using regex without the text itself by using the regex. Here how my regex looks like now: url.match(/pid=(\w+)/g) Which is giving following output: ["pid=1234", "pid=1235", "pid=1236"] But I want to get it like this: ["1234", "1235", "1236"] Please correct me if I am doing some thing wrong in here.
has answer: http://stackoverflow.com/a/24970800
tagged with: regex
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38815212

http://stackoverflow.com/a/25009772
has comment: http://stackoverflow.com/comment/38892300
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25009645
has comment: http://stackoverflow.com/comment/38889937
accepted answer of: http://stackoverflow.com/q/25009645
type: Answer
has body: If there are no select option with selected attribute, first option will be the selected option by default. You can try adding another option to top that contains default value as follow. &lt;select id='bill_to'&gt; &lt;option value='-1'&gt;Select&lt;option&gt; &lt;option value='a634jhj2'&gt;test@c.com&lt;option&gt; &lt;option value='agfd4ghj2'&gt;test2@c.com&lt;option&gt; &lt;option value='asdf634jhj2'&gt;tes3@c.com&lt;option&gt; &lt;option value='agf2342d4ghj2'&gt;test4@c.com&lt;option&gt; &lt;/select&gt; If nothing is selected you will get -1 and then you can proceed. e.g. http://jsfiddle.net/fZv5t/
upvote count: 7
score: 7

http://stackoverflow.com/comment/38985924
score: 0
type: Comment
has text: Thank you, I appreciate the advice, that will come in handy
type: AnswerComment
comment on: http://stackoverflow.com/a/25046062

http://stackoverflow.com/comment/38927156
comment on: http://stackoverflow.com/a/25013505
type: AnswerComment
has text: Thanks! I had an error in declaring the property: ref.$child(partyId).$child('attendings').$child(user.username).$set(user.username) where ref is my path to the database.
score: 0
type: Comment

http://stackoverflow.com/comment/38936166
comment on: http://stackoverflow.com/q/25035195
type: QuestionComment
has text: Do you want them as an array? `.get()`?
type: Comment
score: 1

http://stackoverflow.com/a/24926601
type: Answer
answers question: http://stackoverflow.com/q/24926427
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24926427
type: AcceptedAnswer
has body: your jquery var main="SL45NU2154-60"; var arr=main.split('-'); var fnal=parseInt(arr[1]); var last2=parseInt(arr[0].substr('-2')); var firstval=arr[0].slice(0,-2); for(var i=last2;i &lt;= fnal;i++) { alert(firstval+""+i); } DEMO
upvote count: 2

http://stackoverflow.com/q/25018365
downvote count: 0
score: 1
tagged with: brush
favorite count: 0
type: Question
has body: I'm wondering whether there is some high level way of having more than one brush on a graph. Here's the problem: I have a stacked bar chart where each bar represents one weekday and different metrics are stacked on top of one another (stacked line charts are not available yet as far as I know). Now I would like to let the user select the days to display (and the selection should propagate into the other graphs). Everything works great with the brush on, but if you want to choose Sunday, which is at the end of the graph, and Monday which is at the beginning, you can't do that using a single brush. Anybody knows of a way to add more brushes? Alternatively I'm looking for a way to add a click event listener that would "activate" the day you click on in a similar way like a ring chart section would work. Thanks a lot for your ideas, Renra
has title: Multiple brushes in dc.js graphs
accepted answer: http://stackoverflow.com/a/25024916
upvote count: 1
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25024916
tagged with: dc.js
type: AnsweredQuestion

http://stackoverflow.com/comment/38936958
type: Comment
comment on: http://stackoverflow.com/a/25035399
has text: can you try to make a jsfiddle. It will be easier to debug your code then
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38711036
comment on: http://stackoverflow.com/q/24914864
has text: uhm, what about creating a ` ` element, adding it to body and for each log item add a line with `jQuery(x).text()` as content?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38803593
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24962943
has text: I'm with @Pointy - really unclear what you're trying to accomplish here. It looks like some sort of Fibonacci sequence etc. If so, I think you can do it better. If you just want to deep copy an object I'd use `lodash` for that.

http://stackoverflow.com/comment/38940794
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25037346
has text: Change your preferences to preserve the console when a new page is loaded then.

http://stackoverflow.com/q/25046961
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38991096
accepted answer: http://stackoverflow.com/a/28518500
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38967448
type: Question
possible better answer: http://stackoverflow.com/a/25064802
score: 5
has answer: http://stackoverflow.com/a/25064802
upvote count: 5
tagged with: javascript
answer count: 2
has body: How do I pass an OPTIONAL parameter to my angularJS modal? Here is my code: CONTROLLER A (TRIGGER): $modal.open({ templateUrl: 'UploadPartial.html', controller: 'photos.uploadCtrl', resolve: { preselectedAlbum: function preselectedAlbum() { return angular.copy($scope.selectedAlbum); } } }); CONTROLLER B (MODAL): app.controller('photos.uploadCtrl', [ '$scope', '$modalInstance', '$injector', function uploadCtrl($scope, $modalInstance, $injector) { if ($injector.has('preselectedAlbum')) { console.log('happy'); // I want this to work, but $injector doesn't find it } else { console.log('sad'); // Always gets here instead :( } } ]); NOTE: It works when i put preselectedAlbum as a dependency, but then i get the error whenever I don't explicitly pass it in. I want it to be optional instead.
downvote count: 0
has answer: http://stackoverflow.com/a/28518500
has title: AngularJS - Pass Optional Parameter to Modal

http://stackoverflow.com/a/24970521
accepted answer of: http://stackoverflow.com/q/24969840
type: Answer
answers question: http://stackoverflow.com/q/24969840
type: AcceptedAnswer
has body: You could use display: inline-block; but if the added space between the elements bothers you, try floating all the div elements to the left or right and clear the container if necessary. div { float: left; } or div { float: right; } depending on the ordering you're looking for and .container { overflow: auto; } as a clear-fix, assuming that you've assigned the container class to the containing element.
score: 0

http://stackoverflow.com/comment/38972105
type: AnswerComment
score: 0
has text: The size function was only added to try and solve the problem. Edit: Yep it works, Thanks!
type: Comment
comment on: http://stackoverflow.com/a/25053993

http://stackoverflow.com/q/24944316
type: Question
has title: Meteor - Cancelling a Server Method from the Client
answer count: 2
has body: I'm performing a database count through a server method. Users can select how they want the count to be performed and then invoke the method. My problem is that the count can take some time and a user might change their mind while the method is running and request a different count. Is there any way for me to cancel the invoked method and run a new count? I've thought this.unblock() might work; it will allow a new method to be run, but it won't cancel the old method. I've also considered pre-counting and then just using a lookup, but there are too many selector combinations. Here's my code, it's fairly simple: //Server Meteor.methods({ getFilterCount: function(oFilterSelector) { return clMaBldgs.find(oFilterSelector, {}).count(); } }); //Client Meteor.call('getFilterCount', oFilterSelector, function (error, result) { //do some stuff });
score: 12
has comment: http://stackoverflow.com/comment/64960502
has answer: http://stackoverflow.com/a/38830710
has answer: http://stackoverflow.com/a/40458981
upvote count: 12
has comment: http://stackoverflow.com/comment/64960944
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/45306201
downvote count: 0
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/45238905
has comment: http://stackoverflow.com/comment/64961610

http://stackoverflow.com/comment/38807685
comment on: http://stackoverflow.com/q/24955292
type: Comment
type: QuestionComment
has text: @knowbody: Can you add to your question some sample data and the expected output? I hope i can arrive at the correct solution then
score: 1

event-handling
tag name: event-handling
tags question: http://stackoverflow.com/q/24927585
tags question: http://stackoverflow.com/q/25007854
tags question: http://stackoverflow.com/q/25035987
tags question: http://stackoverflow.com/q/25027678
tags question: http://stackoverflow.com/q/24938407
tags question: http://stackoverflow.com/q/24959123
tags question: http://stackoverflow.com/q/24930877
tags question: http://stackoverflow.com/q/24965870
tags question: http://stackoverflow.com/q/24926761
tags question: http://stackoverflow.com/q/24931675
type: Tag
tags question: http://stackoverflow.com/q/24925755

http://stackoverflow.com/comment/38948508
comment on: http://stackoverflow.com/q/25041186
type: QuestionComment
type: Comment
has text: @inorganik I'm not all that familiar with the audio API, but I assumed that the play button provided by the `audio` tag would play the file. As I said, it actually does play the file, but only after pressing play and then clicking on the timeline. I just played with it a little, and pressing play/pause/play will also play the file. Am I missing something?
score: 0

http://stackoverflow.com/q/25010572
has title: Chrome-extension: any way to detect dom changes?
tagged with: javascript
duplicate of: http://stackoverflow.com/q/2844565
score: 0
tagged with: google-chrome-extension
linked to: http://stackoverflow.com/q/2844565
has comment: http://stackoverflow.com/comment/38890184
type: UnansweredQuestion
answer count: 0
has body: Looking at this updated answer, Is there a JavaScript/jQuery DOM change listener?, it is still from 2012. I'm wondering if there has been any changes since then to listen for dom changes in the google chrome extension. Is it possible that there's a chrome API for detecting dom changes on the current page? For example, when you click a button, and the ajax loads some element on the current page? If nothing specific for chrome, is there an updated way of listening for dom changes on the current page?
has comment: http://stackoverflow.com/comment/38890394
tagged with: dom
type: Question

http://stackoverflow.com/comment/38779798
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24951644
has text: You can use preventDefault() method for the parent elements's hover event to define new hover for the child element by preventing parent's hover.

http://stackoverflow.com/comment/38927020
score: 0
type: Comment
has text: And also i put the variable global and the same error is getting, please suggest with another code
type: AnswerComment
comment on: http://stackoverflow.com/a/25029957

http://stackoverflow.com/comment/38857867
has text: I see. I would find another hosting because this is a major limitation to Python usage. Or you could just use another language to implement an HTTP API. That could be for example node.js (JavaScript) since you already know JS.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24993460
type: Comment

http://stackoverflow.com/comment/38793192
comment on: http://stackoverflow.com/q/24958960
has text: Mark: V8 recognizes it as an object. A console or REPL may not give a visual display though.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24920303
has body: I'm trying to get it so that a vertex will highlight a border on a mouse over, but have no border otherwise. I've tried using the strokewidth and stroke color to do this, but the border doesn't seem to obey me setting it to zero, there's always a 1px outline. Looking at the source code I have I see: var strokeWidth=Math.max(1,this.strokewidth*this.scale); So should I override this and remove the Math.max call so the 1px minimum isn't enforced?
type: Question
upvote count: 1
downvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24922772
accepted answer: http://stackoverflow.com/a/24922772
favorite count: 0
tagged with: mxgraph
has title: How do I remove the vertex border in mxGraph?
tagged with: stroke
type: AnsweredQuestion
score: 1

webbrowser-control
type: Tag
tags question: http://stackoverflow.com/q/25031979
tag name: webbrowser-control

http://stackoverflow.com/comment/38715230
comment on: http://stackoverflow.com/q/24917188
type: QuestionComment
type: Comment
has text: Plus, we don't know what `elem` is, and it would be a lot easier if you posted the HTML rendered instead of the jQuery used to create it.
score: 1

http://stackoverflow.com/a/24954403
score: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38784519
type: Answer
upvote count: 1
has body: You're not far off, you just need to unwrap your person observable when referencing it in your markup: Updated JSFiddle &lt;input data-bind="value:person().name" /&gt; &lt;input data-bind="value:person().age" /&gt; Edit from comment Update JSFiddle You can make the properties of Person observable so that they track changes like so: function Person(name, age) { this.name = ko.observable(name); this.age = ko.observable(age); }
has comment: http://stackoverflow.com/comment/38784398
answers question: http://stackoverflow.com/q/24954267

http://stackoverflow.com/q/25060425
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: twitter-bootstrap
score: 0
answer count: 1
has title: How to style form inside modal with Bootstrap 3
has answer: http://stackoverflow.com/a/25060518
type: AnsweredQuestion
has body: I place this form using modal.In order to do so I use this helper library like this: BootstrapDialog.show({ message:formHtml ,cssClass:'.form-dialog' }); I use this css: #ma-form-container{ width:600px; height:100%; } #ma-form label { display:inline-block; text-align:right; } I find that the form is much larger than the modal,I also tried using the css: #ma-form-container{ width:100%; height:100%; } y I find that $("#ma-form") and $("#ma-form-container") are empty when the modal is open. EDIT: I have changed the template and removed the plugin: ×Close Details AuthorizGroup Description Object type Planner group Planning plant EquipCategory Close Submit With this I am using this to open the dialog: $("#map-actions a").on("click",function(e){ event.preventDefault(); $("#openModal").html(formHtml); $("#openModal").css("display","block"); });
tagged with: javascript
tagged with: jquery
type: Question
accepted answer: http://stackoverflow.com/a/25060518

search
tags question: http://stackoverflow.com/q/24960936
type: Tag
tags question: http://stackoverflow.com/q/24996510
tags question: http://stackoverflow.com/q/24986720
tags question: http://stackoverflow.com/q/25049686
tag name: search
tags question: http://stackoverflow.com/q/24955153

canvas
tags question: http://stackoverflow.com/q/25026024
tags question: http://stackoverflow.com/q/24975256
tags question: http://stackoverflow.com/q/24977169
tags question: http://stackoverflow.com/q/24919680
tags question: http://stackoverflow.com/q/25003499
tags question: http://stackoverflow.com/q/24971377
tags question: http://stackoverflow.com/q/24996772
tags question: http://stackoverflow.com/q/24939486
tags question: http://stackoverflow.com/q/24950446
tags question: http://stackoverflow.com/q/24961914
tags question: http://stackoverflow.com/q/25060716
tags question: http://stackoverflow.com/q/25052843
tags question: http://stackoverflow.com/q/25066906
tags question: http://stackoverflow.com/q/25035738
tags question: http://stackoverflow.com/q/25020342
tags question: http://stackoverflow.com/q/25018715
tags question: http://stackoverflow.com/q/24998317
tags question: http://stackoverflow.com/q/24926028
tags question: http://stackoverflow.com/q/24929308
tags question: http://stackoverflow.com/q/24961464
tags question: http://stackoverflow.com/q/25023887
tags question: http://stackoverflow.com/q/24968291
tags question: http://stackoverflow.com/q/24945340
tags question: http://stackoverflow.com/q/25011916
tags question: http://stackoverflow.com/q/25007947
tag name: canvas
tags question: http://stackoverflow.com/q/25006310
tags question: http://stackoverflow.com/q/24958545
tags question: http://stackoverflow.com/q/25029771
tags question: http://stackoverflow.com/q/24969315
tags question: http://stackoverflow.com/q/24989440
tags question: http://stackoverflow.com/q/24924400
tags question: http://stackoverflow.com/q/25066930
tags question: http://stackoverflow.com/q/24933029
tags question: http://stackoverflow.com/q/24984125
tags question: http://stackoverflow.com/q/24937562
tags question: http://stackoverflow.com/q/25033057
tags question: http://stackoverflow.com/q/24920318
type: Tag
tags question: http://stackoverflow.com/q/24944416
tags question: http://stackoverflow.com/q/24952450
tags question: http://stackoverflow.com/q/25048617
tags question: http://stackoverflow.com/q/25030792
tags question: http://stackoverflow.com/q/25031955
tags question: http://stackoverflow.com/q/24911216
tags question: http://stackoverflow.com/q/24940733
tags question: http://stackoverflow.com/q/24974311
tags question: http://stackoverflow.com/q/25006848
tags question: http://stackoverflow.com/q/24994228
tags question: http://stackoverflow.com/q/25066341
tags question: http://stackoverflow.com/q/24931919
tags question: http://stackoverflow.com/q/24949751
tags question: http://stackoverflow.com/q/24950216
tags question: http://stackoverflow.com/q/24910141
tags question: http://stackoverflow.com/q/24989977
tags question: http://stackoverflow.com/q/24990118
tags question: http://stackoverflow.com/q/24958294
tags question: http://stackoverflow.com/q/24976547
tags question: http://stackoverflow.com/q/24926862

http://stackoverflow.com/q/24987919
has title: How to put value on input using setInterval
has answer: http://stackoverflow.com/a/24987945
score: 1
has body: I want to do is the setInterval function will continue produce value to #test1 and if the user click the button the value of #test1 will be empty and back to 1 again sec after the button was clicked. current output: http://jsfiddle.net/eKWyY/43/ var tint = setInterval( function () { regain(); }, 500); $('#clickme').click(fuction(){ $('#test1').val(''); }); function regain(){ $('#test1').val("1"); }
answer count: 2
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: ajax
possible better answer: http://stackoverflow.com/a/24987945
accepted answer: http://stackoverflow.com/a/24987956
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/24987956
has comment: http://stackoverflow.com/comment/38847824
type: Question

http://stackoverflow.com/comment/38889678
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/25009331
has text: I'm afraid there is no 'simple' for web browser.

http://stackoverflow.com/comment/38766933
comment on: http://stackoverflow.com/q/24942012
type: QuestionComment
has text: Using 11. Would be interested if folks see the issue in other versions to comment please.
score: 0
type: Comment

http://stackoverflow.com/a/24987071
has comment: http://stackoverflow.com/comment/38855443
accepted answer of: http://stackoverflow.com/q/24986962
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24986962
has comment: http://stackoverflow.com/comment/38846293
upvote count: 8
type: Answer
score: 8
has comment: http://stackoverflow.com/comment/38846230
has comment: http://stackoverflow.com/comment/38846695
has body: It's completely depend on you, But in my opinion, You should not compare Rails and Django with Node.js. It's better to compare Node.js with Ruby or Python and compare Rails and Django with Node.js based full stack frameworks like Geddy, Sails.js or Total.js. I have about 3-4 years experience of working with these frameworks and I can simply say that while Django and Rails speed up your development process, Node.js based frameworks are more flexible and most of the time give you better performance, But I It's better for you to learn the real procedure of web development instead of sticking to an specific framework. When you learn how to develop the web, You can easily switch between frameworks and In real world you can't say that one framework is better than another one, You should choose your framework based on the project needs. The bottom line: You can read these nice articles and comparisons: Why we moved from NodeJS to Ruby on Rails Which should I learn? Python vs Django Ruby on Rails vs. Node.js at LinkedIn - InfoQ

http://stackoverflow.com/comment/44194969
comment on: http://stackoverflow.com/a/27897077
type: Comment
type: AnswerComment
has text: updated the jsfiddle so that click-to-edit directive does not show save n cance in edit all mode. I have edited my answer to include the new link. [link](http://jsfiddle.net/chandings/n7Gxa/13/)
score: 0

http://stackoverflow.com/comment/38725263
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24921703
has text: @Exception have you actually tried the code at that pastie.org link? I don't think it actually works. I can't get syntax like that to work with Mustache/Handlebars. The code I posted does though.

http://stackoverflow.com/q/24983701
type: UnansweredQuestion
score: 2
upvote count: 2
has body: I am using jquery mask plugin and looking to callback functions when input is not valid. When user enters an invalid character the character is removed by the mask automatically, how ever I want to display some hint to user, like "You have entered '1' which is not correct character, please enter a to z" I asked it at https://github.com/igorescobar/jQuery-Mask-Plugin/issues/180 and it is not supported yet. I wonder if anyone has same issue and have found any workaround (or any guide which part of the plugin should be changed)
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/34690304
has title: callback function when input character is not accepted by mask
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: jquery-mask

http://stackoverflow.com/comment/38967374
comment on: http://stackoverflow.com/q/25047562
has text: The upperleft of your svg element is (0,0) in x,y. So when you want to change the starting value, you need to change the coordinate position.
score: 0
type: Comment
type: QuestionComment

memoization
type: Tag
tag name: memoization
tags question: http://stackoverflow.com/q/25006507

http://stackoverflow.com/q/24926993
tagged with: css
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/38733443
linked to: http://stackoverflow.com/q/526035
type: Question
has comment: http://stackoverflow.com/comment/38733206
has answer: http://stackoverflow.com/a/24927191
tagged with: jquery-animate
tagged with: javascript
has comment: http://stackoverflow.com/comment/38733177
answer count: 2
has body: I'm trying to make a list filled with an unknown number of items animate out from underneath a div when it is being hovered over in such a way that it seems like the list is being pulled down rather than resized down. (The jquery slideDown() and slideToggle()-functions does the "pulled down" version nicely, but I want the list items to come down kinda like if you had written on roll-up curtains and were rolling it down.) Lists, divs, or tables doesn't matter; as long as it looks like I want it to. Here's a jsfiddle with the essentials of what I've tried. As in the real application, the only problem is that when it's in its up-rolled position, (sometimes) it's higher than the parent div and shows up above it. In the code below (from jsfiddle), I want #popouter to only show when it's below #toggle, not when it sticks up above it when being "rolled up": Click me to reveal the generated texts Some generated text Some generated text Some generated text Some generated text </div I'd love for there to be a way to let the list items "float" down and just animate() up the height of the list until all of the items (starting with the top-most) popped out due to overflow: hidden, but that doesn't seem to be possible without having to give the items position:absolute and thus making them appear on top of each other in the bottom of the list. Usually, I'd just Jquery-brute-force the divs to disappear after some arbitrary time of scrolling upp underneath the parent div, but in this case I also have the list-div that, in that case, would need to be partially (hidden in the top) as it goes up. Anyone have any ideas on how to make this work? Maybe I'm just thinking into a corner by now and aren't seeing the obvious answer. Thanks!
tagged with: jquery
has title: How to make a "roll-up curtain"-style drop-down menu not pop out above its parent when rolled up
has comment: http://stackoverflow.com/comment/38733339
has answer: http://stackoverflow.com/a/24927199
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25050054
has answer: http://stackoverflow.com/a/25050130
has answer: http://stackoverflow.com/a/25050134
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/25050130
type: AnsweredQuestion
type: Question
has title: Change CSS on active button with varied class names
has body: I have a variety of buttons in the navigation bar of my website that I would like to do a few things on click: 1. Open an overlay relative to the button pressed 2. Close any other open overlays 3. Add a border to the button until that button's related overlay is closed. My navigation bar looks something like this: Sign Up Login Here's the overlay html: and the JQuery to extend the overlays/close others: As I add more buttons to the navigation bar, I feel as if theres a lot of unnecessary CSS for each individual button, so that the JQuery can get the correct element. Is there a cleaner, more efficient way to do this? Also, to add the border to the bottom of the button related to the current overlay, should this all be done with Javascript, or is there a clean/not repetitive way of doing it with CSS?
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25050103
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25050134

http://stackoverflow.com/q/25029208
has answer: http://stackoverflow.com/a/25029221
upvote count: 1
has title: Jquery - How to defined user defined jquery function?
type: AnsweredQuestion
score: 1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25029354
tagged with: http://stackoverflow.com/tag/html
has body: Can we create user defined function in jquery like : $(selector).click(function() { }) Above function is already in jquery library. if i want to create function like above one For e.g. : $(selector).demo(); How i can create function "demo()" to which i can prefix the selector as $(selector).demo();
favorite count: 0
possible better answer: http://stackoverflow.com/a/25029221
accepted answer: http://stackoverflow.com/a/25029354

http://stackoverflow.com/comment/38981028
type: Comment
has text: In that case you need to grab the boolean that is returned from your call to `yesno = confirm("blah");`, find a hidden checkbox on your form with javascript/jquery, put the value in it and submit your form....
score: 0
comment on: http://stackoverflow.com/q/25058553
type: QuestionComment

object-literal
tag name: object-literal
tags question: http://stackoverflow.com/q/24919292
type: Tag
tags question: http://stackoverflow.com/q/25056960
tags question: http://stackoverflow.com/q/25006454

http://stackoverflow.com/a/24911248
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24911194
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24911194
has comment: http://stackoverflow.com/comment/38703864
has comment: http://stackoverflow.com/comment/38702996
type: Answer
has comment: http://stackoverflow.com/comment/38704013
score: 2
has comment: http://stackoverflow.com/comment/38704312
downvote count: 0
has comment: http://stackoverflow.com/comment/38704496
has body: Because the geocode function is async! Use a callback: function checkaddress(callback){ var geocoder = new google.maps.Geocoder(); geocoder.geocode( { 'address': address}, function(results, status) { if (status != google.maps.GeocoderStatus.OK) { callback(false) } else if (status == google.maps.GeocoderStatus.OK) { callback(true) } }); } Then use this like: checkaddress(function(result) { if (result) { //result true! } else { //result false! } //REST OF YOUR CODE GOES HERE, IF PUT OUTSIDE IT WILL EXECUTE WHILE CHECKADDRESS IS IN PROGRESS }); Your submit function is also most likely running the default behavior, use preventDefault jQuery("#submitOrder").submit(function(e){ e.preventDefault(); //code });

http://stackoverflow.com/comment/38941247
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25037666
type: Comment
has text: Thanks Lars, but in my case, how come the content is there, but in the same console.log statement, directly after the length is 0? Is console.log also asynchronous?

http://stackoverflow.com/a/24912045
accepted answer of: http://stackoverflow.com/q/24911859
answers question: http://stackoverflow.com/q/24911859
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 4
has body: If you are doing that in a loop, you keep overriding the array! var disableDates = new Array(); disableDates[123] = 123; console.log(disableDates[123]); //123 var disableDates = new Array(); disableDates[456] = 456; console.log(disableDates[123]); //undefined Move the array declaration outside of the loop or check if it exists before creating a new Array.
has comment: http://stackoverflow.com/comment/38704688

http://stackoverflow.com/a/24995195
downvote count: 0
score: 1
has body: You can call with javascript one server side function that query the database. server side (maybe in your home.aspx page) [WebMethod()] [ScriptMethod(UseHttpGet = false, ResponseFormat = ResponseFormat.Json)] public string[] GetProducts() { var _db = new BundleShop.Models.ProductContext(); IQueryable&lt;Category&gt; query = _db.Categories; return query.Cast&lt;MyEntityType&gt;().ToArray();; } define your MyEntityType Type public Class MyEntityType { public int Order; pubic string Description; } script side $.ajax({ type: "POST", url: "/home.aspx/GetProducts", success: onsuccess, dataType: 'json', error: onerror }); manage results in success jquery function function onsuccess(data, status, xmlHttpRequest) { //manage data variable here (cycle its elements, put them in page) } summarizing: Create server side function to query data Create script function to call server side function Manage json results in success jquery ajax call
upvote count: 1
answers question: http://stackoverflow.com/q/24994719
type: Answer

http://stackoverflow.com/q/24949433
answer count: 2
has answer: http://stackoverflow.com/a/25201217
upvote count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/38849586
has body: problem with firefox 31 as the javascript submit not working. the problem arises at product page as after selecting the product it is not navigating to the cart page or wishlist page. i have tested it on other browsers and also on firefox 30 and it works fine on them. I have also tried to disable other plugins but it didnt work. I debug the below given code snippet and its variable are getting desired values as per the logic for instance it is entering the else only when the user has checked the field. I will be grateful for the any quick solutions. echo "&lt;input class=\"button wish_btn_style\" type=\"submit\" value=\"Add to wishlist\" onclick=\"return changelocation('wishlist.php')\"&gt;&lt;!--img src=\"img/wishlist_small.png\" width=\"16\" height=\"15\"--&gt;"; echo "&lt;input class=\"button cart_btn_style\" type=\"submit\" value=\"Add to cart\" onclick=\"return changelocation('cart.php')\"&gt;&lt;!--img src=\"img/cart_gray.png\" width=\"32\" height=\"24\"--&gt;"; function changelocation(action) {var canigo=0; var x=document.getElementById('txt_quent').value; var status; if((x=="") || isNaN(x)) { alert("Please enter quantity only in number"); var canigo=1; return false; } if(canigo==0) {status=$('input:radio[name="subid"]:checked').val(); if(isNaN(status)) { alert('Please select the desired product specification'); return false; } else { document.getElementById('product').action=action; document.getElementById('product').target='_self'; document.getElementById('product').submit(); return true; } } }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38851973
has comment: http://stackoverflow.com/comment/38865677
tagged with: form-submit
has title: firefox 31 the javascript submit not working
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/25123211
tagged with: firefox
tagged with: javascript
score: 4

http://stackoverflow.com/comment/38721827
has text: fgshepard - What do you mean network tab?
comment on: http://stackoverflow.com/q/24919110
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24993715
upvote count: 1
type: Question
has title: 403 from google API javascript
linked to: http://stackoverflow.com/q/21208870
has comment: http://stackoverflow.com/comment/39090408
score: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/39086517
answer count: 0
tagged with: google-api
type: UnansweredQuestion
has body: i have this specific problem: i have tried google api from their examples, but i receive response with error: "Access Not Configured. Please use Google Developers Console to activate the API for your project." i have enabled google plus api in console i regenerated client_id, OAuth and public API key for my browser aplication. here is the code: Authorize

http://stackoverflow.com/comment/38972248
type: Comment
has text: This is a bit confusing. Can you explain how exactly you want things to workout? Like, can you provide some scenario?
comment on: http://stackoverflow.com/a/25028274
score: 0
type: AnswerComment

http://stackoverflow.com/q/24949285
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: Currently I'm trying to create a button which creates a popup box which in turn has a drop down list, like in here. However, I'm having trouble figuring out how to put the drop down list inside the pop up window. Can anyone help? I currently have a pop up window with a form, but I want to change this form into a drop down list. refer this jsfiddle Do you have an agreement or a conflict? Try it
tagged with: css
score: 2
type: AnsweredQuestion
upvote count: 3
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/24949716
has answer: http://stackoverflow.com/a/24949528
has answer: http://stackoverflow.com/a/24949716
accepted answer: http://stackoverflow.com/a/24949528
answer count: 3
has title: Drop down list inside a pop up window (comes up when button is pressed)
tagged with: javascript
has answer: http://stackoverflow.com/a/42180934
has comment: http://stackoverflow.com/comment/38775493

http://stackoverflow.com/a/24974885
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24974683
has body: Check this out check edited Code here 1> First of all your fucntion should be in head,in jsfiddle near the left top corner change the onload to no wrap in head, 2> you dont need script tag in onclick 3> document.getElementById('option') will select only the first element with id 'option' Check the following code , i have made some minor changes to your code. check edited Code here
downvote count: 0
score: 1

http://stackoverflow.com/comment/38778313
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24950517
type: QuestionComment
has text: @Adriano, I'm writing a tutorial for jQuery and I'm going to use your posed question in my explanation and then state why. So even though I was a little unhappy with your comment at first. It makes you take a second and think as to why this is happening, I appreciate the comment. .. .. after thinking aboutit, lol

http://stackoverflow.com/comment/40404552
comment on: http://stackoverflow.com/a/25672350
score: 0
type: AnswerComment
has text: I'm sure its something small. make sure you are loading the google maps js file on the contact page, and check the console log for errors.
type: Comment

http://stackoverflow.com/q/24989909
has comment: http://stackoverflow.com/comment/38851417
has answer: http://stackoverflow.com/a/24990462
score: 0
has body: I'm using the jquery plugin called shapeshift. It's like jqueryui sortable but with better animations. The divs can be dragged and dropped. But I can't seem to figure out how to save their order so that on browser refesh the order remains the same where I left them. Here is the jsfiddle http://jsfiddle.net/Shikhar_Srivastava/aC367/ $(".container").shapeshift({minColumns: 3}); I'm initiating the plugin as above. Please help me on my fiddle. Thanks.
tagged with: jquery
has title: HTML/jQuery Save order
tagged with: http://stackoverflow.com/tag/html
tagged with: draggable
answer count: 4
has answer: http://stackoverflow.com/a/24991081
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38851513
has comment: http://stackoverflow.com/comment/38851498
has answer: http://stackoverflow.com/a/24990604
type: Question
possible better answer: http://stackoverflow.com/a/24990761
has answer: http://stackoverflow.com/a/24990761
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/38851354
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24991081

http://stackoverflow.com/comment/38936835
score: 0
has text: Its got me thinking now that you either need to leave the button as a submit button or set it as a button with the onsubmit logic including return false. Its one of these combinations. The reason that you would place it in an else condition or corresponding function in jquery is that it will only get there and submit a form if all fields are valid.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25034453

http://stackoverflow.com/comment/38900069
score: 0
comment on: http://stackoverflow.com/a/25015615
type: Comment
type: AnswerComment
has text: Oh that was a really foolish error. The res() function is still not working. :(

http://stackoverflow.com/comment/38992440
comment on: http://stackoverflow.com/q/25064740
type: QuestionComment
type: Comment
has text: Clue: Check your (PHP) conditional statement; it's dependant on it.
score: 0

http://stackoverflow.com/a/24943489
accepted answer of: http://stackoverflow.com/q/24943247
answers question: http://stackoverflow.com/q/24943247
type: AcceptedAnswer
has body: You could wrap your story elements into a div, and then add the new lines at the end: Un jeune garcon vivait dans une petite village dans la montagne. Then, script would be: document.getElementById("story").innerHTML += " Nouveau mot: "+ newtable[line]; Demo Fiddle
type: Answer
score: 0

http://stackoverflow.com/q/24934847
has comment: http://stackoverflow.com/comment/70805310
has comment: http://stackoverflow.com/comment/70781086
type: Question
score: 5
upvote count: 5
downvote count: 0
tagged with: javascript
has title: Javascript persistent access to local files across browser instances/page refreshes
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/24935355
favorite count: 0
has comment: http://stackoverflow.com/comment/70787656
has body: I'm looking for a way to allow the user to select a file using the standard element, and allow the browser to access that file persistently across page refreshes and/or browser instances. Scenario: We have a web app that we want to license to users. We want to send the user a license file that they save to their local computer. The first time they access our web app, they use an field to select the local license file on their computer Each subsequent time they access the app (whether they close the browser, reboot the machine, etc), it can read the license file directly, without needing the user to re-select the file. We don't want to use localStorage to store the entire file, as the file's max size is not limited and may grow outside the size limits of localStorage. I have partially succeeded: As long as the original browser tab is open, any other browser instance or tab can access the file and read it. However, if the original tab is closed, the local file URL is destroyed. Here's how I did this part: When user selects a file from field, use the window.createObjectURL() function to create an object URL for the selected file. Save this object URL in localStorage Whenever another browser instance/tab accesses this URL, it can load the file using the XHR object and the FileReader object. Here's the bit of code: var xhr = new XMLHttpRequest(); console.log("Reading URL: " + localStorage.savedFile); xhr.open('GET', localStorage.savedFile, true); xhr.responseType = 'blob'; xhr.onreadystatechange = function(e) { if (xhr.readyState == 4) { var myBlob = this.response; console.log(myBlob); var f = new FileReader(); f.onload = function(e) { console.log(e); alert("Data read: " + e.target.result); }; f.readAsText(myBlob); } }; xhr.send(); As you can see, the xhr object gets a blob back, and can send this directly to the FileReader object to read the data. This works perfectly as long as the original tab (the one where they selected the file) is open. But apparently the URLs gen…
type: UnansweredQuestion
tagged with: persistent-storage
has comment: http://stackoverflow.com/comment/70805662
has comment: http://stackoverflow.com/comment/70787673
has comment: http://stackoverflow.com/comment/38747807

http://stackoverflow.com/comment/38965611
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25050243
has text: Sure, here's an example: http://jsfiddle.net/LzfQC/ . Note how the textbox can't be focused/edited (because the `geoRegion_id` property has a value). Change the `geoRegion_id` property to an empty string, click the "Run" button at the top, and then notice how the textbox is editable.

http://stackoverflow.com/comment/38856059
type: AnswerComment
comment on: http://stackoverflow.com/a/24990401
type: Comment
has text: are all images having src attribute in place? It is better if you can share jsfiddle with same html code as you are having, so that i can help you.
score: 0

http://stackoverflow.com/q/25015262
type: Question
has answer: http://stackoverflow.com/a/25020869
accepted answer: http://stackoverflow.com/a/25020869
has title: How to correctly update the text value of an input element in a d3.js transition
has body: I've been trying, step by step, to convert some very nice but static &amp; non-d3 code for dynamic animation in a d3.js visualisation. (Though not directly relevant to this problem, the original code 'simply' -haha- accepts a user-supplied chordname such as 'Amaj7', breaks it down into it's component notes and displays the associated waveforms. I'm trying to create an transition-driven animation based on an array of chordnames.) For my part, for each successful code update (to a d3.js friendly version) achieved, the source code was saved to act as a working comparison with the next. In the current update to the code, I've hit a glitch trying to incorporate a transition. The transition itself is well proven, and (by means of logging) can be seen to fire as expected. During the transition, the desired attribute value changes (the next chordname to be handled, and the goal of the immediate transition) are failing. Comparing the previous (working) version with the current: Initial creation, common to both, but in a separate file and so element is accessible only via the DOM var input = container .append("input") .attr("class", wavebase.animation_type + "_input") .attr("id", "chordinput") .attr("type", "text") .attr("value","Amaj7"); Old var input = document.getElementById('chordinput'); input.addEventListener('change', inputChanged, false); inputChanged.call(input); and (pre-transition): input.setAttribute("value", (waveplot.chordname + "\x0A")); inputChanged.call(input); Let's be clear: the above works. New var input = container .select("#chordinput") input.on('change', inputChanged, false); inputChanged.call(input); Later, neither this: input .transition() .text(function() { return (waveplot.chordname + "\x0A"); }) ..nor this: input .transition() .attr("value", function() { return (waveplot.chordname + "\x0A"); }); ..nor variants minus the return character ("\x0A") result in update of the input element's value field. waveplot.chordname is, incidentally, always correct…
tagged with: transition
upvote count: 2
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: input
tagged with: events
linked to: http://stackoverflow.com/q/25002417
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: d3.js

http://stackoverflow.com/a/25066997
has body: AngularJS and more globally JavaScript are not the good thing to do that. You should use a CSS property like this one .disable-text-selection { -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } EDIT Angular directives are usually used to modify the DOM or add some features like many jQuery plugins, not bind a function to a DOMnode (or use ng-click in this case). Your function can clear a selection on IE but you must bind an event to active it. Anyway, in your case you should use the second parameter provided in the link function (called after compile and all controllers declarations) and bind it to your function calling. link: function($scope, $element, $attrs) { $element.bind('click', clearSelection) }
answers question: http://stackoverflow.com/q/25066819
has comment: http://stackoverflow.com/comment/38997678
upvote count: 26
accepted answer of: http://stackoverflow.com/q/25066819
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38998054
type: Answer
score: 26
has comment: http://stackoverflow.com/comment/38997014

http://stackoverflow.com/q/25012201
type: AnsweredQuestion
has body: I have a function that references an input and changes it's value accordingly with the final line: eval('document.forms[0].telephone').value = $telephone[$i]; However, I need to move what is displayed in to a span, and need to correctly reference it. Currently, the input has a name and an id of "country", and I believe my eval() is referencing the name. My span doesn't have a name, and instead has a class tel-prefix. I've tried to reference it the following ways (and many combinations thereof), and none work: eval('document.forms[0].tel-prefix').value = $telephone[$i]; eval('.tel-prefix').value = $telephone[$i]; eval('.tel-prefix').text= $telephone[$i]; $('.tel-prefix').value = $telephone[$i]; $('.tel-prefix').value($telephone[$i]); How would I get my eval() to change the value of my span? Full JS $telephone = new Array(4) $telephone [0] = "+93" ... $telephone [246] = "+260" $telephone [247] = "+263" function getTelephone($selectedIndex) { $selectBox = document.forms[0].spch_country; if ($selectBox.options[$selectedIndex].value != 'none') { for ($j = 0, $i = $selectedIndex; $i &lt; $selectedIndex + 1; $j++, $i++) { eval('document.forms[0].tel-prefix').value = $telephone[$i]; } } }
has title: Referencing a span element with an eval
has comment: http://stackoverflow.com/comment/38893427
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38894317
has comment: http://stackoverflow.com/comment/38894360
has answer: http://stackoverflow.com/a/25012495
has comment: http://stackoverflow.com/comment/38893732
tagged with: javascript
score: -1
accepted answer: http://stackoverflow.com/a/25012495
has comment: http://stackoverflow.com/comment/38893889
has comment: http://stackoverflow.com/comment/38893445
upvote count: 0
has comment: http://stackoverflow.com/comment/38893527
answer count: 1
has comment: http://stackoverflow.com/comment/38893474
favorite count: 0
has comment: http://stackoverflow.com/comment/38893472

http://stackoverflow.com/comment/39193257
comment on: http://stackoverflow.com/a/25008748
type: AnswerComment
score: 0
type: Comment
has text: Sorry for being slow to get back to you on this. That worked perfectly, I wasn't really sure what promises were when I heard about them, this really helped me understand. Thank you!

http://stackoverflow.com/comment/77810586
score: 0
has text: From my experience, this can't be called directly from the Jquery. If you want this to work it has to be from a click or other action. this won't work: ` ` it needs a `click`, `done` or other actions to be activated.
type: Comment
comment on: http://stackoverflow.com/a/24910903
type: AnswerComment

http://stackoverflow.com/comment/38967415
type: Comment
type: QuestionComment
score: 0
has text: @Ian I agree that some of the Bootstrap docs need work. I've got the `collapse` plugin source code bookmarked due to the number of times I've had to dive in there to find out what it's *actually* doing.
comment on: http://stackoverflow.com/q/25050148

http://stackoverflow.com/comment/38989976
type: QuestionComment
has text: I think it's flare1base[i].rotation.z += 0.01 where i is the outer i
type: Comment
comment on: http://stackoverflow.com/q/25063466
score: 0

http://stackoverflow.com/comment/38756384
score: 1
has text: Your question is vague. Please specify what you mean when you say "grey highlight color." UI elements such as text inputs can also differ between browsers. EDIT: also, do you have any CSS for us to look at?
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24939358

http://stackoverflow.com/comment/38840790
has text: what is wrong in it and what is expected output?
comment on: http://stackoverflow.com/q/24984311
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38909167
comment on: http://stackoverflow.com/q/25020279
has text: do you need to remove rows given the person name? or for all people ?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25018764
has comment: http://stackoverflow.com/comment/38908468
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25018152
has body: You can write your own directive that would listen an onchange event bubbling (ngChange directive would not work in this case). .directive('onChange', function() { return { link: function(scope, element, attrs) { element.on('change input', function() { scope.$eval(attrs.onChange); scope.$digest(); }); } }; }); and use it: &lt;tr data-ng-repeat="item in data" on-change="item.changed=true"&gt; Demo: http://plnkr.co/edit/lzIQ00l7aqXYlNCekWY8?p=preview
downvote count: 0
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25018152

http://stackoverflow.com/a/24984285
type: Answer
score: 0
has comment: http://stackoverflow.com/comment/38840809
answers question: http://stackoverflow.com/q/24984212
has comment: http://stackoverflow.com/comment/38840802
has body: More likely than not you have some sort of padding or margin applied to the elements. You can avoid padding issues by applying box-sizing to both elements and zeroing out the margins: -moz-box-sizing:border-box; -webkit-box-sizing:border-box; box-sizing:border-box; margin-left:0px; margin-right:0px; note: this is not compatible with ie8 and below

http://stackoverflow.com/comment/38723383
type: QuestionComment
score: 3
comment on: http://stackoverflow.com/q/24921529
has text: _nothing is happening_ - I assure you, _something_ is happening. Have you checked your browser console or your server error log?
type: Comment

http://stackoverflow.com/a/74818340
has body: With this regex, it makes the job: const regex = /,(?![^(]*\))/g; const str = '"abc",ab(),c(d(),e()),f(g(),zyx),h(123)'; const result = str.split(regex); console.log(result);
type: Answer
downvote count: 2
upvote count: 1
answers question: http://stackoverflow.com/q/25058134
score: -1

http://stackoverflow.com/comment/39002687
type: Comment
has text: Thanks for answer!... Yes, this works fine. But looks like an extra-work hack that cause decreasing performance. I wonder if the ajax request is executing two times: by the original `onChange` and by the `onClick` event that calls the first one.
comment on: http://stackoverflow.com/a/25051324
type: AnswerComment
score: 0

http://stackoverflow.com/q/25057705
has comment: http://stackoverflow.com/comment/38978885
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38978886
has answer: http://stackoverflow.com/a/25057942
accepted answer: http://stackoverflow.com/a/25057942
tagged with: iframe
has title: How to control proper iframe?
tagged with: css
possible better answer: http://stackoverflow.com/a/25058019
has comment: http://stackoverflow.com/comment/38979249
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25058019
has comment: http://stackoverflow.com/comment/38980028
type: Question
answer count: 2
has body: my code/site is embedded into iframe. It's on the same domain so I can access parent document without problem. The problem is that iframe in which my code resides is dynamically generated - every-time the site reloads it get a new ID and has no class. So, I have this code: $("iframe", window.parent.document).each(function () { var iFrame = this; if ($("#controlAddIn",iFrame)) { iFrame.css({"height": "29px", "padding-bottom": "12px"}); } }); And firefox console gives me this: TypeError: iFrame.css is not a function What I want to achieve is to re-size iframe in which my code is to a fixed value + change padding. What is wrong with my solution that firefox doesn't wan't to execute it? Thank you.

http://stackoverflow.com/q/24965776
tagged with: date
has comment: http://stackoverflow.com/comment/38806190
accepted answer: http://stackoverflow.com/a/24966170
has comment: http://stackoverflow.com/comment/38806619
type: Question
linked to: http://stackoverflow.com/q/5812220
has body: I've tried using the following code to validate a date: var date = Date.parse(text); if (isNaN(date)) { // Invalid date } This does allow m/d/y and yyyy-mm-dd to be valid, but it also allows, for example, a single digit to be valid. I would like a date function that allows these two formats, m/d/y and yyyy-mm-dd, but is more strict in not allowing just digits.
tagged with: validation
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38806102
linked to: http://stackoverflow.com/q/276479
linked to: http://stackoverflow.com/q/6177975
has comment: http://stackoverflow.com/comment/38806209
has comment: http://stackoverflow.com/comment/38806139
has answer: http://stackoverflow.com/a/24966170
score: 0
has comment: http://stackoverflow.com/comment/38806168
type: AnsweredQuestion
has title: How can I check if a date is valid that allows m/d/y and yyyy-mm-dd to be valid

http://stackoverflow.com/a/24956575
has comment: http://stackoverflow.com/comment/38789045
score: 0
has comment: http://stackoverflow.com/comment/38788646
has comment: http://stackoverflow.com/comment/38791946
has comment: http://stackoverflow.com/comment/38788504
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24956525
answers question: http://stackoverflow.com/q/24956525
has body: The reason what you're doing doesn't work is that you're saving the item before it's loaded. load works asynchronously, like all (reasonable) ajax calls. The process starts when you call load, but finishes later. Your code is then continuing and grabbing what it thinks is the content and saving it, but the content isn't there yet. Use the callback instead: $(id).load(source, function() { showSource("from File " + content); //Added only for testing //so load it from the server.. localStorage.setItem(local,$(id).html()); //then save it to the local storage, so we don't have to do this again any time soon. }); But...aren't you just reinventing the browser cache?
type: Answer

http://stackoverflow.com/q/25017088
has comment: http://stackoverflow.com/comment/38903055
tagged with: php
has comment: http://stackoverflow.com/comment/38902530
has answer: http://stackoverflow.com/a/25062851
type: Question
has comment: http://stackoverflow.com/comment/38902892
has body: I have a module designed with this view and controller . Now , I want to move this same View and Controller to another Module ... basically want to include the functionality into another module. Now, I have created a new controller for this module and passed the 'previously used controller's name' in it $scope.includeViews = [ {'title':'Info', url: appdata.baseurl +'/app/partials/profile/info.html', controller : 'infoData'} ]; Also ,, this is how i am including the 'previously used view' ..actually i am dealing wth tabs here to load the view ...its as follows &lt;tab heading="{{includeViews[0].title}}"&gt; &lt;div class="slide-animate-container"&gt; &lt;div class="slide-animate" ng-include="includeViews[0].url" ng-controller="infoData"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/tab&gt; The scope is not getting copied when using ng-include ..so I am not able to fetch the Data Please tell me how do i deal with this , I dont want to code new as i am copying the same functionality of one module into another .. Thanks !
has title: Link two common Views to a Single Controller in AngularJs?
tagged with: yii
tagged with: javascript
has comment: http://stackoverflow.com/comment/38902449
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25017783
has comment: http://stackoverflow.com/comment/38902726
has comment: http://stackoverflow.com/comment/38903099
tagged with: route-provider
tagged with: angularjs
type: UnansweredQuestion

http://stackoverflow.com/q/25068740
tagged with: css
has answer: http://stackoverflow.com/a/25069196
has title: jQuery UI-Resizable Adding an Unwanted Margin
score: 0
accepted answer: http://stackoverflow.com/a/25069196
answer count: 1
tagged with: jquery-ui
tagged with: javascript
type: AnsweredQuestion
tagged with: jquery
type: Question
has body: jQuery UI "resizable" adds a 10 pixel handle to the right and bottom of an element. See example here: http://jsfiddle.net/Thaikhan/fGJ59/10/show/ If you click on Pikachu, then try to drag him into the bottom right corner, he doesn't fit flush because of the handle margin. I want the images to be able to fit flush against the border. I've tried to disable the handle but have been unable to retain resizability while removing the border. If this isn't possible, perhaps there's a way to add 10px to the right and bottom margin of the container and have the elements go through the border? Thanks for your help! Here is the relevant jQuery: $('.inventory').on('click', 'img', function () { $(this).resizable({ aspectRatio: 1, autoHide: true, // containment: "parent", minHeight: 50, minWidth: 50, maxHeight: 300, maxWidth: 400 }); $(this).parent().appendTo(".frame").draggable({ containment: "parent", cursor: "move" }); refreshIndexList(); zindex(); });

http://stackoverflow.com/q/24960068
has title: JQuery Image Slider Using "Cycle Plugin": Why Won't My Images "Cycle"?
type: Question
has body: I've built an image slider that is meant to transition between four images by fading in and out. I used the J Query plugin "Cycle" and set the effect to "fade". I'm also hoping to give the user the capability to pause the slideshow by hovering their cursor over the images, as well as control the flow with standard "next", "previous" buttons located in the top right hand corner. Code is as follows: Full Screen Result: http://jsfiddle.net/StacksOnStacksOverHoes/spL4W/3/embedded/result/ JS Fiddle Edit: http://jsfiddle.net/StacksOnStacksOverHoes/spL4W/3/ HTML: slider Hello World Hello world. Learn More Hello World Hello world. Learn More Hello World Hello world. Learn More Hello World Hello world. Learn More Previous Next CSS: #hero { width: 960px; height: 500px; display: block; position: relative; margin: auto; } #slider_01 { width: 960px; height: 500px; display: block; position: absolute; margin: auto; overflow: hidden; } .info { width: 90%; height: 80px; display: block; position: relative; bottom: 100px; border: 1px solid black; background: rgba(102, 204, 204, .2); z-index: 99; } .info h2 { font-family: sans-serif; font-size: 20px; font-weight: bold; color: #FFF; padding: 15px 0 0 20px; line-height: 1px; } .info p { font-family: sans-serif; font-size: 15px; font-weight: lighter; color: #FFF; padding: 0px 0px 0px 20px; line-height: 1px; } #play { width: 40px; height: 40px; line-height: 40px; text-align: center; display: block; position: absolute; top: 0px; right: 44px; background: rgba(102, 204, 0, .2); color: #FFF; cursor: pointer; z-index: 999; } #pause { width: 40px; height: 40px; line-height: 40px; text-align: center; display: block; position: absolute; top: 0px; right: 88px; background: rgba(102, 204, 0, .5); color: #FFF; cursor: pointer; z-index: 999; } #next { width: 40px; height: 40px; line-height: 40px; text-align: center; display: block; position: absolute; top: 0px; right: 0px; background: rgba(102, 204, 0, .5); color: #FFF; cursor: pointer; z-index: 999; }…
accepted answer: http://stackoverflow.com/a/24960307
has comment: http://stackoverflow.com/comment/38795261
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24960302
tagged with: css
has answer: http://stackoverflow.com/a/24960307
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24960302
score: 0

http://stackoverflow.com/comment/38762910
score: 0
comment on: http://stackoverflow.com/q/24942557
has text: dandavis is right, you can even drop the script tags and do it inline, with onclick="alert(this.value);"
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24989498
accepted answer of: http://stackoverflow.com/q/24989367
type: Answer
has body: you just copied count into $scope.num. So if you increment count, it won't affect $scope.num. Try incrementing $scope.num app.controller("MainController", function($scope){ $scope.num = 3; $scope.addContact = function() { $scope.num += 1; console.log($scope.num); } }); DEMO PLUNKER
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38850671
upvote count: 2
answers question: http://stackoverflow.com/q/24989367
type: AcceptedAnswer

http://stackoverflow.com/q/25037690
has comment: http://stackoverflow.com/comment/38944537
has answer: http://stackoverflow.com/a/25039722
has comment: http://stackoverflow.com/comment/38942989
tagged with: javascript
has comment: http://stackoverflow.com/comment/38942962
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38944462
has title: passing array to url node js
has comment: http://stackoverflow.com/comment/38944248
type: UnansweredQuestion
tagged with: node.js
has comment: http://stackoverflow.com/comment/38941456
has comment: http://stackoverflow.com/comment/38944312
linked to: http://stackoverflow.com/q/11889997
has body: I have an API http://studentresults.com/studentresults?studentname=xyz&amp;date=dd/mm/yyyy With the above url, I get JSON information w.r.t to student name on that date of examination. I can get the JSON information for single student by parsing url using node js. Now I have 15 students. How to get to all the information on that particular day of examination so that I create object such as { "date": dd/mm/yyyy 'studentresults': [ { 'studentname' = xyz , marks = 500 }, { 'studentname' = abc , marks = 525 }, so on ] } In the above url, by changing the student name we get information of one student details. if i need to get all the students details how it can be done ? instead of changing every time how can i pass a array of studentnames to url so that i can all the information at once ?
type: Question

http://stackoverflow.com/a/24924723
downvote count: 0
score: 7
upvote count: 7
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24924648
type: Answer
answers question: http://stackoverflow.com/q/24924648
has body: Add a class for html that sets the cursor and sets all elements to also have the wait cursor when html has that class CSS html.wait, html.wait * { cursor:wait; } then instead of doing $('html').css("cursor","wait"); use addClass to add the wait class to html $('html').addClass("wait"); JSFiddle Demo Then when done just use removeClass to remove the class

http://stackoverflow.com/q/24979143
score: 2
upvote count: 2
has title: How to stop setInterval in a do while loop in jquery
type: Question
has answer: http://stackoverflow.com/a/24979204
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24979250
possible better answer: http://stackoverflow.com/a/24979204
answer count: 2
has body: I want to do is stop setInterval after the do while loop meet the condition. My problem is even the while loop condition is meet the setInterval is still running. do { setInterval( Vinformation(); ,500); }while($('#emailCodeResult').val() !='') function Vinformation(){ var data = {}; data.emailCodeResult = $('#emailCodeResult').val(); $.ajax({ type: "POST", url: "Oppa.php", data: data, cache: false, dataType:"JSON", success: function (result) { } }); return false; }
tagged with: setinterval
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24979250
type: AnsweredQuestion

http://stackoverflow.com/comment/38732692
type: QuestionComment
has text: And you have already tried...
comment on: http://stackoverflow.com/q/24926790
score: 0
type: Comment

http://stackoverflow.com/q/25032958
type: Question
has title: Create a multiple object with dynamic names
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38932333
has comment: http://stackoverflow.com/comment/38932436
has answer: http://stackoverflow.com/a/25033208
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has body: I created a function which allows to return an object whose name change to each loop. I done this function like this : function createObjPack(index){ var currentPack = packVehicule[key].libelle; return [eval(currentPack + ' = {}' ), calcul(currentPack, key)]; }; The variable curentPack contains the name of the current object. The return must generate a object which name match the value of currentPack I thought read the currentPack directly into an eval() function for change dynamicly the name but, it doesn't work. Someone can help me ?

http://stackoverflow.com/q/24952677
tagged with: javascript
has body: I'm having a small problem with my PDF document. I've got a text-field called "date", and in it I execute this Jscript code: if(event.value == "") { event.value = util.printd("dd.mm.yyyy", new Date()) } if(event.value != "") { event.value = util.printd("dd.mm.yyyy", new Date()) } Now, it works just fine on it's own, but it doesn't do the job exactly like I want it to. Say, if I opened the document on 01.07.2014, then the date would be 01.07.2014, then I saved the document, and that was it. Now I open the document on 20.07.2014, the date still is 01.07.2014. I have to at least remove 1 character for the Jscript to do its job. I want the "date" text field to be changed when I open the document. What am I missing?
score: 0
tagged with: http://stackoverflow.com/tag/pdf
answer count: 1
accepted answer: http://stackoverflow.com/a/24968907
has answer: http://stackoverflow.com/a/24968907
type: AnsweredQuestion
has title: JScript for PDF to enter the current date regardless if text-field is full or empty
tagged with: date
type: Question

http://stackoverflow.com/a/25050430
type: Answer
has body: You will have to use a custom regex for this because the default regex matcher for the number input isn't detecting scientific notation. You can do this with the ng-pattern attribute.
answers question: http://stackoverflow.com/q/24933472
score: 0

http://stackoverflow.com/a/25003183
score: 0
answers question: http://stackoverflow.com/q/25003080
type: Answer
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38876429
has comment: http://stackoverflow.com/comment/38876368
has body: The attribute disabled is active when it is present. Setting it to false does nothing, setting it to true does nothing. So to do this you would need to remove the attribute. $("#obj").removeAttr('disabled'); and to disable again run, $("#obj").attr('disabled', 'disabled');

http://stackoverflow.com/comment/38903682
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25017499
has text: Yeah, but @webkit's answer worked

http://stackoverflow.com/q/24912069
answer count: 1
has answer: http://stackoverflow.com/a/24915841
tagged with: alchemyapi
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
favorite count: 0
tagged with: ajax
has title: Calling Alchemy API using ajax call
has body: I am trying to use ajax to call the Alchemy REST API, but I am getting an injector error which I have mentioned below. The following is the code in my HTML file. Looking for suggestions to solve the error. Alchemy trial I am getting the following error in the console :- [21:39:07.317] Error: [$injector:unpr] http://errors.angularjs.org/undefined/$injector/unpr?p0=AngularIssuesProvider%20%3C-%20AngularIssues L/<@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:6 Xb/l.$injector<@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:32 c@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:29 Xb/r.$injector<@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:32 c@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:29 d@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js:30 Xb/f/<.instantiate@https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0
tagged with: rest
type: Question
tagged with: http://stackoverflow.com/tag/html
upvote count: 1

http://stackoverflow.com/q/25002864
has comment: http://stackoverflow.com/comment/38875777
has body: I need to get jpeg image from foreign server like http://some.foreign.cdn.server.image.jpeg And render it base64 in image. How could I do it?
downvote count: 0
has comment: http://stackoverflow.com/comment/38875786
score: 1
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/44960658
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38875612
has title: How to get image via AJAX and show via image?
has comment: http://stackoverflow.com/comment/38875809
has comment: http://stackoverflow.com/comment/38875847
answer count: 0
upvote count: 1
has comment: http://stackoverflow.com/comment/38875637
type: Question
linked to: http://stackoverflow.com/q/9267899
has comment: http://stackoverflow.com/comment/38875662
has comment: http://stackoverflow.com/comment/38876130
has comment: http://stackoverflow.com/comment/38876046
linked to: http://stackoverflow.com/q/20617720
has comment: http://stackoverflow.com/comment/38876033
tagged with: javascript
tagged with: base64
tagged with: image

http://stackoverflow.com/comment/38929601
score: 0
type: Comment
type: QuestionComment
has text: jquert-ui-1.8.24 and jquery-1.8.2
comment on: http://stackoverflow.com/q/25031440

http://stackoverflow.com/q/25049380
has answer: http://stackoverflow.com/a/25049452
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25049488
tagged with: css
has comment: http://stackoverflow.com/comment/38963611
has answer: http://stackoverflow.com/a/25049449
type: UnansweredQuestion
downvote count: 2
tagged with: php
type: Question
tagged with: quotes
has answer: http://stackoverflow.com/a/25049440
score: -2
has answer: http://stackoverflow.com/a/25049438
has title: HTML/CSS/PHP - multiple quotation marks
answer count: 6
linked to: http://stackoverflow.com/q/7999148
linked to: http://stackoverflow.com/q/11036420
has body: We all know that a quotation mark must have it's partner. But how will I do it if I got 3 consecutive elements that wil use up a quotation mark (PHP echo, HTML and CSS class, Javascript function)? Something like this echo ' User Pass user View-Only '; The echo's quotation mark breaks at the start of my onclick function. How do I do it?
upvote count: 0
has answer: http://stackoverflow.com/a/25049426
tagged with: javascript
duplicate of: http://stackoverflow.com/q/7999148
favorite count: 0

http://stackoverflow.com/q/24919440
has answer: http://stackoverflow.com/a/25211232
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/25211232
has title: What is the correct usage of Firefox ToggleButton?
type: Question
accepted answer: http://stackoverflow.com/a/24919942
answer count: 2
tagged with: firefox
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: firefox-addon
has body: I'm writing and debugging a Firefox Addon using the SDK (version 1.16, Firefox version 31). I've been using the ToggleButton widget. I've noticed that when my extension is disabled in the about:addons menu, I see several 'TypeError: can't access dead object' message in toolbox console. These messages show up when I activate, and open tabs. The following is the simple code from the example that will demonstrate this issue: var ui = require("sdk/ui"); var button = ui.ToggleButton({ id: "my-button", label: "my button", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onClick: handleClick }); function handleClick(state) { require("sdk/tabs").open("https://www.mozilla.org/"); } exports.onUnload = function (reason) { console.log("onUnload", reason); button.destroy(); } Do I need to do something differently (other than destroy) in the onUnload function?
tagged with: firefox-addon-sdk
has answer: http://stackoverflow.com/a/24919942
upvote count: 3

http://stackoverflow.com/comment/38934377
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25033591
score: 0
has text: @Moe if that is the case this is a bad question. Please update your question including the fact that the API is Appery.io and what you're doing with their api.

http://stackoverflow.com/a/25034439
answers question: http://stackoverflow.com/q/25034334
score: 3
type: Answer
upvote count: 3
has body: The problem is that you picked a bad name for your object. There is build in History object available as window.history. So rename yours to something else and it should work. For example: var appHistory = { stack : [], counter : -1, ... }; You could also fix it by wrapping your code into IIFE for example, so that history would become a local variable. But I would still recommend picking less confusing name.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25034334

http://stackoverflow.com/a/24912219
score: 1
upvote count: 1
has body: You can use .die() and .live() in jQuery 1.6.4. Until 1.7 there is no .off() and .on() function. $(document).ready(function(){ $('#display-feedback-form').die('click').live('click', function(){ $('#feedback_form').show(); }); }); DEMO
answers question: http://stackoverflow.com/q/24912081
downvote count: 0
type: Answer

http://stackoverflow.com/q/25009023
has answer: http://stackoverflow.com/a/25009058
tagged with: getelementbyid
answer count: 4
has body: I have written the following code to display an input with Javascript's alert( ... ) function. My aim is to take a URL as input and open it in a new window. I concatenate it with 'http://' and then execute window.open(). However, I just get 'http://' in the URL name, even after concatenation, and not the complete URL. How can I fix this? &lt;html&gt; &lt;head&gt; &lt;meta content="text/html;charset=utf-8" http-equiv="Content-Type"&gt; &lt;meta content="utf-8" http-equiv="encoding"&gt; &lt;body onload="onload();"&gt; &lt;input type="text" name="enter" value="" id="url_id"&gt; &lt;input type="button" value="Submit" onclick="func();"&gt; &lt;/body&gt; &lt;script type="text/javascript"&gt; var url; function onload() { url = document.getElementById("url_id").value; } function func(){ var var1 = "http://"; var var2 = url; var res = var1.concat(var2); alert(var2); //window.open(res); } &lt;/script&gt; &lt;/head&gt; &lt;/html&gt;
accepted answer: http://stackoverflow.com/a/25009829
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25009829
has title: Issue with getElementById
has answer: http://stackoverflow.com/a/25009147
has answer: http://stackoverflow.com/a/25009071
tagged with: javascript
has comment: http://stackoverflow.com/comment/38887560
score: 0
possible better answer: http://stackoverflow.com/a/25009071

http://stackoverflow.com/q/24938865
type: Question
score: 5
has body: Is there a browser compatible (in my case >IE9, Firefox and Chrome) way to catch the edge case that a file, that was supposed to be uploaded in a HTML form, was renamed or deleted on user's PC and hence could not be submitted? I want to show an error to the user in that case after the impossible submit.
tagged with: javascript
answer count: 2
downvote count: 2
upvote count: 7
tagged with: http://stackoverflow.com/tag/html
has title: Can I find out if a to-be-uploaded file was deleted before submitting?
tagged with: file-upload
favorite count: 0
has answer: http://stackoverflow.com/a/24945814
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38761069
has comment: http://stackoverflow.com/comment/38764748
has comment: http://stackoverflow.com/comment/38755477
linked to: http://stackoverflow.com/q/3717793
tagged with: forms
has answer: http://stackoverflow.com/a/63740171

http://stackoverflow.com/comment/38901703
type: Comment
comment on: http://stackoverflow.com/a/25016510
has text: Thanks for code @JeroenNoten. It's working great now!
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38808017
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24966771
has text: Note that this isn't really a JavaScript question, it's a basic regular expression question about why a particular regex matches certain text.

http://stackoverflow.com/a/24998064
has body: I have had the same problem in which I tried to execute a JS file at the end of partial view. I loaded the $viewContentLoaded into the controller for the partial (or the directive). All you need in the $scope object in your controller declaration for injection. This seemed to fix it, but it may be a little bit harder as you have to load the script contents into the html. $scope.$on('$viewContentLoaded', function(){ //Do Something Here to load your script and insert it. }); Hope this helps, Patrick
answers question: http://stackoverflow.com/q/24997749
type: Answer
has comment: http://stackoverflow.com/comment/38979849
score: 0

http://stackoverflow.com/q/25047701
tagged with: stoppropagation
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38960689
tagged with: attachevent
has title: preventDefault, make changes and continue routine
tagged with: preventdefault
type: Question
has body: I have a small site with a script that runs a query with mysql and returns me some data, including domains. These domains are generated html links and I want to change in javascript, since I can not access the part of php, but yes to the javascript and css code. I just want you the code is run when the click event is triggered on a link. I tried to stop the execution by default and make a change, but my code does not open the page. If I remove preventDefault only works in firefox, but I have not chrome. (window.open not use, I want to change the original link). var domains = document.getElementsByClassName("domain"); for(var x = 0; x &lt; domains.length; x++){ if(domains[x].addEventListener) { domains[x].addEventListener("click", changeLink, "false"); } else if(domains[x].attachEvent) { domains[x].attachEvent("onclick", changeLink); } } function changeLink(evt){ var urlOriginal = this.href; // If I remove preventDefault, the function runs correctly on firefox but not in chrome evt.preventDefault(); if(urlOriginal != 'http://google.com') { urlOriginal = urlOriginal.replace(/http:\/\//g, ''); evt.stopPropagation(); this.href = 'http://intodns.com/' + urlOriginal; console.log('Okay !'); } return true; } I tried several changes but none is running, not really the case. Does anyone know the cause of malfunction? How I can fix it without window.open? Thanks
has answer: http://stackoverflow.com/a/25079731
has answer: http://stackoverflow.com/a/25047764
tagged with: addeventlistener
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38995576

http://stackoverflow.com/comment/38745276
has text: Here directive's return value return { restrict: 'E', replace: true, link: link, scope: { module: '=' }, templateUrl: '..url here...', controller: controller };
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24933076

http://stackoverflow.com/a/24949422
has comment: http://stackoverflow.com/comment/38775762
has comment: http://stackoverflow.com/comment/38775812
type: Answer
has comment: http://stackoverflow.com/comment/38775753
score: 1
has comment: http://stackoverflow.com/comment/38777930
upvote count: 1
answers question: http://stackoverflow.com/q/24949372
has comment: http://stackoverflow.com/comment/38775678
has body: What I got that you are facing problem in escaping / in replace. Try this "(23/10/2014)".replace(/\//g,"-") //returns "(23-10-2014)" I tried something for you using simple JS var arr = [{date:"(23/10/2014)"},{date:"(23/10/2014)"},{date:"(23/10/2014)"},{date:"(23/10/2014)"}]; arr.forEach(function(obj){obj.date = obj.date.replace(/\//g,"-")}); console.log(arr) //will print date field as "(23-10-2014)" for all objects.
downvote count: 0

http://stackoverflow.com/comment/38969188
type: AnswerComment
score: 0
type: Comment
has text: I voted yours up when I saw it. The escape of double quotes in double quotes and `JSON.parse` are interesting enough to leave it be I think.
comment on: http://stackoverflow.com/a/25052410

http://stackoverflow.com/comment/38739569
has text: I think you'd need to poll periodicaly (like every 500s or so) for the cookie existence and fire a function if it's not there.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24930271

http://stackoverflow.com/q/25021522
has answer: http://stackoverflow.com/a/25023491
tagged with: ibm-mobilefirst
has answer: http://stackoverflow.com/a/25021694
has body: I cannot understand why this is happening. I have a swiper nested in another swiper (one for vertical scrolling, the other for horizontal. What is driving me nuts is the nested swiper is not defined when I need to destroy it. Here is what I am doing: function embedSwiper(){ var embeddedEcosystem = new Swiper('.swiper-nested', { //Styling set in bootstrap.min.css for pagination mode: 'vertical', pagination: '.pagination-nested', paginationClickable: true, simulateTouch : true, }); embeddedEcosystem.swipeTo(0, 500, false); return embeddedEcosystem; } That creates the swiper, and returns it to this function: function reInitEmbedded(){ setTimeout(function(){ embed = embedSwiper(); $(".swiper-nested").css({"height" : "0px"}); $(".swiper-nested").css({"height" : $(".internal-relations").height()}); useLocalImg(); embed.reInit(); //Set the slide height properly since it never works as intended return embed; }, 600); } I need to set the height here otherwise the slide is not properly fitted (and yes I have tried calculate height, but that was giving me issues on mobile since I am using worklight) Now, here is where stuff gets wonkey. I am testing this in chrome (sorry, no link that I can provide you with at the moment). //Resize cards swiper = reinitSwiper(); innerSwiper = reInitEmbedded(); //Show info detailsTransition(); //Hides the overlay, and empties the panels to be filled next time //Bound calls for use when needed $(".back-button.btn.btn-primary.pull-left").on('click', function(){ goBack(lookUpName); innerSwiper.destroy(); swiper.destroy(); }); As you can see, I have the swiper variable, which works, and can be destroyed normally, and I have the innerSwiper. The rest is irrelevant because it was working prior to this. What is driving me nuts is that innerSwiperkeeps coming up as undefined, but it shouldn't be because I have traced the stack call in chrome's debugger and the returns all have the swiper variable for the inner swiper. So my question is: What am I doing…
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25021660
score: 0
answer count: 3
tagged with: swiper.js
has title: Why is my swiper undefined?
type: UnansweredQuestion

http://stackoverflow.com/a/25034072
answers question: http://stackoverflow.com/q/25033917
has comment: http://stackoverflow.com/comment/38934202
type: Answer
has body: why not make the jquery datepicker a fallback? pseudocode: if (! input.supports('date')) $(input).datepicker(); this way, you get a datepicker if your browser does not support the native one. That is exactly what jQuery's original 'unobtrusive' idea was.
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38934594
has comment: http://stackoverflow.com/comment/38934080
score: 0

http://stackoverflow.com/comment/38756330
has text: I think at the time you call any of the functions the value of the variable `i` its 4.
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24939266
type: QuestionComment

http://stackoverflow.com/a/24980000
has comment: http://stackoverflow.com/comment/38832760
upvote count: 2
score: 2
has body: since you're going to use php: &lt;?php // get the json $data = file_get_contents( 'http://url_to_the_json' ); // decode the json $data = json_decode( $data ); // see it echo '&lt;pre&gt;' . print_r( $data, true ) . '&lt;/pre&gt;'; // data is now a php object/array/combination. // I'm not sure how your json file is structured but you can try: echo $data-&gt;registry-&gt;name;
downvote count: 0
answers question: http://stackoverflow.com/q/24979943
type: Answer

http://stackoverflow.com/a/24925860
answers question: http://stackoverflow.com/q/24924857
type: Answer
score: 1
has body: With the transform:rotate(90deg) you can add translateX and translateY to position it just right. $('.header_rotate').css({ transform: 'translateX(-130px) translateY(200px) rotate(90deg)', backgroundColor: 'green', height: '200', width: '600', }); Here is the fiddle: http://jsfiddle.net/dRvy8/2/
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24924857
downvote count: 0

http://stackoverflow.com/comment/38733145
score: 0
type: Comment
has text: i got an error - ReferenceError: store is not defined
comment on: http://stackoverflow.com/a/24926948
type: AnswerComment

http://stackoverflow.com/q/25042105
has comment: http://stackoverflow.com/comment/38949812
has answer: http://stackoverflow.com/a/25042625
has answer: http://stackoverflow.com/a/25042165
accepted answer: http://stackoverflow.com/a/25042625
favorite count: 0
type: AnsweredQuestion
has body: I had a object object array which i used JSON.stringify() on i can now see what's in my array but when i do arr[0] etc it only outputs one letter. arr = {"hello":"yes","because":"no"} arr[0] =h I want it to output the whole of the value not just the first letter My code var clientContext = SP.ClientContext.get_current(); var peopleManager = new SP.UserProfiles.PeopleManager(clientContext); // Get user properties for the target user. // To get the PersonProperties object for the current user, use the // getMyProperties method. MyProperties = peopleManager.getMyProperties(); // Load the PersonProperties object and send the request. clientContext.load(MyProperties); clientContext.executeQueryAsync(getMyNewsChoicesSuccess, getMyNewsChoicesFail); }, getMyNewsChoicesSuccess = function () { //get the news choice by actually fieldname var MyChoices = JSON.stringify(MyProperties.get_userProfileProperties().Value); $('#NBStest').text(MyChoices); },
downvote count: 3
upvote count: 1
tagged with: sha
type: Question
score: -2
tagged with: arrays
has comment: http://stackoverflow.com/comment/38949928
tagged with: javascript
has comment: http://stackoverflow.com/comment/38950929
has answer: http://stackoverflow.com/a/25042178
has title: Object Obect array Json.stringify string array
possible better answer: http://stackoverflow.com/a/25042165
answer count: 3
has comment: http://stackoverflow.com/comment/38973202
has comment: http://stackoverflow.com/comment/38949815

http://stackoverflow.com/comment/39046645
has text: OK thanks. Is there an option to make the columns resizable? and add a horizontal slider on the ngGrid ? and a ToolTip that will be shown on mouse over a cell and display the Cell text ?
comment on: http://stackoverflow.com/a/25057671
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25004807
has comment: http://stackoverflow.com/comment/38879456
has comment: http://stackoverflow.com/comment/38879557
favorite count: 0
has answer: http://stackoverflow.com/a/25004857
has comment: http://stackoverflow.com/comment/38879461
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38879471
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25004857
has comment: http://stackoverflow.com/comment/38879532
has comment: http://stackoverflow.com/comment/38879464
downvote count: 3
has body: I don't what happen with my script can i please point out where is my mistake. 1 to 9 all condition working fine but when you put 10-12 is not work Click Javascript function checkoption() { var itemqty = document.getElementById('quantity'); var iss = document.getElementById('itemstock'); if(itemqty.value > iss.value) { alert('We have Currently '+iss.value+' In Stock'); } else { alert('add to cart'); } } Thank you in advance Screen short see qty i put 13 but its not showing error
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25004870
score: -2
tagged with: javascript
has title: I have issues with my JavaScript
possible better answer: http://stackoverflow.com/a/25004870
has comment: http://stackoverflow.com/comment/38879781
has comment: http://stackoverflow.com/comment/38879435
answer count: 2

http://stackoverflow.com/q/24980698
tagged with: javascript
has comment: http://stackoverflow.com/comment/38835901
has comment: http://stackoverflow.com/comment/38837277
score: 0
has comment: http://stackoverflow.com/comment/38835379
answer count: 1
has comment: http://stackoverflow.com/comment/38837014
has body: I would like to send a JavaScript XMLlhttpRequest to a .py script on Google App Engine. But I am not looking for a jQuery solution HTML: User: Comment here: JavaScript: Google App Engine (script file is called communication.py and is in home directory of my GAE app): class CommentsService(webapp2.RequestHandler): """This Handler is responsible for the Commenting Service""" def post(self): comment = Comments() user = cgi.escape(self.request.get('user')) message = cgi.escape(self.request.get('message')) comment.url_ = cgi.escape(self.request.get('url')) comment.user_ = cgi.escape(self.request.get('user')) #comment.date = cgi.escape(self.request.get('date')) comment.message = cgi.escape(self.request.get('message')) comment.element_id = cgi.escape(self.request.get('element_id')) comment.put() self.response.out.write("input1: %s input2: %s" % (user, message)) app.yaml application: myapp version: 1 runtime: python27 api_version: 1 threadsafe: true handlers: - url: /stylesheets static_dir: stylesheets - url: /.* script: myapp.application libraries: - name: webapp2 version: latest - name: jinja2 version: latest I got the error messsage in the console: POST http://myapp.appspot.com/communication.py 404 (Not Found) Therefore, I guess there is some issue with finding communication.py Any ideas why the file is not found?
has comment: http://stackoverflow.com/comment/38836973
type: UnansweredQuestion
tagged with: google-app-engine
tagged with: python
tagged with: xmlhttprequest
has answer: http://stackoverflow.com/a/27503810
has comment: http://stackoverflow.com/comment/38837324
has title: How to send a POST request with JavaScript XMLlhttpRequest to Google App Engine?
type: Question
has comment: http://stackoverflow.com/comment/38836732

http://stackoverflow.com/a/24961230
answers question: http://stackoverflow.com/q/24961163
has comment: http://stackoverflow.com/comment/38798066
accepted answer of: http://stackoverflow.com/q/24961163
has comment: http://stackoverflow.com/comment/38797823
has body: var factory = {}; TypeScript infers the type of factory from its initializer. Here, you've said that factory has no members, so any attempt to read or write a property on it is going to fail. You could simply change the type of factory to be any: var factory: any = {}; This will make it valid to read or write any property of factory, but that might be too permissive. You could also write out the type of it: var factory: { rowClicked($index, collection); } = &lt;any&gt;{}; If you have types for $index and collection, you could improve the type further: var factory: { rowClicked($index: MyIndexService, collection: MyRowCollectionType); } = &lt;any&gt;{};
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38797670
type: Answer
upvote count: 2

http://stackoverflow.com/q/24934070
has title: How to handle simultaneous ajax responses using single ajax method?
has answer: http://stackoverflow.com/a/24934337
type: Question
has body: Method for handling ajax function ajaxMethod(){ return $.ajax({ url: ajaxUrl, type: "POST", dataType: "JSONP", jsonpCallback: ajaxCallback }); } Calls to this method: dD(ajaxMethod()); aA(ajaxMethod()); bB(ajaxMethod()); cC(ajaxMethod()); aa,bb,cc,dd method have promise.success(function (response) { console.log(response); }); Now aA response is coming in bB function,,bb response in cc function and as simultaneous call is coming. Also tried using async true nothing happens. Any suggestions?
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24934361
has answer: http://stackoverflow.com/a/24934275
has comment: http://stackoverflow.com/comment/38746710
type: UnansweredQuestion

http://stackoverflow.com/q/25054379
favorite count: 0
has title: Functionality undo and redo with draggable and resizable
linked to: http://stackoverflow.com/q/25032040
type: UnansweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25061358
score: 1
type: Question
tagged with: jquery-ui
tagged with: undo-redo
tagged with: javascript
tagged with: jquery
has body: After write this question, I have been working in a example to develope two history buttons (undo and redo) with some divs which can be resized or draggable. More or less, it's working, but I have a problem because I don't know how to do that the buttons undo or redo don't need to be pressed two times by the user. I am storing the star event of drag and resize for undo, and I'm storing the stop event of drag and resize for the redo. I have some ideas in mind for solve the problem, but I don't like, one of them if check if the div has the same style, make another redo or undo. Can anybody explain me how can I do that in a correct way? Here you have a Fiddle with all the funcionality HTML Undo Redo &lt;div class="workspace"&gt; &lt;div class="editable" id="panel1" style="width:50px; height:50px; left: 10px; top:10px; background-color: #3498db;"&gt;&lt;/div&gt; &lt;div class="editable" id="panel2" style="width:50px; height:50px; left: 70px; top:10px; background-color: #f1c40f"&gt;&lt;/div&gt; &lt;div class="editable" id="panel3" style="width:50px; height:50px; left: 130px; top:10px; background-color: #16a085;"&gt;&lt;/div&gt; &lt;/div&gt; CSS .editable { position: absolute; display: inline-block; } .workspace { top: 50px; width: 100%; height: 100%; position: absolute; } .buttonsMenu { position:absolute; padding:20px; height: 30px; } JAVASCRIPT //History Object var historyApp = { stackStyle : [], stackId : [], counter : -1, add : function(style, id){ ++this.counter; this.stackStyle[this.counter] = style; this.stackId[this.counter] = id; this.doSomethingWith(style, id); // delete anything forward of the counter this.stackStyle.splice(this.counter+1); }, undo : function(){ --this.counter; this.doSomethingWith(this.stackStyle[this.counter],this.stackId[this.counter]); }, redo : function(){ ++this.counter; this.doSomethingWith(this.stackStyle[this.counter],this.stackId[this.counter]); }, doSomethingWith : function(style, id){ //Check if make buttons undo/redo disabled or en…
upvote count: 1
answer count: 1

http://stackoverflow.com/comment/38927300
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25029911
has text: as per the [doc](http://qtip2.com/options#content.text) it should be fine `content.text: Deferred, function(){}, jQuery([ ]), "String", true (Default: true)`

http://stackoverflow.com/q/25019905
has answer: http://stackoverflow.com/a/25020013
upvote count: 1
has comment: http://stackoverflow.com/comment/38908043
type: AnsweredQuestion
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38908157
has answer: http://stackoverflow.com/a/25020005
downvote count: 0
tagged with: javascript
has body: I want to hide all inputs with class "chang" that contain any value after browser refresh, but entered by the user before refreshing. I tried few things, and nothing works. It's my HTML code: &lt;input class="chang" id="test1" /&gt; &lt;input class="chang" id="test2" /&gt; And script: $(document).ready(function() { if( $(".chang").val().length != 0 ) { $(this).hide(); } }); I tried to make it works in Firefox (if it's matter). What am I doing wrong in this case?
tagged with: jquery
has title: How to check if value of input is empty after browser refresh?
has answer: http://stackoverflow.com/a/25019918
answer count: 3
has comment: http://stackoverflow.com/comment/38908037
possible better answer: http://stackoverflow.com/a/25019918
favorite count: 0
accepted answer: http://stackoverflow.com/a/25020005

http://stackoverflow.com/a/25028720
type: Answer
answers question: http://stackoverflow.com/q/25027715
has comment: http://stackoverflow.com/comment/38924799
has comment: http://stackoverflow.com/comment/38944812
has comment: http://stackoverflow.com/comment/38924907
has comment: http://stackoverflow.com/comment/38942931
score: 0
has body: Updated It is not necessary to have a default value for the box-shadow property of #player1, since it will be set by JavaScript when the page is loaded (This is what you intended to do right?). You may try the following: Pure JavaScript DEMO (RGB value is hard-coded) $(window).ready(function(){ var sourceImage = document.getElementById("art"); var colorThief = new ColorThief(); var color = colorThief.getColor(sourceImage); document.getElementById('player1').style['boxShadow'] = '10px 10px 5px rgba('+ color[0] + ', ' + color[1] + ', ' + color[2] + ', 0.5)'; }); However, IE doesn't seem to support .style['boxShadow']. Alternatively, I recommend using jQuery, and you may try the following: jQuery DEMO (RGB value is hard-coded) $(window).ready(function(){ var sourceImage = document.getElementById("art"); var colorThief = new ColorThief(); var color = colorThief.getColor(sourceImage); $('#player1').css('box-shadow', '10px 10px 5px rgba('+ color[0] + ', ' + color[1] + ', ' + color[2] + ', 0.5)'); }); And this code snippet works in IE as well.

http://stackoverflow.com/comment/38903033
has text: Oohhh my bad, you're absolutely right @cookiemonster. Apologies. I'll edit my answer.
comment on: http://stackoverflow.com/a/25017222
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/24958626
tagged with: php
type: AnsweredQuestion
has title: Twitter API since_id and max_id
has body: I'm trying to get and generate a Twitter timeline from PHP and Javascript. So I doing the following things. 1- Get an initial tweets for #OneHashtag, with this query params: count=20, since_id=0, max_id=NULL (no max_id param) 2- Set my since_id variable with the newest tweet previosly retrieved. 3- Set max_id variable with SINCE_ID + 20 (count parameter) 4- Make the query with this new params My problem and question is, this approuch is correct? And second, i'm having problems to perform addition beetween SINCE_ID + 20 in javascript, to set my new params and make the ajax request. Much appreciate your help! Regards.
accepted answer: http://stackoverflow.com/a/25003503
type: Question
tagged with: javascript
tagged with: twitter
has answer: http://stackoverflow.com/a/25003503
score: 0
answer count: 1

http://stackoverflow.com/a/24990198
score: 7
upvote count: 7
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24989984
has body: I think toJD() is not what you need: var d = $.calendars.newDate(1388, 1, 1, 'persian', 'fa'); console.log("Persian date: "+d.toLocaleString()); // Persian date: 1388-01-01 var e = d.toJSDate(); console.log(e); // Sat Mar 21 2009 00:00:00 GMT+0100 (Romance Standard Time) UPDATE: For your comment I see the issue is not solved with this because it transforms the Persian date to your locale date. As far as I can see in the library's reference, there is no way to tell to that function which locale should be used. So the correct way, as the author's provided demo shows, is creating another target calendar and pass the current one as parameter: var d = $.calendars.newDate(1388, 1, 1, 'persian', 'fa'); var e = $.calendars.newDate(d, 'gregorian', 'fa');
answers question: http://stackoverflow.com/q/24989984

http://stackoverflow.com/comment/38836999
comment on: http://stackoverflow.com/a/24982294
score: 0
type: AnswerComment
has text: still clearing out all the images, or is there a way to run that after my code that is inserting images?
type: Comment

http://stackoverflow.com/comment/38907706
comment on: http://stackoverflow.com/q/25019245
type: QuestionComment
has text: Adding Dispatcher in my question...
score: 0
type: Comment

http://stackoverflow.com/comment/38813004
type: QuestionComment
has text: You should probably include the code that isn't working.
score: 1
comment on: http://stackoverflow.com/q/24969621
type: Comment

http://stackoverflow.com/q/24918134
has answer: http://stackoverflow.com/a/24919527
has body: As I am in learning phase of AngularJS, today I noticed one thing about the tutorials avaliable for it. In the tutorials, the URLs used are hardcoded in the HTML and JS files. For example: If I have my routes defined like this in my config: // config.js $routeProvider.when("/", { // Home Page templateUrl: basePageUrl, controller: "Home" }).when("/searches", { templateUrl: basePageUrl, // Search Page controller: "SearchPage", }) Now in my home.html , if I want to create a link to searches page. I have to do the following: Hello Home Go to Searches So, I was looking for a solution so I don't have to hard-code the links in HTML or JS files. More like, the urls resolution functionality that each Backend MVC framework provides.. e.g Django: {% url %} templetag for HTML and reverse() for python code Rails: <%= link_to %> tag for HTML etc.. Is there a URL resolution functionality provided by AngularJS or any plugin ? Note: I can implement something similar by storing JS variables/object for urls, but that doesn't look a good design to me
score: 4
answer count: 1
favorite count: 0
tagged with: angularjs
tagged with: url-routing
upvote count: 4
type: AnsweredQuestion
has title: How to avoid hardcoding URLs (or Routes) in AngularJS ? (provide URL resolution)
accepted answer: http://stackoverflow.com/a/24919527
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38862395
has text: It looks like the variable `today` does not contain the value that you are looking for, since it is an object. The property `Today` contains the number. Try totalSales.Today instead of totalSales.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24935535
type: AnswerComment

http://stackoverflow.com/comment/38871155
has text: I'm asking this question so that I can void doing so, buddy.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25000333

http://stackoverflow.com/a/24968728
has comment: http://stackoverflow.com/comment/38833220
answers question: http://stackoverflow.com/q/24968586
downvote count: 0
has comment: http://stackoverflow.com/comment/38834060
score: 1
has comment: http://stackoverflow.com/comment/38811712
has comment: http://stackoverflow.com/comment/38834531
has comment: http://stackoverflow.com/comment/38832844
has comment: http://stackoverflow.com/comment/38832914
upvote count: 1
has comment: http://stackoverflow.com/comment/38833082
has body: When you add new elements dynamically to the DOM tree, these new elements don't automagically get effected by already initialized code. In your case you'll have to initialize the venobox on each new link after it's added. Try this: function sendLineToDOM (lineType) { var toAdd = $('input[name=userEntry]').val(); if (toAdd == null || toAdd == "") { console.log('empty'); } else { // two lines generated here while experimenting with venobox // this uses venobox's 'iframe' option var iframeRow = $(" " + "iframe: " + toAdd + " "), iframeLink = iframeRow.find('a'); $('.list').prepend(iframeRow); // this uses venobox's 'inline' option var inlineRow = $(" " + "inline: " + toAdd + " "), inlineLink = inlineRow.find('a'); $('.list').prepend(inlineRow); // empty text input field once data consumed $('#textEntry').val(""); iframeLink.venobox(); inlineLink.venobox(); } } }
type: Answer
has comment: http://stackoverflow.com/comment/38832927

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

http://stackoverflow.com/q/25028588
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/87633223
tagged with: jquery-events
answer count: 3
has title: Scrolling to the top without triggering scroll()
score: 2
has answer: http://stackoverflow.com/a/50307957
upvote count: 2
has body: I am binding scroll to an element with some logic $(".elem").scroll(function(){ some logic }); and it other places of the code I need to scroll to the top of the element, but without triggering the scroll event $(".elem").scrollTop(0) Is this possible?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25028706
has answer: http://stackoverflow.com/a/50782776
type: Question
linked to: http://stackoverflow.com/q/25949234
downvote count: 0
has comment: http://stackoverflow.com/comment/116333718

http://stackoverflow.com/q/25051791
linked to: http://stackoverflow.com/q/203198
has answer: http://stackoverflow.com/a/25051850
tagged with: javascript
duplicate of: http://stackoverflow.com/q/203198
accepted answer: http://stackoverflow.com/a/25051832
answer count: 3
tagged with: jquery
has answer: http://stackoverflow.com/a/25051880
tagged with: http://stackoverflow.com/tag/html
has title: The on click to remove does not work
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25051832
linked to: http://stackoverflow.com/q/8752321
score: 0
has body: I was trying to execute a jquery code in jsfiddle. My jquery code is given below $(function() { var scntDiv = $('#p_scents'); var i = $('#p_scents p').size() + 1; $('#addScnt').on('click', function() { $(' Remove ').appendTo(scntDiv); i++; return false; }); $('#remScnt').on('click', function() { alert("sfdrijg"); if( i > 2 ) { $(this).parents('p').remove(); i--; } return false; }); }); My HTML code is given below. Add Another Input Box My Page Looks like this The click of the "Add Another Input Box" always works whereas the "Remove" does not respond at all.
type: Question
possible better answer: http://stackoverflow.com/a/25051850

http://stackoverflow.com/a/25036912
has body: Just abstract your form into a separate viewmodel: function FormViewModel() { var self = this; self.selectedSampleRate = ko.observable(); self.selectedMclk = ko.observable(); self.selectedTdmchan = ko.observable(); self.sampleRate = ko.observableArray[/* ... */]) self.mclk = ko.observableArray([/* ... */]) self.tdmChans = ko.computed(function () { /* ... */ }, self); } ...prepare your AppViewModel to have several of them: function AppViewModel() { var self = this; self.forms = ko.observableArray([]); self.addForm = function () { self.forms.push(new FormViewModel()); }; self.canAddForm = ko.computed(function () { return self.forms().length < 5; }); } and use the foreach binding in your view: Add Form I trust you find out the rest (like how to make a "remove form" button) yourself.
type: Answer
has comment: http://stackoverflow.com/comment/39084456
has comment: http://stackoverflow.com/comment/39113099
answers question: http://stackoverflow.com/q/25035522
score: 0
has comment: http://stackoverflow.com/comment/39086371

http://stackoverflow.com/comment/38819235
has text: I Got the Sequence Problem Solution.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24971168
type: Comment

datetimepicker
type: Tag
tag name: datetimepicker
tags question: http://stackoverflow.com/q/25048234

http://stackoverflow.com/a/25233150
type: Answer
answers question: http://stackoverflow.com/q/25042378
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25042378
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39335281
has body: Working plunker I got it working by including all event handler functions into the global scope. That should be enough. (function($) { // LOAD THE PLAYER var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); var done = false; var player; var videoId = 'A3PDXmYoF5U'; var startSeconds = 5; var endSeconds = 293; var setVolume = 15; var suggestedQuality = 'large'; window.onYouTubeIframeAPIReady = function() { player = new YT.Player('player', { height: ($(window).width() / 16) * 9 + 35, width: '100%', events: { 'onReady': onPlayerReady, 'onStateChange': onPlayerStateChange } }); } window.onPlayerReady = function(evt) { player.loadVideoById({ 'videoId': videoId, 'startSeconds': startSeconds, 'endSeconds': endSeconds, 'suggestedQuality': suggestedQuality }); evt.target.playVideo(); } window.onPlayerStateChange = function(event) { var done = false; // SOUNDCHECK if (event.data == YT.PlayerState.PLAYING &amp;&amp; !done) { if (player.isMuted()) { $(".eq").addClass("mute"); } if (player.getVolume() &gt; setVolume) { player.setVolume(setVolume); } done = true; } // LOOP if (event.data == YT.PlayerState.ENDED &amp;&amp; !done) { player.seekTo(startSeconds, true); done = true; } } })(jQuery);

http://stackoverflow.com/a/25062977
has body: When are you binding the click event? If it's before the element exists, you'll want to use .on. $('body').on('click','.delete', function(){ alert('delete clicked for id: ' + $(this).attr('id')); }); Check out a working jsFiddle.
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38994118
has comment: http://stackoverflow.com/comment/38992592
has comment: http://stackoverflow.com/comment/38988900
accepted answer of: http://stackoverflow.com/q/25062515
answers question: http://stackoverflow.com/q/25062515
score: 0

http://stackoverflow.com/comment/38808703
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24967204
has text: Local directory, or directory on a webserver? Local directory doesn't make sense and it's a security risk.

http://stackoverflow.com/comment/38839456
score: 1
comment on: http://stackoverflow.com/q/24983620
type: QuestionComment
type: Comment
has text: Can you please move your code into the question itself? SO tries to not rely on outside resources.

http://stackoverflow.com/a/25004385
has comment: http://stackoverflow.com/comment/38878930
has comment: http://stackoverflow.com/comment/38883890
answers question: http://stackoverflow.com/q/25004013
type: Answer
has comment: http://stackoverflow.com/comment/38995930
has comment: http://stackoverflow.com/comment/38996091
has comment: http://stackoverflow.com/comment/38879370
has comment: http://stackoverflow.com/comment/38878903
has comment: http://stackoverflow.com/comment/38959560
has comment: http://stackoverflow.com/comment/38996007
score: 0
has comment: http://stackoverflow.com/comment/38959223
has body: EDIT: I'm going to suggest window.scrollto() JsFiddle Instead of using an anchor with a hash, use any element with an id function sizeTbl() { var tbl = document.getElementById('tbl'); var icon = document.getElementById('toggle-table'); if (icon.innerText === 'hide'){ tbl.style.display = 'none'; icon.innerText = 'show'; } else { tbl.style.display = 'block'; icon.innerText = 'hide'; } var x = getOffset( document.getElementById('bottom') ); console.log(x); window.scrollTo(x.left, x.top); // values are x,y-offset } function getOffset( el ) { var _x = 0; var _y = 0; while( el &amp;&amp; !isNaN( el.offsetLeft ) &amp;&amp; !isNaN( el.offsetTop ) ) { _x += el.offsetLeft - el.scrollLeft; _y += el.offsetTop - el.scrollTop; el = el.offsetParent; } return { top: _y, left: _x }; }

http://stackoverflow.com/q/24978057
tagged with: chart.js
has answer: http://stackoverflow.com/a/44125301
type: Question
answer count: 2
score: 8
has comment: http://stackoverflow.com/comment/44698169
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25053556
tagged with: jquery
favorite count: 0
upvote count: 8
has title: Chart.js bar chart is overflowing its containing element
type: UnansweredQuestion
tagged with: charts
has body: Chart.js I can't get this stupid chart to stay in its container when padding has been applied to the container. It doesn't matter if the responsive option is set to true. It also doesn't matter what I set box-sizing to. What's the purpose of the responsive option if not to fit it's container?

http://stackoverflow.com/a/25008525
score: 1
has comment: http://stackoverflow.com/comment/38891371
upvote count: 1
has comment: http://stackoverflow.com/comment/38897054
has comment: http://stackoverflow.com/comment/38890921
has body: You should add fill-rule attribute to svg element. Original svg file has fill-rule attribute which value is "evenodd", but svg element described in html has no fill-rule, so browser treats the fill-rule attribute has "nonzero" as default value. Thus the copied svg graphic looks like its style info was lost. Snap.ajax("https://dl.dropboxusercontent.com/u/140225334/bike2.svg", function(request) { var maing = s1.g(); var svg = Snap(request.responseXML.documentElement); var maing = svg.selectAll("svg&gt;*");//you can select any elements. //copy fill-rule attribute. s1.attr("fill-rule", svg.node.getAttribute("fill-rule")); s1.append(maing); maing.attr({id: 'maing' }); // maing.transform('r45'); });
has comment: http://stackoverflow.com/comment/38888845
has comment: http://stackoverflow.com/comment/38891580
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38891124
accepted answer of: http://stackoverflow.com/q/24993189
type: Answer
has comment: http://stackoverflow.com/comment/38888285
has comment: http://stackoverflow.com/comment/38889458
answers question: http://stackoverflow.com/q/24993189

http://stackoverflow.com/a/63238247
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24989346
upvote count: 1
type: Answer
has body: Finally I fixed it. The problem was changing the prop without deep cloning it. my prop was an array of objects and i was changing it on parent with : let newtodos = [...this.state.todos]; newtodos[0].text = 'changed text'; this.setState({ todos : newtodos }); So in componentDidUpdate i was getting the wrong result: componentDidUpdate(prevProps){ //prevProps.todos is always equal to this.props.todos, since you changed the prop object directly. if(JSON.stringify(prevProps.todos) !== JSON.stringify(this.props.todos){...} } So i fixed it with: // let newtodos = [...this.state.todos]; // SHALLOW COPY - Wrong let newtodos = JSON.parse(JSON.stringify(this.state.todos)); // Deep Clone - Right newtodos[0].text = 'changed text'; this.setState({ todos : newtodos });

http://stackoverflow.com/a/24924898
downvote count: 0
has comment: http://stackoverflow.com/comment/38732593
has comment: http://stackoverflow.com/comment/38732778
has comment: http://stackoverflow.com/comment/38732465
type: Answer
has body: When you access a property on an object, Javascript looks first directly on the object for any properties that have been added directly to the object (these are called "own" properties). If it doesn't find the property there, then it looks up the prototype chain. So, when you do this: var Triangle = new Shape(); console.log(Triangle.toString()); // 'Shape' it looks for the .toString() property on the actual object named Triangle, but there is no property by that name directly on that object. So, since it didn't find anything on the object directly, it then looks on the prototype and it finds the Shape.prototype.toString() implementation there and that is what is executed. A reference to the prototype is stored on the Triangle object when it is created. It is not stored in the .prototype property - that property is only used on the constructor. Instead, each JS version has its own way of storing a reference to the prototype and it has traditionally not been the same for all browsers and how it was stored was non-standard. It was originally meant only for internal use by the JS engine. For example, Chrome stores it on a property named obj.__proto__, but IE does not. To fix this lack of standardization, there is new method called obj.getPrototypeOf() which can now be used in modern browsers to get access to the prototype for a given object. In any case, the JS engine searches this prototype for you automatically when resolving property names that are not found on the actual object itself. If you did this: var Triangle = new Shape(); Triangle.toString = function() { return 'Shape named Triangle'; } console.log(Triangle.toString()); // 'Shape named Triangle' Then, javascript would first find the toString() implementation that you attached directly to the object and it would execute that one rather than the one on the prototype.
score: 3
has comment: http://stackoverflow.com/comment/38734281
upvote count: 3
has comment: http://stackoverflow.com/comment/38732391
has comment: http://stackoverflow.com/comment/38732865
answers question: http://stackoverflow.com/q/24924872
has comment: http://stackoverflow.com/comment/38730447
has comment: http://stackoverflow.com/comment/38730004

http://stackoverflow.com/comment/65098981
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25034254
type: Comment
has text: Nevermind, thanks so far for your help! I already extended your code to work for checkboxes as well (with the method you described) which worked pretty well. With your agreement I might even make a little library out of it based on your code.

http://stackoverflow.com/q/25061390
type: AnsweredQuestion
type: Question
downvote count: 4
accepted answer: http://stackoverflow.com/a/25067847
answer count: 1
tagged with: mean-stack
tagged with: javascript
tagged with: node.js
favorite count: 0
has body: I am starting a new Android app, and I would like to know what should be the best server-side stack that I could use. I heard some about MeanIO, MeanJS, Cleverstack, Generator Angular Fullstack. Which of these suggestions should be the best? Is there another one that is not on the list that would be even more interesting?
has title: Node.js server side application starter
has answer: http://stackoverflow.com/a/25067847
score: -3
upvote count: 1

http://stackoverflow.com/a/24932520
has comment: http://stackoverflow.com/comment/38743165
has body: img.onload = function() { img.onload = true; callback(img); }; function callback(img){ while(img.onload) { // what do you want // complete your work and img.onload set false for stop execution of loop } } when unload function execute then callback is calling and it do your stuff
answers question: http://stackoverflow.com/q/24932239
score: 0
has comment: http://stackoverflow.com/comment/38743885
type: Answer

http://stackoverflow.com/a/25006178
type: Answer
has body: double quotes at the end of these 2 scripts correct html
answers question: http://stackoverflow.com/q/25005923
score: 0

http://stackoverflow.com/comment/38974855
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25055177
type: AnswerComment
has text: your answer does not answer the question. Of course there are millions of ways to access `Obj` from other places, but there is NO WAY for an object to get reference to objects that hold a reference (the "owner" as the OP put it) to it.

http://stackoverflow.com/a/24979573
type: Answer
accepted answer of: http://stackoverflow.com/q/24979316
answers question: http://stackoverflow.com/q/24979316
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
has body: I removed the excess div's and their float layout and used display: inline; on your buttons, so they don't break the line: Sorry, have to paste html here, otherwise i can't link a fiddle: Change units Change units Change units http://jsfiddle.net/4T4pb/2/ That should be what you are looking for.

http://stackoverflow.com/comment/38858386
type: QuestionComment
comment on: http://stackoverflow.com/q/24993799
has text: I dont understand the point of doing this? why not directly access the name. obj.name? Just curious
score: 0
type: Comment

http://stackoverflow.com/a/24924320
score: 0
type: Answer
has body: I've tried something. This should work for you HTML Switch Javascript function fillText() { var myswitch = document.getElementById("myonoffswitch"); var mytextarea= document.getElementById("mytextarea"); myswitch.onchange = function(){ if(this.checked){ mytextarea.value = "Hello" }else{ mytextarea.value = "Goodbye" } } } window.onload = fillText;
answers question: http://stackoverflow.com/q/24924249

http://stackoverflow.com/q/25034959
tagged with: jquery
has title: AJAX request not working in ie9 - Google Maps API/jQuery
tagged with: ajax
duplicate of: http://stackoverflow.com/q/6318996
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38935694
answer count: 0
has comment: http://stackoverflow.com/comment/38936555
has comment: http://stackoverflow.com/comment/38935815
type: Question
has body: I have Google maps on my page, my visitors can drag a maker from outside of the google maps canvas window and on the release of the marker an input field is populated. My function works fine in all browsers but ie9. function GetLocation(location) { var result; $.ajax({ url: "http://maps.googleapis.com/maps/api/geocode/json?address=" + location + "&amp;components=country:UK&amp;sensor=false", async: false, type: "POST", success: function (data) { result = data; alert("result: " + result); } }); return result; } $(".startPoint").draggable({ helper: 'clone', stop: function (e, ui) { var mOffset = $(map.getDiv()).offset(); var point = new google.maps.Point( ui.offset.left - mOffset.left + (ui.helper.width() / 2), ui.offset.top - mOffset.top + (ui.helper.height())); var ll = overlay.getProjection().fromContainerPixelToLatLng(point); var address = GetAddress(ll.k, ll.B); if (address.status == 'OK') { placeMarker(ll, address.results[0].formatted_address, 'img/startLoc.png', $('#startLocation')); $('#startLocation').val(address.results[0].formatted_address); } else { alert('Could not find an address'); } } }); The above fails and I've no idea why - can anybody advise me in the best way to debug this issue? Console Errors Unable to get the value of the property 'status': object is null or undefined
tagged with: javascript
score: 0
tagged with: google-maps
linked to: http://stackoverflow.com/q/6318996

http://stackoverflow.com/comment/38980830
type: Comment
type: QuestionComment
has text: You simply attach it to the textarea. `$('.your-textarea').wysihtml5();`
comment on: http://stackoverflow.com/q/25058076
score: 0

http://stackoverflow.com/comment/38872506
has text: For starters, `return( b.id > a.id);` might be what you're looking for?
score: 0
comment on: http://stackoverflow.com/q/25001263
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25000528
has title: Attempting to dissect a tutorial, but getting awkward behavior
score: 1
has comment: http://stackoverflow.com/comment/38875453
favorite count: 0
accepted answer: http://stackoverflow.com/a/25004981
has comment: http://stackoverflow.com/comment/38871240
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38871482
has comment: http://stackoverflow.com/comment/38871418
has body: I am extremely new to Angular.js and am trying very hard to learn it, I need to adapt some of my projects to fit it, per some new requirements we've been handed. One of my major problems was that I needed to reproduce certain behaviors over many pages, a typical base model -> inheritance issue. This was previously accomplished in Typescript by using natural classes and extending them. In researching Angular, I learned that it doesn't really work this way out of the box. So I've sampled many different tutorials, and came across this one in particular which was very insightful, and quite interesting. I have attempted to reproduce it on my own, using some slightly different layout and syntax for the sake of trying to understand it. But I cannot seem to get the behavior to match... the biggest change I made is that I'm not 'chaining' everything together, I instead go the route I learned when I first picked up angular, and declare a variable to add all of the controllers, and factories to, like this; var app = angular.module("MyApp", []); app.controller('...', function($scope, ... ); app.factory('...', function($http, ...); I have gone over my code several times, and checked it, double checked it, triple checked it, but when I run it, it doesn't function. If I copy/paste the exact code in the final jsFiddle, it works fine, so I am 100% certain I am making the mistake somewhere. I am posting my own code here, in hopes that someone can tell me what I am doing wrong - because I am genuinely quite lost now. I am also including a forked jsFiddle of my own code for easy running and comparison. I wish I could list the exact error I am getting, but I'm simply not certain. It is a lot of strange output that actually goes back to the angular.js file, not my own, so I don't know where the error in my own code is. app.js (function() { var app = angular.module('MyApp', []); app.factory('SimpleGithubUser', function($http) { var apiUrl = 'https://api.github.com/'; // instantiate our in…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38875595
upvote count: 1
has comment: http://stackoverflow.com/comment/38871318
type: Question
has comment: http://stackoverflow.com/comment/38874890
has comment: http://stackoverflow.com/comment/38873621
has answer: http://stackoverflow.com/a/25004981
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38876237
has comment: http://stackoverflow.com/comment/38876455
has comment: http://stackoverflow.com/comment/38873818
answer count: 1

http://stackoverflow.com/comment/38829793
score: 1
comment on: http://stackoverflow.com/q/24978250
type: Comment
type: QuestionComment
has text: Try adding `$("#menuappear").stop();` before your animate

http://stackoverflow.com/a/24973338
answers question: http://stackoverflow.com/q/24973308
type: Answer
score: 2
has body: You have a min-height set of 8164px on #sb-site. I just turned it off using developer tools, it got rid of the white gap at the bottom and everything else seemed to work ok? At least for me.
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/38719330
type: AnswerComment
comment on: http://stackoverflow.com/a/24919376
score: 0
type: Comment
has text: I guess I meant to say that I used POSTMAN instead of using the browser address bar. I apologize for the misinformation.

http://stackoverflow.com/q/24909301
type: Question
tagged with: javascript
score: 2
has answer: http://stackoverflow.com/a/24909669
answer count: 1
downvote count: 0
has title: Javascript/jquery autonomous scrolling carousel
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I was wondering how I can make the following autonmously scroll using javascript? the carousol is going to be placed on google sites using the HTML box so I can't just download a jquery plugin which would be the easiest solution! Jquery is included in the script. Any help or advice would be greatly appreciated! here is the code: &lt;style&gt; .carousel { width: 1080px; height: 220px; position: relative; overflow: hidden; background-color:black; border-radius: 20px; -moz-border-radius: 20px; -webkit-border-radius: 20px; margin-bottom: 20px; margin-top: 20px; } .items { width: 1080px; position: absolute; } .items &gt; div { font-size: 20px; display: table-cell; vertical-align: middle; text-align: center; } .items &gt; div &gt; img { width: 340px; height: 202px; padding: 10px; } .nav { position: absolute; bottom: 5px; right: 15px; } .button { cursor: pointer; font-weight: bold; color: #fff; } &lt;/style&gt; &lt;div class="carousel" style="display:none;"&gt; &lt;div class="items"&gt; &lt;div&gt; &lt;img src="http://i58.tinypic.com/2wq5nkk.png" border="0" alt="Speaker at event"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="http://i62.tinypic.com/vfii61.png" border="0" alt="Speaker at event"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="http://i59.tinypic.com/5ttg0z.png" border="0" alt="Speaker at event"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="http://i61.tinypic.com/okpq9g.png" border="0" alt="Speaker at event"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="http://i62.tinypic.com/2h4ywbo.png" border="0" alt="Speaker at event"&gt; &lt;/div&gt; &lt;div&gt; &lt;img src="http://i60.tinypic.com/21oyg4x.png" border="0" alt="Speaker at event"&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="nav"&gt; &lt;span class="button left-button"&gt;prev&lt;/span&gt; &amp;nbsp;&amp;nbsp; &lt;span class="button right-button"&gt;next&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"&gt; &lt;/script&gt; &lt;script&gt; var current_slide = 0…
upvote count: 2

http://stackoverflow.com/comment/38735718
type: AnswerComment
has text: I think the `<=` in your if condition should be `<`.
type: Comment
comment on: http://stackoverflow.com/a/24927892
score: 1

http://stackoverflow.com/q/25049620
possible better answer: http://stackoverflow.com/a/25049650
accepted answer: http://stackoverflow.com/a/25049648
tagged with: javascript
has comment: http://stackoverflow.com/comment/38964077
has comment: http://stackoverflow.com/comment/38964088
tagged with: regex
has answer: http://stackoverflow.com/a/25049648
has body: I have this regular expression to match a valid name: /^['"\s\-.*0-9\u00BF-\u1FFF\u2C00-\uD7FF\w]+$/.test(name) I'm having trouble figuring out how to transform this match style regex into one designed to filter out invalid characters using replace. Ideally I would like to be able to take an invalid name in name, run it through the replace to replace any invalid characters, and then have the original test return true no matter what (as invalid characters will be filtered out).
has comment: http://stackoverflow.com/comment/38964072
type: AnsweredQuestion
has title: Filter characters in this RegEx
has answer: http://stackoverflow.com/a/25049650
type: Question
score: 0
answer count: 2

http://stackoverflow.com/a/24930464
type: AcceptedAnswer
has body: Try using a custom ordering in ng-repeat. Working Demo &lt;div ng-repeat="detail in details | orderBy : sortingOrder : reverse" ng-show="showResults"&gt; {{detail.Lname}} {{detail.age}} {{detail.sex}} {{detail.place}} &lt;/div&gt; script $scope.search = function() { $scope.reverse = ''; $scope.showResults = true; if ($scope.model1.label === 'Age') { $scope.sortingOrder = 'age'; } else if ($scope.model1.label === 'Name') { $scope.sortingOrder = 'Fname'; } else if ($scope.model1.label === 'Country') { $scope.sortingOrder = 'place'; } else if ($scope.model1.label === 'Gender') { console.log($scope.user.sex1); if($scope.user.sex1 === 'male') { $scope.reverse = true; } else if($scope.user.sex1 === 'female') { $scope.reverse = false; } $scope.sortingOrder = 'sex'; } };
upvote count: 3
type: Answer
score: 3
accepted answer of: http://stackoverflow.com/q/24928151
downvote count: 0
answers question: http://stackoverflow.com/q/24928151

http://stackoverflow.com/comment/38884369
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25002999
has text: That is the important part. So essentially your arrays (or rather sets) blow up the BSON limit and you need a way to get unique counts without stashing everything into "sets". Right?
type: Comment

http://stackoverflow.com/a/27170472
has body: Rather than calling PDFJS.getDocument with a URL, first get the binary data via a XMLHttpRequest, and then pass the result to the getDocument call in place of the URL. This will avoid the problem that seems inherent to the PDFJS library when running within a Cordova app. The following code example is taken from the pdfJs example found here: https://bitbucket.org/butelo/pdfviewer/downloads . The issue can be resolved by making the following changes in customview.js Replace this code: /* ---- customview.js ----- */ PDFJS.getDocument(url) .then(function getPdfHelloWorld(_pdfDoc) { pdfDoc = _pdfDoc; renderPage(pageNum); }); With this code: /* ---- customview.js ----- */ function callGetDocment (response) { // body... PDFJS.getDocument(response).then(function getPdfHelloWorld(_pdfDoc) { pdfDoc = _pdfDoc; renderPage(pageNum); }); } function getBinaryData (url) { // body... var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType = 'arraybuffer'; xhr.onload = function(e) { //binary form of ajax response, callGetDocment(e.currentTarget.response); }; xhr.onerror = function () { // body... alert("xhr error"); } xhr.send(); } So that you will call: var url = 'http://nodetuts.com/pdf/handson-nodejs-sample.pdf'; getBinaryData(url); //call this fn on page load Instead of: var url = 'http://nodetuts.com/pdf/handson-nodejs-sample.pdf'; PDFJS.getDocument(url);
upvote count: 6
answers question: http://stackoverflow.com/q/24952810
has comment: http://stackoverflow.com/comment/118230865
downvote count: 0
score: 6
type: Answer

http://stackoverflow.com/a/24958197
has body: Object is your jsonp response data. You can add in your page like this: var listadoListas = ""; $.ajax({ url: 'http://atcsat.es/App/ws/listadoModelos.php?callback=', type: 'GET', dataType: 'jsonp', error : function (){ document.title='error'; }, success: function (data) { $.each(data, function(key, value){ listadoListas += ' ID:'+data[key].ID+' CodFamProducto:'+data[key].CodFamProducto+' Descripcion:'+data[key].Descripcion+' Marca:'+data[key].Marca+' '; }) //alert(listadoListas); $("#listadoListas").html(listadoListas) } });
accepted answer of: http://stackoverflow.com/q/24955076
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24955076
score: 0
type: Answer

http://stackoverflow.com/comment/38813865
score: 0
type: Comment
type: QuestionComment
has text: i need to avoid the duplication in 1st column
comment on: http://stackoverflow.com/q/24970017

http://stackoverflow.com/comment/38939903
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25034078
has text: In HTML, elements containing nothing but normal whitespace characters are considered empty. A paragraph that contains just a normal space character will have zero height.

http://stackoverflow.com/comment/38704511
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24911803
has text: If you mean an class instead of an ID, the syntax is the same. `$(document).on('click', ".callback", function() {`. You need to bind to an element that exists when the page is loaded either way.
score: 0

http://stackoverflow.com/a/24919942
score: 2
answers question: http://stackoverflow.com/q/24919440
accepted answer of: http://stackoverflow.com/q/24919440
downvote count: 0
has comment: http://stackoverflow.com/comment/38720996
type: AcceptedAnswer
has body: exports.onUnload is rather problematic, i.e. there are a lot of bugs and a lot of things where it doesn't work correctly. Avoid it if possible (at least for now). Fortunately, you don't actually need to destroy the button on unload: The SDK will do that automatically for you. The .destroy() instance method is meant for code that needs to destroy a button long before the add-on is unloaded (e.g. a "login" button that gets destroyed once the user logs in). In your particular example, a ToggleButton is the wrong choice. Such a button is meant for things that are basically a checkbox (have two states, e.g. on and off). Instead an ActionButton might be better suited, seeing that a click actually performs a certain action (opens some site in a new tab). Edit: Turns out this is a bug in the SDK, that apparently got fixed already as it is not present. In the current Firefox 31 release it is still present, however, and can be triggered with as little code as: var ui = require("sdk/ui"); var button = ui.ActionButton({ id: "my-button", label: "my button", icon: "./icon-16.png" }); Since it is an SDK bug and does not really impact you while running your add-on, you should just ignore it for now and in future Firefox versions it isn't a problem anymore.
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/38723630

http://stackoverflow.com/a/24991434
has comment: http://stackoverflow.com/comment/38855568
has comment: http://stackoverflow.com/comment/38854245
has comment: http://stackoverflow.com/comment/38855201
downvote count: 0
has comment: http://stackoverflow.com/comment/38854900
type: Answer
has comment: http://stackoverflow.com/comment/38854228
answers question: http://stackoverflow.com/q/24991377
has body: You have to add a \b and a ?: \b[^a-zA-Z\s]*on([a-zA-Z]*?)(\s*?)= Example: http://regex101.com/r/kX7wD1/2
upvote count: 1
score: 1

http://stackoverflow.com/comment/38945640
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25039538
has text: All the the variables. I have declared globally and initialized in other js file
score: 0

http://stackoverflow.com/a/25063885
accepted answer of: http://stackoverflow.com/q/25063468
answers question: http://stackoverflow.com/q/25063468
has body: To answer your question: You do not need the if before the loop. The Definition of a for loop includes an if statement, to determine if the loop should loop on on not. That would be an infnit loop: for (;;;){} this too: for (var i = 0; true; i++) {} in General: for (&lt;initialze&gt;; &lt;if statement&gt;; &lt;js do that each loop if you run&gt;) {/*code*/}
score: 0
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/comment/38710581
type: Comment
comment on: http://stackoverflow.com/q/24914995
type: QuestionComment
score: 0
has text: Thank you for posting a decent question.

http://stackoverflow.com/q/25000207
has comment: http://stackoverflow.com/comment/38892465
answer count: 1
downvote count: 0
tagged with: jsp
tagged with: log4javascript
favorite count: 0
tagged with: ajax
upvote count: 2
has comment: http://stackoverflow.com/comment/38900955
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to use Log4Javascript to send client-side errors to the server where results can then be written to file. I'm using the AjaxAppender to try to send the data to the server. I started with a simple "Hello world" to see if I can figure out how to receive error messages because the documentation literally says "no server-side code is provided". Basically, I'm relatively new to this. A good Java programmer, HTML, CSS, Javascript, etc. But I've recently dived into the world of JSP and I was trying to use that to receive the error messages and (for now) print them to the debug console. I have minimal code in my index.jsp file. Just an h1 tag that says "Hello World" and links to my javascript and jquery. My Javascript is as follows: var url = "logger.jsp"; $(function(){ var log = log4javascript.getDefaultLogger(); var ajaxAppender = new log4javascript.AjaxAppender(url); ajaxAppender.addHeader("Content-Type", "application/json"); log.addAppender(ajaxAppender); window.onerror = function(errorMsg, url, lineNumber){ log.fatal("Uncaught error "+errorMsg+" in "+url+", line "+lineNumber); }; log.info("Hello World"); } And I wasn't sure how the data would be passed to the server so I decided to list all attributes and start there. So far, I have the following as server-side code (logger.jsp): &lt;%@page import="java.util.*"%&gt; &lt;% for (Enumeration e = session.getAttributeNames(); e.hasMoreElements(); ) { String attribName = (String) e.nextElement(); Object attribValue = session.getAttribute(attribName); System.out.println(attribName+" - "+attribValue); } %&gt; Which prints the following to the console: logger - test.Logger@5a5517ef I've done a lot of Google searches but came up with nothing that helps with the server side so far. It's quite possible that I missed something so if anyone has gone through this and has any tips or even a VERY bare-bones example of how to receive messages from the AjaxAppender for Log4JavaScript, I would greatly appreciate it!
score: 2
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25017228
accepted answer: http://stackoverflow.com/a/25017228
tagged with: javascript
has title: Log4JavaScript server-side receiving

http://stackoverflow.com/q/24925450
accepted answer: http://stackoverflow.com/a/27246809
has title: Search JSON data in ember.js
has comment: http://stackoverflow.com/comment/38751869
tagged with: http://stackoverflow.com/tag/json
tagged with: mysql
type: Question
has comment: http://stackoverflow.com/comment/38737229
has body: I am using ember.js for my project where we are fetching mysql data as JSON into the application. App.ContactsRoute=Ember.Route.extend({ model:function(){ return $.getJSON('../getJSON.php?db=db1&table=contact_info',function(contacts){ console.log(contacts); return contacts; }); } }); And in the index.html file inside the contacts template {{#each contacts in model}} {{contacts.contactdata.contact_name}} {{/each}} I want to create a search box where user types the name of the contact and the name is shown from the list Please guide me as I am new to Ember.JS
downvote count: 0
has comment: http://stackoverflow.com/comment/38740204
tagged with: javascript
has comment: http://stackoverflow.com/comment/38740357
has comment: http://stackoverflow.com/comment/38770999
tagged with: ember.js
answer count: 1
favorite count: 0
upvote count: 2
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/27246809

http://stackoverflow.com/comment/38977189
comment on: http://stackoverflow.com/q/25056824
score: 0
has text: `load` doesn't return a jqXHR object. It returns a jQuery collection. Use the callback function `.load('pages/homemenu.php', fn)`.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24992603
score: 0
answers question: http://stackoverflow.com/q/24992450
type: Answer
has body: You could use a "decorator-like". Something as simple as executing var yourFunction = function { // do stuff }; var yourSecondFunction = function { // do stuff }; var myDecorator = function( callback ) { // do your stuff // ... // then execute function callback(); }; // usage myDecorator( yourFunction ); myDecorator( yourSecondFunction ); I don't think overwriting the prototype of Function is a good idea.

http://stackoverflow.com/q/25051759
has title: How to solve Cross-Origin Request Blocked error in firefox
has comment: http://stackoverflow.com/comment/38968043
favorite count: 0
possible better answer: http://stackoverflow.com/a/35433000
has body: &lt;script&gt; $.getJSON('url', function (data) { console.log("Before:"+data); t = data; console.log("After:"+t); }); &lt;/script&gt; When I am using getJson method to get data from REST API , I am getting the error: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at the url. This can be fixed by moving the resource to the same domain or enabling CORS. How do I solve this? Please help.
has comment: http://stackoverflow.com/comment/38967934
has comment: http://stackoverflow.com/comment/38967986
accepted answer: http://stackoverflow.com/a/25051902
has answer: http://stackoverflow.com/a/35433000
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38968042
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38967977
upvote count: 2
score: 0
downvote count: 2
has comment: http://stackoverflow.com/comment/38967991
type: Question
has comment: http://stackoverflow.com/comment/38968137
has comment: http://stackoverflow.com/comment/38968025
tagged with: javascript
has answer: http://stackoverflow.com/a/25051902
tagged with: jquery
answer count: 2

http://stackoverflow.com/comment/38774401
has text: The value of the select is saved by PHP also (if...selected="selected"). I need to call its' onchange function onload also to load the rest of the content.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24947485

http://stackoverflow.com/comment/38904714
has text: and what do you think is preventing the "thanks for logging in..." message from being shown
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25017588

http://stackoverflow.com/comment/38849505
type: AnswerComment
comment on: http://stackoverflow.com/a/24988713
type: Comment
score: 3
has text: @Derek朕會功夫 Not sure we should be concerned about "efficiency" unless it's either explicitly stated or it is obvious that OP is going to operate on large strings.

http://stackoverflow.com/comment/38748623
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24935213
has text: @Youness No, I'm using the $.ajax method
score: 0

http://stackoverflow.com/q/25051124
tagged with: javascript
tagged with: drop-down-menu
tagged with: jquery
has answer: http://stackoverflow.com/a/25051153
has comment: http://stackoverflow.com/comment/38966758
accepted answer: http://stackoverflow.com/a/25051153
type: AnsweredQuestion
has body: i am creating a javascript function which when clicked will create two drop downs and one text box and will append the html to the container div but the problem is that, somehow it can't append the oprions to the two drop downs. Here's my script var i = 0; function add_relation() { i = i + 1; var condition = $(' ', { 'class' : 'relation-select', 'id' : 'condition_' + i, 'name' : 'condition[]' }); var key = $(' ', { 'class' : 'relation-select', 'id' : 'key_' + i, 'name' : 'key[]' }); $("#key_"+i).append(' Select Key ' + ' Title ' + ' Type ' + ' Price ' + ' Weight '); $("#condition_"+i).append(' Select Condition '+ ' Is Equal To '+ ' Is Greater Than '+ ' Is Less Than '+ ' Starts With '+ ' Ends With '+ ' Contains '); var left = $(' ', {'class' : 'relation-left','id' : 'relation_' + i}) .append(condition) .append(key) .append($(' ', { 'class' : 'relation-input', 'id' : 'constraint_' + i, 'type' : 'text', 'name' : 'constraint[]', 'data-provide' : 'typeahead', 'data-items' : '2' })); var right = $(' ', {'class' : 'relation-right', html : $('<buton />', { 'class' : 'btn', 'name' : 'btn[]', 'value': 'X'}) }); var parent = $(' ', {'class' : 'relation-parent_' + i}) .append(left) .append(right); $("#relation_container").append(parent); }
has title: Cant Append options to a select dropdown dynamically
type: Question
score: 0
answer count: 1

http://stackoverflow.com/comment/38824916
has text: Wow hahaha. Thanks man. The simplest things in coding are the most annoying issues to find. Thanks again!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24975915
type: Comment

http://stackoverflow.com/comment/38848398
type: Comment
type: QuestionComment
has text: What are you trying to achieve by that?
score: 5
comment on: http://stackoverflow.com/q/24988203

http://stackoverflow.com/a/24933626
type: Answer
has comment: http://stackoverflow.com/comment/38769654
has comment: http://stackoverflow.com/comment/38746329
has comment: http://stackoverflow.com/comment/38769485
has comment: http://stackoverflow.com/comment/38770496
score: 0
has comment: http://stackoverflow.com/comment/38768809
answers question: http://stackoverflow.com/q/24931867
has comment: http://stackoverflow.com/comment/38769795
has body: I just tried your code in a working JSBin here http://jsbin.com/catubuwa/1/edit?html,js,output on Windows 8.1 using Chrome and it seems to work just fine as you expect when printing to a .pdf file. However, I seem to notice that there might be a race condition and load timing issue. Maybe in your case the page is loading and being prepped for print before the page or image has loaded fully? If that is what's happening I've added a basic .ready() for your myWindow to then print:. But if you notice I've taken out the close. This also seems to help as well. The reason being is that the print function is actually being called on this window and therefor is the print dialog. This will vary based on browser but the close also seemed to have an impact on the printing as well. jQuery('#print').on("click", function(){ var mywindow = window.open('', 'my div', 'height=400,width=600'); mywindow.document.write(' Title '); mywindow.document.write(' '); mywindow.document.write(' '); mywindow.document.write(' '); $(mywindow).ready(function() { // Call Later In Stack - really should be onload events or base64 images inline setTimeout( function(){ mywindow.print(); },(1000)); }); }); Maybe staging the process might help ensure that everything is ready to be printed when the new window is opened and constructed. Working Copy: http://jsbin.com/catubuwa/1/edit?html,js,output References: Using JQuery to open a popup window and print Jquery: how to check if a newly opened window has been fully loaded? / window loads an external page (like www.yahoo.com)
has comment: http://stackoverflow.com/comment/38769808
has comment: http://stackoverflow.com/comment/38769415
has comment: http://stackoverflow.com/comment/38769523

http://stackoverflow.com/comment/38863745
type: QuestionComment
has text: @spatik measured is a strong word, it's an implementation not an effect. But your right, contextually it is asynchronous relative to the JS runtime. The work is done by a background thread of the browser, parallel, yet linked to the JS thread(remember JS is single threaded/call-stack based). Claudix 's answer is very good, despite his er... creative analogy!
comment on: http://stackoverflow.com/q/24993989
score: 0
type: Comment

http://stackoverflow.com/comment/38766836
has text: Thank you, I'm going to create an issue to get this documented.
comment on: http://stackoverflow.com/a/24944154
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/24997342
score: 0
has body: This should work, please check old IE browsers, i think it should work there as well http://jsfiddle.net/9t3Xq/ arr.sort(function(a, b) { var valueA, valueB; var dates1 = a.date.split(" "); var dates2 = b.date.split(" "); var dates1YMD = dates1[0].split("/"); var dates2YMD = dates2[0].split("/"); var dates1HIS = dates1[1].split(":"); var dates2HIS = dates2[1].split(":"); valueA = new Date(dates1YMD[2], dates1YMD[1], dates1YMD[0], dates1HIS[0], dates1HIS[1]); valueB = new Date(dates2YMD[2], dates2YMD[1], dates2YMD[0], dates2HIS[0], dates2HIS[1]); return valueB - valueA; });
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24996205
type: Answer
accepted answer of: http://stackoverflow.com/q/24996205
has comment: http://stackoverflow.com/comment/38865326

http://stackoverflow.com/q/25003484
has comment: http://stackoverflow.com/comment/38877813
has comment: http://stackoverflow.com/comment/38901175
has comment: http://stackoverflow.com/comment/38877908
linked to: http://stackoverflow.com/q/19068365
upvote count: 1
has body: I am trying to store a JSON file in a folder in my .NET project (/Content/events/events.json) and then pull it into an AJAX call, I keep trying to put this information in for the field events: for the add-on Fullcalendar. My attempt $('#calendar').fullCalendar({ header: { left: 'prev,next today', center: 'title', right: 'month' }, defaultDate: 'new Date()', editable: true, events: { url: '/Content/events/events.json', type: 'GET', dataType: 'json', data: { }, error: function () { alert('there was an error while fetching events!'); } }, eventRender: function (event, element) { //other code stuff } }); Each time I try a new attempt, I just receive a GET 404 error. Right now I am testing this via localhost debugging is VS, but this will be put online once I get it working. How can I set a AJAX call to get this JSON file for the events: parameter? Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:56087/Content/events/document.json?start=1404014400&amp;end=1407643200&amp;_=1406577499130 Fullcalendar Site I have already tried their github method, but I cannot seem to get that to work either, thus why I am trying to pull this information from a local/server file. I can hardcode the events as such, ... events: [ { title: 'Bi-weekly Meeting', start: '2014-07-09', color: 'red' } ], ... But this means I have to open the application source code to modify any event changes. What I want is to be able to modify this JSON file outside of the application so that me, or other users may modify the events.
type: Question
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
tagged with: fullcalendar
has title: Pull JSON file from .NET folder with AJAX / Fullcalender events JSON
has answer: http://stackoverflow.com/a/25004084
accepted answer: http://stackoverflow.com/a/25004084
has comment: http://stackoverflow.com/comment/38876877
has comment: http://stackoverflow.com/comment/38883279
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38877937
favorite count: 0
tagged with: ajax

http://stackoverflow.com/a/24951289
upvote count: 2
has body: If you want to use regex, here you have an example; var myStrippedStr = myString.replace(/(.*){{(.*)}}(.*)/, '$1$2$3');
answers question: http://stackoverflow.com/q/24951137
downvote count: 0
type: Answer
score: 2

http://stackoverflow.com/comment/38733725
type: Comment
score: 1
has text: @Jai: yup. the idea was him being using wrong id selector. Thanks :)
type: AnswerComment
comment on: http://stackoverflow.com/a/24927323

http://stackoverflow.com/q/25034680
has answer: http://stackoverflow.com/a/25034726
possible better answer: http://stackoverflow.com/a/25034726
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25034730
type: Question
answer count: 3
has title: Replace function does only replace every second regex match
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25034982
has body: I would like to use regex in javascript to put a zero before every number that has exactly one digit. When i debug the code in the chrome debugger it gives me a strange result where only every second match the zero is put. My regex "3-3-7-3-9-8-10-5".replace(/(\-|^)(\d)(\-|$)/g, "$10$2$3"); And the result i get from this "03-3-07-3-09-8-10-05" Thanks for the help
tagged with: regex
accepted answer: http://stackoverflow.com/a/25034730

http://stackoverflow.com/comment/38714479
type: Comment
has text: Aha...so i think the issue must be somewhere else in the rest of the code.
comment on: http://stackoverflow.com/a/24915714
type: AnswerComment
score: 0

http://stackoverflow.com/q/25021236
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/25021361
has answer: http://stackoverflow.com/a/25021361
has answer: http://stackoverflow.com/a/25021412
has body: I have a select and an input that I would like the values to be returned by javascript anytime it is modified. For example if I have a select with option "Yes" and "No", if the person selects "No" then I want that value to be returned in Javascript so I can make an action for it. No Yes For now I'd just like the value be alerted in javascript. Same thing with an input. Thanks!
has comment: http://stackoverflow.com/comment/38910692
has title: input and select values returned on change by javascript
has comment: http://stackoverflow.com/comment/38910518
accepted answer: http://stackoverflow.com/a/25021426
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38910893
has comment: http://stackoverflow.com/comment/39102971
has answer: http://stackoverflow.com/a/25021426
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25059078
has answer: http://stackoverflow.com/a/25059780
accepted answer: http://stackoverflow.com/a/25059780
has title: Chipping the ends of rectangle to make them spear-like
tagged with: javascript
has comment: http://stackoverflow.com/comment/38982195
score: 0
answer count: 1
tagged with: d3.js
has body: I would like to chip/modify the ends of a rectangle element using d3.js so that they look like spears (imagine one of its end look like a triangle). Currently, I am achieving this effect by appending a triangle-up symbol rotated suitably, and appended to the end of rectangle. I searched for other solutions but failed to find one. How do I go about solving this problem?
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/svg
type: Question

http://stackoverflow.com/comment/38794809
has text: Wow, A for effort, I really appreciate it! That last one does seem to solve the issue, thank you!
comment on: http://stackoverflow.com/a/24959859
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24979881
score: 0
accepted answer of: http://stackoverflow.com/q/24979763
has comment: http://stackoverflow.com/comment/38832462
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/24979763
has body: The functional solution is a fold: function distribute(people, amount) { return _.foldl(_.sortBy(people, 'score'), function(result, person) { var ration = Math.min(person.demand, result.remaining); var resultPerson = _.assign(person, { ration: ration }); return { people: result.people.concat(resultPerson), remaining: result.remaining - ration }; }, { people: [], remaining: amount }).people; }
has comment: http://stackoverflow.com/comment/38832727
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38839605
type: Answer
has comment: http://stackoverflow.com/comment/38832429

http://stackoverflow.com/comment/38977755
comment on: http://stackoverflow.com/a/25056537
type: AnswerComment
score: 0
type: Comment
has text: @chiapa It's working perfectly fine for me also in serverside filtering.

http://stackoverflow.com/comment/38762841
has text: It depends on a `.col-md-4`'s height. If it is possible for you to give all of them a fixed height (like `height: 400px)`, it will work. (Be sure not to use it globally on all `.col-md-4`s, but give the parent row a special class and select the children with `.search-grid .col-md-4`.)
type: AnswerComment
comment on: http://stackoverflow.com/a/24942031
type: Comment
score: 1

http://stackoverflow.com/q/25042697
has body: I am including tooltip.js and popover.js. When my markup looks like so: PDS with JS $('.popover-dismiss').popover({ trigger: 'focus', html: 'true' }) Then everything works fine. However, when I change my button to an a, it breaks. There are no errors in the console. It just simply does not give the popup. PDS The exact same attributes. Just an anchor instead of a button. I have also tried using a span and that does not appear to work either.
has answer: http://stackoverflow.com/a/25367910
accepted answer: http://stackoverflow.com/a/25367910
has comment: http://stackoverflow.com/comment/38952601
has comment: http://stackoverflow.com/comment/38950794
score: 34
has title: Bootstrap's popover only working on buttons - not anchors or spans
upvote count: 34
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38950926
has comment: http://stackoverflow.com/comment/39556514
type: Question
possible better answer: http://stackoverflow.com/a/30286400
has comment: http://stackoverflow.com/comment/38952699
has comment: http://stackoverflow.com/comment/38952655
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38951426
favorite count: 0
tagged with: popover
has comment: http://stackoverflow.com/comment/39239565
has answer: http://stackoverflow.com/a/25042789
answer count: 4
has answer: http://stackoverflow.com/a/35577357
has answer: http://stackoverflow.com/a/30286400
tagged with: twitter-bootstrap

http://stackoverflow.com/q/25055449
has comment: http://stackoverflow.com/comment/39156596
downvote count: 0
has comment: http://stackoverflow.com/comment/38974870
favorite count: 0
has body: i have a textarea in a form where the user can enter their commands. I am retrieving this command in my java class. Map&lt;String, String[]&gt; params = ActionContext.getParameters(); for(String key: params.keySet()){ value = params.get(key); } val = value[0]; After every sumbit the form gets refresh. I need to display back to the user all the previously entered commands. But i am unable to append the values. after every submit the value of val also is getting refreshed. i am using Stringbuffer to append these values. how could i do this using javascript?
type: UnansweredQuestion
has title: Append previous from values in java class using StringBuffer
answer count: 0
score: 1
tagged with: java
upvote count: 1
linked to: http://stackoverflow.com/q/1320876
type: Question
has comment: http://stackoverflow.com/comment/39009648
has comment: http://stackoverflow.com/comment/39156516
has comment: http://stackoverflow.com/comment/38976456
tagged with: stringbuffer
has comment: http://stackoverflow.com/comment/38976617
tagged with: javascript
linked to: http://stackoverflow.com/q/20059712

http://stackoverflow.com/q/24996127
accepted answer: http://stackoverflow.com/a/24997240
type: Question
upvote count: 2
answer count: 2
tagged with: google-visualization
has answer: http://stackoverflow.com/a/24997240
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24996309
has answer: http://stackoverflow.com/a/24996309
has body: I am trying to work with google charts for the first time. My Json is as below {\"cols\":[{\"id\":\"Date\",\"label\":\"Date\",\"type\":\"date\"},{\"id\":\"KeywordCount\",\"label\":\"count\",\"type\":\"number\"}],\"rows\":[{\"c\": [{\"v\":\"new Date(2014725)\",\"f\":\"25 July 2014\"},{\"v\":\"77\",\"f\":\"77\"}]},{\"c\": [{\"v\":\"new Date(2014724)\",\"f\":\"24 July 2014\"},{\"v\":\"101\",\"f\":\"101\"}]},{\"c\": [{\"v\":\"new Date(2014723)\",\"f\":\"23 July 2014\"},{\"v\":\"100\",\"f\":\"100\"}]},{\"c\": [{\"v\":\"new Date(2014722)\",\"f\":\"22 July 2014\"}, {\"v\":\"130\",\"f\":\"130\"}]}],\"p\":null} This looks good for me, I am not able to figured it out what i am missing because i can only see an error in the chart ("undefined is not a function") . My javascript file for Google charts are google.load('visualization', '1', { 'packages': ['corechart'] }); var postDate = $('#ReportingWall').serialize(); function drawChartAll() { var jsonData = $.ajax({ url: '/ReportingWall/analyseStats/', type: 'POST', data: postDate, dataType: 'json', async: false, success: function (response) { } }).responseText; var data = new google.visualization.DataTable(jsonData); console.debug(jsonData); console.debug(data); var chart = new google.visualization.LineChart(document.getElementById('charts_all')); chart.draw(data, options); var columns = []; var series = {}; for (var i = 0; i &lt; data.getNumberOfColumns() ; i++) { columns.push(i); if (i &gt; 0) { series[i - 1] = {}; } } var options = { title: 'Keywords:', width: 908, legend: { position: 'right' }, legendFontSize: 14, chartArea: { left: 50, width: '80%' }, series: series } google.visualization.events.addListener(chart, 'select', function () { var sel = chart.getSelection(); // if selection length is 0, we deselected an element if (sel.length &gt; 0) { // if row is undefined, we clicked on the legend if (sel[0].row === null) { var col = sel[0].column; if (columns[col] == col) { // hide the data series columns[col] = { label: dat…
favorite count: 0
has title: Google Chart From Json "undefined is not a function"
score: 2
type: AnsweredQuestion
downvote count: 0
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/25055431
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25064245
upvote count: 1
tagged with: dom
type: Question
tagged with: javascript
has title: Create multiple selection at the same time when using document.selection in Javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/25064245
tagged with: web
tagged with: jquery
favorite count: 0
has body: I've known how to use the document.selection to do the highlighting. For example /* http://jsfiddle.net/4J2dy/ */ $("#content").on('mouseup', function() { highlighting(); }); var highlighting = function () { var seleted_str = (document.all) ? document.selection.createRange().text : document.getSelection(); if(seleted_str != "") { var stringToBeHighlighted = seleted_str.getRangeAt(0); var span = document.createElement("span"); span.style.cssText = "background-color: #80deea"; span.className = "MT"; stringToBeHighlighted.surroundContents(span); } }; But there is something I don't know how to achieve. Let's say that I have four layers created with the same content at the same time. And I would like to select a sentence on the controlling layer while all the same sentence in the other three layers will be selected too.(See image below) After the selection, I would like to pop out a menu(which I can do), and get the DOM element based on which button is pressed.(See image below) Could anyone tell me how to achieve this? Or it just can't be done? I would be grateful if someone could answer for me.
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38860985
has text: Yes sushil, I need that part..
comment on: http://stackoverflow.com/q/24995086
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25010971
type: UnansweredQuestion
has body: Here is my code for click on image datetimepicker will open..whenever am click on c.png (calender image ) my datepicker is not open Please Select Date this is my script code.....
type: Question
has answer: http://stackoverflow.com/a/25011091
tagged with: javascript
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38890993
has title: Show Datetime picker on click on image

http://stackoverflow.com/comment/38980402
score: 1
has text: ID atributes have to be unique, meaning you are not allowed to use the same ID for more elements. You should use a class instead
comment on: http://stackoverflow.com/q/25058451
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24932343
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38742704
has answer: http://stackoverflow.com/a/59628321
type: Question
accepted answer: http://stackoverflow.com/a/24933702
has comment: http://stackoverflow.com/comment/38743077
has comment: http://stackoverflow.com/comment/38743400
has title: Converting date format from mm/dd/yyyy to yyyy-mm-dd format after entered
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/71371208
score: 0
has answer: http://stackoverflow.com/a/44772337
possible better answer: http://stackoverflow.com/a/24932410
answer count: 4
has answer: http://stackoverflow.com/a/24932410
upvote count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/24933702
has body: In my datepicker the date will be inserted in mm/dd/yyyy format. But after I inserted I want it to be sent in yyyy-mm-dd format. I am using JavaScript to do this. But I wasn't able to do that. So what should I do? Thanks &amp; regards, Chiranthaka
linked to: http://stackoverflow.com/q/1328025

http://stackoverflow.com/comment/38844518
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24986178
has text: @Sid I load JSON data into a JS variable and I want to generate a table right there from JS
score: 0

http://stackoverflow.com/comment/39010601
has text: You're right, but it is not good to use both alias and xtype simultaneously. It makes no sense. Also your code is easier to read if you use xtype exclusively for **referencing** a component and alias to **define** the xtype.
type: Comment
comment on: http://stackoverflow.com/a/25048377
type: AnswerComment
score: 0

http://stackoverflow.com/q/25031758
tagged with: javascript
has answer: http://stackoverflow.com/a/25031866
score: 0
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25031870
has body: I have a javascript array that has subarrays, these subarrays have two values, a year and a number var abc = [["2012", "399"], ["2012", "114"], ["2012", "151"], ["2013", "116"], ["2013", "145"], ["2013", "280"], ["2013", "84"], ["2014", "5"], ["2014", "228"], ["2014", "156"], ["2014", "43"], ["2014", "27"]]; I want to have the total sum of the second value for each year. So for my example array I would want the following output: Year: 2012 Sum: 664 Year: 2013 Sum: 625 Year: 2014 Sum: 459 I'm pretty much stuck at checking for the first value and adding these in to an array. FIND FIDDLE HERE Any suggestions on comparing the first value in my array?
has title: How do I merge array items when they have corresponding array values?
answer count: 5
has answer: http://stackoverflow.com/a/25031868
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25031984
accepted answer: http://stackoverflow.com/a/25031984
has comment: http://stackoverflow.com/comment/38930081
has answer: http://stackoverflow.com/a/25031884
has answer: http://stackoverflow.com/a/25031870
type: Question
tagged with: arrays

http://stackoverflow.com/q/24955467
has title: Issue with jquery animate with multiple divs (same class)
accepted answer: http://stackoverflow.com/a/24955573
tagged with: click
has answer: http://stackoverflow.com/a/24955885
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38786605
possible better answer: http://stackoverflow.com/a/24955602
type: Question
has answer: http://stackoverflow.com/a/24955602
type: AnsweredQuestion
has body: I'm running an online-store and would like to spice up the product-listing a little bit. All I'm trying to do is to increase the height of a div when a user clicks on some text in that div. My problem is that the div class exists several times on my site (for each product). So when I click, all the divs are increasing instead only the one I intend to. Please let me know if this lacks in details or if further/better explanation is required. Here's my code. Thanks a lot for looking into it. Daniel {foreach name=aussen item=module_data from=$product_listing} Read more {/foreach}
has answer: http://stackoverflow.com/a/24955573
tagged with: jquery-animate
answer count: 3
tagged with: javascript

http://stackoverflow.com/q/24962612
has comment: http://stackoverflow.com/comment/38800415
answer count: 2
has title: get asp:Label ToolTip using javascript
tagged with: tooltip
tagged with: javascript
tagged with: asp.net
score: 0
has answer: http://stackoverflow.com/a/24962899
has body: I have a simple problem with javascript and tooltip! I have a label in my page and I want to get it's tooltip using javascript. My label definition is as follows: &lt;script type="text/javascript"&gt; var label = document.getElementById('&lt;%=lblTest.ClientID %&gt;'); //alert(lable's tooltip) &lt;/script&gt; &lt;asp:Label ID="lblTest" ToolTip="Test ToolTip" Text="Test Text" runat="server" /&gt;
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24962897
accepted answer: http://stackoverflow.com/a/24962897
possible better answer: http://stackoverflow.com/a/24962899

http://stackoverflow.com/comment/38942102
type: Comment
type: QuestionComment
has text: Yeah we will need some more code in order to help you.
comment on: http://stackoverflow.com/q/25038193
score: 0

http://stackoverflow.com/comment/38729226
type: Comment
type: QuestionComment
has text: Any reason you want to scroll within the Body itself rather than let the Browser scroll for you? I'm referring to your CSS on html and body of overflow: auto;
comment on: http://stackoverflow.com/q/24924867
score: 0

http://stackoverflow.com/a/24934990
type: Answer
has comment: http://stackoverflow.com/comment/38748000
has comment: http://stackoverflow.com/comment/38751122
upvote count: 1
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/24919110
has body: Thanks everyone for your help, I just created a new file and copied in my functions one at a time and tested each time. It seems to be working now, not sure what happened in the old file.

http://stackoverflow.com/comment/38940319
has text: I tried what you suggested but still the selectlist is not disabled when there is a selected value
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25037345
type: AnswerComment

http://stackoverflow.com/comment/38974757
has text: you, sir, just completely blew my mind. I have never ever thought of doing that!
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25055245

http://stackoverflow.com/q/24970778
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has title: JQUERY add error class dynamically
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24970842
tagged with: drupal
downvote count: 1
type: Question
has body: when the textbox is empty need to add the " error " in the class attribute. I have the below code, but this code does not showup after form submitted. please guide me. Untitled Document some more input, i added return false after " addClass " function. i submitted the form. form is just halted and i noticed in the firebug, class " error " is added. but if i removed the " return false ", page get load / refreshed, what ever we added in jquery those are removed from the class. now please advise. how add certain class dynamically based on the condition after form submitted.

http://stackoverflow.com/a/25009228
upvote count: 2
answers question: http://stackoverflow.com/q/25009212
downvote count: 0
type: Answer
has body: Try to use :selected selector to grab the selected option elements, $('#week option:selected').each(function(){ //Your code to manipulate things over selected option elements });
score: 2

http://stackoverflow.com/comment/38837878
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24982741
type: Comment
has text: FYI, you can just do `callback()`. You don't need `callback.call()`.

http://stackoverflow.com/comment/38996546
comment on: http://stackoverflow.com/q/25066717
score: 0
has text: @return_of_the_drunken_coder Filter icon which is right next to clear console icon.
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38887654
type: QuestionComment
comment on: http://stackoverflow.com/q/25009241
has text: what code got you closest to the solution, and can you include it here (so we don't have to write it from scratch) ? :)
score: 0
type: Comment

http://stackoverflow.com/q/24995074
has comment: http://stackoverflow.com/comment/38860947
has comment: http://stackoverflow.com/comment/38860836
type: UnansweredQuestion
has title: checkboxes not working after ajax call php
tagged with: php
tagged with: checkbox
has answer: http://stackoverflow.com/a/24995286
has comment: http://stackoverflow.com/comment/38861059
has body: I have some checkboxes in my web page ,on which i m implementing ajax call,with which i m updating the content in a div and i m refreshing the count of listed items in checkboxes like an ecommerce site filters on sides.But after first checking checkbox first time.ajax call works.But when i check my checkbox again for next time.ajax request is not performed. Please check the following code &lt;input type="checkbox" name="item1" id="item1" value="item1"&gt;item1[5]&lt;br /&gt; &lt;input type="checkbox" name="item1" id="item2" value="item2"&gt;item1[3]&lt;br /&gt; &lt;input type="checkbox" name="item1" id="item3" value="item3"&gt;item1[6]&lt;br /&gt; &lt;input type="checkbox" name="item1" id="item4" value="item4"&gt;item1[3]&lt;br /&gt; ajax call $(document).ready(function(){ checkboxValidate = function (e) { if(e)e.preventDefault(); $.ajax({ type: 'get', async:false, cache:false, url: 'getmoredata.php', data: {data1:data1}, success: function(data){ $(data).appendTo('.container'); console.log(data); }, error: function(data){ alert("ajax error occured…"+data); }, timeout:5000 }).done(function(){ //alert(timeout); $("#loading").fadeOut("slow"); $(window).bind("scroll",function(){ scrollMore(); }); }); } } &lt;div id="container"&gt; &lt;div id="div1"&gt; &lt;/div&gt; &lt;/div&gt; $( "[type=checkbox]" ).change(checkboxValidate); After ajax call the content which i m refreshing i m executing sql query in getmoredata.php,with which i m getting refreshed checkbox values and their count. $sql=select DISTINCT colname from tablename where colname='value coming from ajax call' group by colname $sql=select count(colname) from tablename where colname='value from ajax call' group by colname. Then i put the values from first query in an array.second query giving us count so that count i m displaying with each checkbox which is dynamic then with foreach loop i m refreshing the checkbox contents listed aboved &lt;?php foreach($arrayquery as $array) { ?&gt; &lt;input type="checkbox" val…
has comment: http://stackoverflow.com/comment/38860805
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/24995279
type: Question
has comment: http://stackoverflow.com/comment/38860822
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 2
has comment: http://stackoverflow.com/comment/38860930
has comment: http://stackoverflow.com/comment/38860766
has comment: http://stackoverflow.com/comment/38861069
has comment: http://stackoverflow.com/comment/38860825
downvote count: 0
favorite count: 0

http://stackoverflow.com/a/25046363
score: 4
accepted answer of: http://stackoverflow.com/q/25046271
has body: The number you're logging is larger than the largest integer that can be represented in Javascript (9007199254740992). As a result you get rounding errors resulting from the floating point treatment.
type: Answer
answers question: http://stackoverflow.com/q/25046271
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/25042419
score: 0
has body: Making sure an external js file has been loaded across browsers requires more than a simple onload event; If you want a well-tested solution with added features, your best bet is using a library such as require.js. Your code, after you include the require.js file somewhere, will look something like: function functionA () { alert("A runs!"); } function functionB () { alert("B runs!"); require(['yourotherfile'], function(myfile) { // no js extension, read more in require's docs // --some additional code-- }); }
has comment: http://stackoverflow.com/comment/38950552
type: Answer
has comment: http://stackoverflow.com/comment/38951275
answers question: http://stackoverflow.com/q/25042211

http://stackoverflow.com/q/25005543
tagged with: coffeescript
has body: Hello I have this line right now with an if else statement and I'm trying to convert it to if else if else statement. This is coffescript _index = if $product.find('.dot.active').index() then 0 else 1 Any help will be appreciated.
type: Question
has comment: http://stackoverflow.com/comment/38880834
possible better answer: http://stackoverflow.com/a/25005562
tagged with: javascript
has comment: http://stackoverflow.com/comment/38884396
has answer: http://stackoverflow.com/a/25005562
has answer: http://stackoverflow.com/a/25028102
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/25005574
has title: I'm trying to write a three conditional statement
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25005574

http://stackoverflow.com/comment/38951702
comment on: http://stackoverflow.com/a/25042659
score: 0
type: AnswerComment
has text: The stratus.js scripts sends the theme url to `http://stratus.sc/player` and thus if you give the theme a relative path it will be relative to `http://stratus.sc` and thus not find your local css/stratus.css. So to use your own css file it seems that you have bring it online so you can fetch it. If you can't setup a local server you should maybe look for someplace to host it.
type: Comment

http://stackoverflow.com/comment/38731215
has text: Thanks for the reply. made the change, but it did not fix it, still same path loads.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24925778
type: QuestionComment

http://stackoverflow.com/a/24913349
accepted answer of: http://stackoverflow.com/q/24913272
answers question: http://stackoverflow.com/q/24913272
downvote count: 1
score: 1
has body: You should create you arrayNumbers outside the for loop, or it will be disposed and overriden in each loop. &lt;script src="jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function () { var counter; var arrayNumbers = []; for (counter = 0; counter &lt; 1001; counter++) { if (counter % 3 == 0 || counter % 5 == 0) { arrayNumbers.push(counter); } } var total = 0; $.each(arrayNumbers, function () { total += this; }); console.log(total); }); &lt;/script&gt; I did not want to mess up your algorithm, but I recommend you to use a counter variable for this exercise. You should increment the counter by each multiple you find, and the final value of the counter would be the sum of all the multiples &lt;script src="jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function () { var counter = 0; var number; for (number = 0; number &lt; 1001; number++) { if (number % 3 == 0 || number % 5 == 0) { counter += number; } } console.log(counter); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38707234
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38707270
type: Answer
upvote count: 2

http://stackoverflow.com/a/24969030
answers question: http://stackoverflow.com/q/24969006
downvote count: 0
has comment: http://stackoverflow.com/comment/38812020
score: 1
accepted answer of: http://stackoverflow.com/q/24969006
has comment: http://stackoverflow.com/comment/38812105
has comment: http://stackoverflow.com/comment/38812024
has comment: http://stackoverflow.com/comment/38812037
has comment: http://stackoverflow.com/comment/38812070
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38812137
has body: You can make localstorage in javascript as : $(document).ready(function(){ $("ul[id*=licity] li").click(function(){ localStorage.setItem('livalue',$(this).text()); }); }); if u want to use session storage then : $(document).ready(function(){ $("ul[id*=licity] li").click(function(){ sessionStorage.setItem("livalue", $(this).text()); }); }); For more details on sessionstorage : https://code.google.com/p/sessionstorage/ localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended "non-persistence" of sessionStorage,localstorage is better because When the window or tab is permanently closed, any data stored through sessionStorage is deleted.
type: Answer
has comment: http://stackoverflow.com/comment/38812068

http://stackoverflow.com/q/25011632
answer count: 0
has title: How to integrate curl.js with server-side jinja2 templating
score: 1
has comment: http://stackoverflow.com/comment/38901669
has comment: http://stackoverflow.com/comment/38907740
upvote count: 1
tagged with: jinja2
type: Question
tagged with: javascript
tagged with: flask
has body: I have a Python-based Flask web application that uses Jinja2 to perform templating on the server-side. I would like to improve my Javascript and CSS loading by using curl.js to load JS and CSS asynchronously. Is there a specific, well-defined method for doing this?
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38901755
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38900938
tagged with: curl.js
tagged with: python
has comment: http://stackoverflow.com/comment/38906635
has comment: http://stackoverflow.com/comment/38902457

http://stackoverflow.com/q/25016259
score: 0
has title: Is it possible to execute a javascript in a new window with window.location.href?
has answer: http://stackoverflow.com/a/25016875
type: UnansweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25016358
answer count: 2
tagged with: window.location
has body: I am trying to open a new window and execute a javascript code on the new page. I'm not really sure why it doesn't execute the code - maybe it's not possible like this - anyway, the new window opens but the javascript doesn't get executed. Here is my code: var nstart = window.open("http://examplepage.html"); function loginnow(){ var htmlstring = "javascript: var zTextFields = window.document.getElementsByTagName(\"input\"); for (var i=0; i &lt; zTextFields.length; i++) {thefield=zTextFields[i].name; if (!thefield) thefield=zTextFields[i].id; if (thefield == \"login\") zTextFields[i].value=\"_ext_cancom\"; if (thefield == \"password\")zTextFields[i].value=\"canfinag?!\";} window.document.getElementById(\"sign-in\").click();"; nstart.location.href = htmlstring; } nstart.addEventListener('load', loginnow, true); Is it even possible to execute code like this? Please help ^-^ I'm also using '\' as an escape character so I can use " in the string -> \" When I replace the \" with " and directly inject it into the page the script works fine...
tagged with: javascript

http://stackoverflow.com/comment/38906486
type: QuestionComment
has text: You can have only one big image and change its source based on the clicked thumbnail.
comment on: http://stackoverflow.com/q/25018812
score: 0
type: Comment

http://stackoverflow.com/q/24923642
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38739397
has comment: http://stackoverflow.com/comment/38739319
answer count: 0
score: 0
type: Question
has body: I have the following markup: {{ schedule.name }} (Open to View) I want to toggle the content by clicking the "title" (see below for the open/close state snapshot). Right now, as you can see, I call a function toggleHeader() in my controller, and all it does is: $scope.toggleHeader = function() { $scope.isScheduleVisible = ! $scope.isScheduleVisible; } I want to replace it with ng-click="isScheduleVisible = !isScheduleVisible". However, this does not work. This will only toggle the header (the grey banner) and not the actual content (the schedule). Why?!
tagged with: javascript
has title: AngularJS toggling header works only if changed in directive
has comment: http://stackoverflow.com/comment/38734988
has comment: http://stackoverflow.com/comment/38731373
tagged with: angularjs

http://stackoverflow.com/q/24940575
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38758933
has answer: http://stackoverflow.com/a/24946728
has answer: http://stackoverflow.com/a/24940678
has comment: http://stackoverflow.com/comment/38766156
has body: I'm trying to understand traversal in JQuery. I have this snippet in Javascript which extracts document.forms[0].elements[0] . Could someone explain to me how to get the JQuery equivalent of this?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38758890
score: 0
has comment: http://stackoverflow.com/comment/38770470
has title: JQuery traversal given Javascript snippet
type: Question
has comment: http://stackoverflow.com/comment/38765781

http://stackoverflow.com/q/24969349
has title: Correctly format the jQuery .load function when using a response first
has answer: http://stackoverflow.com/a/24969390
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24969390
accepted answer: http://stackoverflow.com/a/24969408
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: response
score: 0
has comment: http://stackoverflow.com/comment/38812617
has comment: http://stackoverflow.com/comment/38812643
tagged with: ajax
has body: I can't figure out how to correctly format the .load function with what I'm doing. Everything works fine if I provide the URL but cant get it working without errors when using the response first. Here is what works: $("#postholder #" +response.postid).load("viewbuild.php?id=22 #" +response.postid, function() { But instead of giving the URL directly, I want to use a URL that I return. So ideally something like this: $("#postholder #" +response.postid).load(response.pageurl "#" +response.postid, function() { I have also tried this: $("#postholder #" +response.postid).load(response.pageurl + "#" +response.postid, function() { Which works in a sense, but doesn't load the specified div. Instead simply loads the whole page. But that doesn't work of course. Can anyone just give me the way I should be doing this?
has answer: http://stackoverflow.com/a/24969408

http://stackoverflow.com/q/24974880
type: Question
tagged with: angularjs-directive
has title: Validate form element which is not required
tagged with: javascript
has answer: http://stackoverflow.com/a/24975142
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24975172
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24975097
has body: I got something like this here: &lt;div class="col-md-4"&gt; &lt;input type="number" class="form-control" ng-model="apMin" placeholder="0"&gt; &lt;/div&gt; &lt;div class="col-md-2 text-center"&gt;-&lt;/div&gt; &lt;div class="col-md-4"&gt; &lt;input type="number" class="form-control" ng-model="apMax" placeholder="0" ng-required="apMin &lt; apMax"&gt; &lt;/div&gt; What I need now is to make sure, that apMin is not higher than apMax. I tried something like: ng-required="apMin &lt; apMax" This field doesn't need to be required but more important is the logic to work. Someone knows how to realize it?

http://stackoverflow.com/q/24914156
answer count: 1
tagged with: javascript
has title: Google Spreadsheet Filter Column
score: 0
tagged with: filter
has answer: http://stackoverflow.com/a/24915602
type: UnansweredQuestion
type: Question
has body: I have a Spreadsheet within Google Drive that has 5 more spreadsheets feeding information from a copy of the main spreadsheet[0] of the document. I have made filters on each of the other spreadsheets [1],[2],[3],[4] in column G with the range ('G1:G1000') I have a script but is not picking the specific columns in those extra spreadsheets Thanks for the help! function onOpen(){ var ss = SpreadsheetApp.getActiveSpreadsheet(); var filterMenuEntries = [{name: "filter Column1", functionName: "filter"}]; ss.addMenu("choose filter", filterMenuEntries); } function filter(){ //spreadsheet identifier var key = '1X7qA--8UxVj37SHON14F4KdrF3DDPpKMtUmhgHVmt51GW4c'; var ss = SpreadsheetApp.openById(key); var rows = sheet.getDataRange('G1:G1000');// should I set a range here? var numRows = rows.getNumRows(); var values = rows.getValues(); ss.getActiveSheet(); for (var i=1; i &lt;=numRows -1; i++){ var row =values[i]; // Column value var myValue = row[8] //not sure if this is column 'G' or not // filter value if (myValue == "DEVPS"){ sheet.hideRows(i+1); } }
tagged with: google-apps-script
tagged with: google-sheets

http://stackoverflow.com/q/24996215
answer count: 0
tagged with: facebook-graph-api
has comment: http://stackoverflow.com/comment/38863798
type: Question
tagged with: facebook
score: 0
has body: Right now, my solution counting likes of a specific user is Starting a recursive call on the "/{user-id}/posts" edge Iterate through all posts On each post iterate through each like on the likes edge If someone knows a better, easier way with less graph API calls necessary, please let me know! /* * * Count my_user_id likes in wall of user "123" * * ex: url = /123/posts * * setTimeout to avoid exceed api level rate limit, code 613 */ function findMyLikes(url,my_user_id,count,callback) { console.log(url); FB.api(url, function (response) { if (response.data) { response.data.forEach(function (post) { //console.log(post); if (post.likes) { post.likes.data.forEach(function (like) { if (like.id == my_user_id) { count++; } }); } }); } if (response.paging &amp;&amp; response.paging.next) { setTimeout(function() {findMyLikes(response.paging.next,my_user_id,count,callback)},1000); } else { callback(count); } }); };
has title: Getting all likes from a specific user on a news wall with fewer graph API calls
has comment: http://stackoverflow.com/comment/38863156
has comment: http://stackoverflow.com/comment/38863863
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/38704442
score: 0
comment on: http://stackoverflow.com/q/24911704
type: QuestionComment
has text: That's code from a tutorial. I'm not the author of it. I'm a beginner with NodeJs. It would be nice if you could elaborate your answer, as I don't have a clue what you mean ;)
type: Comment

http://stackoverflow.com/comment/38719733
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24918277
type: Comment
has text: @gustavo, don't you think you should upvote the answer :) really neat.

http://stackoverflow.com/comment/121997019
has text: FYI: The pages linked in this answer are now broken
score: 4
comment on: http://stackoverflow.com/a/25041996
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38771010
type: AnswerComment
type: Comment
has text: @Christopher Exactly. I've updated the code to use json variable and a AJAX call sample.
comment on: http://stackoverflow.com/a/24946944
score: 0

http://stackoverflow.com/comment/38972960
comment on: http://stackoverflow.com/a/25041837
has text: Olim, I didn't know that method so I had a look; unfortuntaley, and unless I read wrong, I can only say I can use direct adressing and not : obj.hasOwnProperty(field) will return false if field = 'address.phone' (for ex.), only allowing me to skip it. I also looked into the 'in' method, but I think the problem is the same. Correct me in case I am wrong
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25035426
has comment: http://stackoverflow.com/comment/38936651
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25036693
downvote count: 1
has comment: http://stackoverflow.com/comment/38938618
has title: How to get only one element from current html object using jquery?
type: Question
has body: I have a template name name - Add new I want to add only first select element on click of Add new button . Here is my jquery code to add both select.. $("#mydiv").each(function() { var tds = ' '; jQuery.each($('tr:last td', this), function() { var x = $(this).html(); tds += ' ' + $(this).html() + ' '; tds += ' ' + x[0]+ ' '; }); tds += ' '; if ($('tbody', this).length > 0) { $('tbody', this).append(tds); } else { var getId = el.currentTarget; $(getId).append(tds); } }); How do I add only first select element using jquery??
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
has answer: http://stackoverflow.com/a/25036416
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38938288
favorite count: 0

http://stackoverflow.com/comment/38764230
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24943159
has text: Why is this question tagged with telerik and javascript?
type: Comment

http://stackoverflow.com/comment/38855589
type: QuestionComment
has text: Since you don't have similar issue with cleanProductBrand(), I bet there is still a call of cleanProducttitle() somewhere.
comment on: http://stackoverflow.com/q/24992217
score: 0
type: Comment

http://stackoverflow.com/comment/38720344
type: QuestionComment
has text: I'm thinking that you probably don't need `addBack()` in your statement. Other than that, I'm not sure what is causing an issue here. I had luck in JSFiddle - http://jsfiddle.net/du77U/
comment on: http://stackoverflow.com/q/24919579
score: 0
type: Comment

http://stackoverflow.com/comment/38985950
comment on: http://stackoverflow.com/a/25061153
type: Comment
has text: @Tom you can choose selected option in your controller just like that : {Name: "One More Thing","selectedOption": "pass"} I've updated bin.
type: AnswerComment
score: 0

http://stackoverflow.com/q/25014984
upvote count: 1
linked to: http://stackoverflow.com/q/931407
type: Question
has answer: http://stackoverflow.com/a/25015027
possible better answer: http://stackoverflow.com/a/25015062
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25015062
answer count: 2
downvote count: 0
tagged with: javascript
has title: Sending json in ajax
favorite count: 0
has comment: http://stackoverflow.com/comment/38898465
tagged with: ajax
accepted answer: http://stackoverflow.com/a/25015027
has body: I am trying to send json in ajax using javascript. I am able to retrieve the values back from php but unable to retrieve a specific json array. var mname = ["john", "mary", "eva"]; var fname = 678; clicked_keyword_test = {"lastName": fname, "firstName": mname}; xmlhttp.send('myArray=' +JSON.stringify(clicked_keyword_test)); Getting data in PHP and sending it back to ajax: $receive_data = json_decode ($_POST['myArray']); echo json_encode($receive_data); Now the above works fine but if I want to retrieve only the values of "firstName" like echo json_encode($receive_data["firstName"]); then I get an error like: Fatal error: Cannot use object of type stdClass as array in..... How can I sucessfully send json data using javascript not jquery.
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/38966657
type: QuestionComment
has text: The behaviour expected by you is only occuring with black background in the fiddle.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25051053

http://stackoverflow.com/a/24935297
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24926240
answers question: http://stackoverflow.com/q/24926240
upvote count: 9
has comment: http://stackoverflow.com/comment/38749072
score: 9
has body: Set the tooltip.trigger option to 'both': tooltip: { isHtml: true, trigger: 'both' }
type: AcceptedAnswer

http://stackoverflow.com/comment/38789093
has text: Can you explain why it is necessary to do this?
score: 0
comment on: http://stackoverflow.com/q/24956918
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38973339
has text: Thanks, I think I got it. So, what would be you advice?
score: 0
comment on: http://stackoverflow.com/q/25054629
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38793873
comment on: http://stackoverflow.com/a/24959330
score: 0
type: AnswerComment
has text: @user3760964 you haven't given any information about how you generated those numbers in the first place.
type: Comment

angular-strap
tag name: angular-strap
type: Tag
tags question: http://stackoverflow.com/q/24942636
tags question: http://stackoverflow.com/q/24993853

http://stackoverflow.com/comment/38898038
comment on: http://stackoverflow.com/q/25014668
has text: Take a look at this http://stackoverflow.com/questions/2358253/php-streaming-mp3
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25068365
has body: I figured it out, the github page says you need to include font-awesome, so I did that and it worked.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25068228
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/25068228

http://stackoverflow.com/comment/38932287
type: QuestionComment
comment on: http://stackoverflow.com/q/25032549
type: Comment
score: 1
has text: Yes, it works for the multiple argument case, and also with real promises such as Bluebird or native promises using `Promise.all`.

http://stackoverflow.com/comment/38737633
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24928695
has text: using iframe makes google listing hard for you

http://stackoverflow.com/comment/38964447
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25049815
has text: Multiple elements with the same id...

http://stackoverflow.com/q/25039374
type: Question
tagged with: kendo-chart
possible better answer: http://stackoverflow.com/a/25040705
has answer: http://stackoverflow.com/a/25040705
tagged with: javascript
score: 4
accepted answer: http://stackoverflow.com/a/25328353
upvote count: 4
answer count: 2
downvote count: 0
tagged with: uicolor
favorite count: 0
tagged with: kendo-ui
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25328353
has body: I am using a .kendoChart() call to create my self a pie chart. seriesColors: config.colors, tooltip: { visible: true, template: function (e) { return shared.AssetClassName(e.category) + ' ' + shared.toString(e.percentage, "p0"); } } Using seriesColors: config.colors I am overriding the normal color set that comes with Kendo UI. The problem with this is when the chart uses darker colors the label color in the tooltip on hover is always black and is very difficult to read. I am looking for a way to reference another color array, set the colors on bind or something similar to that. Kendo UI handles the dark colors in the standard color set by changing the label colors to white automatically so there should be a way to do it. I have done some research but I cannot find a good set of documentation for Kendo UI similar to what Microsoft usually releases. Update: Joe's response was very helpful but it did not quite get me there. Using the Color: attribute I can indeed set the ToolTip text color on a global scale, but... what if I have a light yellow? Is there a way to specify directly what color the text should be on what background color? Will Color: accept a function{} or array of colors somehow? Thanks, Thanks to Roc for showing me exactly what I was missing! Note: I used 120 luma for my determining value of if I would use black or white.
has title: Setting Tool tip label colors on a KendoUI Pie Chart
linked to: http://stackoverflow.com/q/12043187

http://stackoverflow.com/a/24911532
answers question: http://stackoverflow.com/q/24910340
score: 1
has body: You might run into cross domain issues, since you won't be able to access http://example.com/ contents with JavaScript, unless your JavaScript is also hosted on http://example.com/. If form action leads to the same domain, you can do smth like this: html &lt;form id="myform" action="http://fiddle.jshell.net/" target="myiframe"&gt; //some fields &lt;/form&gt; &lt;iframe id="myiframe" name="myiframe" src=""&gt;&lt;/iframe&gt; javascript var iFrame = document.getElementById("myiframe"); var form = document.getElementById("myform"); iFrame.onload = function () { /** do smth with your iframe data */ console.log(iFrame.contentDocument.body.innerHTML); }; form.submit(); Please note the domain name in jsfiddle code - it points to the same domain, the JS is executed at, to prevent cross-domain access issues.
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/a/24925118
has body: I dont know why I was thinking that replace without adding a regular expression would actually replace every character in the text: data = data.replace(/\r/g,''); (I just changed the search to a global regex) Now the length matches.
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24924856
answers question: http://stackoverflow.com/q/24924856
type: Answer

http://stackoverflow.com/q/25008024
has comment: http://stackoverflow.com/comment/38886006
tagged with: listener
score: 0
has body: Background I have been playing around with setting up my own JavaScript base Objects for a little project. I wanted to be able to set up some simple objects that my more complicated objects could inherit functionality from. I have been following a few tutorials (http://desalasworks.com/article/object-oriented-javascript-inheritance/) online and have the basic extends behaviour I need, see the code section of this question for the base framework setup. I have a class TestModel that inherits functionality from Model. I can create two new instance like so: var test_model_1 = new TestModel(); var test_model_2 = new TestModel(); I can then set some data on them: test_model_1.set({test:'Test1'}); test_model_2.set({test:'Test2'}); I can get the results for both objects: test_model_1.get() //test will = Test1 test_model_2.get() //test will = Test2 I now add a listener to test_model_1 only: test_model_1.addListener(function(data){ console.log(data); }); and call set on test_model_2: test_model_2.set({test:'Some data that should not be seen in the console.log'}); test_model_1 listener is getting triggered and sending the data to the console log. As the listener was only added to the test_model_1 object and the set was called on the test_model_2 object, this shouldn't happen. Question What is wrong with my Model class that is allowing all listeners to be called whenever set is called on any instance of the class? Code Object.extends Object.extend = function (superClass, definition) { var subClass = function () { }; // Our constructor becomes the 'subclass' if (definition.constructor !== Object) { subClass = definition.constructor; } subClass.prototype = new superClass(); for (var prop in definition) { if (prop != 'constructor') subClass.prototype[prop] = definition[prop]; } // Keep track of the parent class // so we can call its constructor too subClass.superClass = superClass; return subClass; }; Model Model = Object.extend(Object, { data: {}, listener: [], constructor: funct…
answer count: 1
tagged with: object
has title: JavaScript OO class with listener callbacks
has comment: http://stackoverflow.com/comment/38885979
has answer: http://stackoverflow.com/a/25008199
has comment: http://stackoverflow.com/comment/38885457
tagged with: javascript
type: UnansweredQuestion
type: Question

http://stackoverflow.com/q/24915422
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38712318
score: 1
upvote count: 1
type: Question
tagged with: jquery-ui
tagged with: javascript
has answer: http://stackoverflow.com/a/24916442
has body: I'm working on a project where the CSS naming conventions employed aren't compatible with the class names that jQuery UI provides. Is there any way beyond a simple search/replace in the jQuery UI source (which sounds dangerous) to change the class names that jQuery UI provides for its elements? For example, jQuery resizable requires handles with the class .ui-resizable-handle, when it should be .resizeHandle.
linked to: http://stackoverflow.com/q/754607
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38712342
has title: jQuery UI Class Names

http://stackoverflow.com/comment/38814491
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24969034
has text: @YinYang What did your start with then, a space? Good you found that, I'm was starting to lose my faith on the world... haha. Then we learnt something today as well!
score: 0

http://stackoverflow.com/comment/38702848
type: QuestionComment
comment on: http://stackoverflow.com/q/24911155
has text: Does ASP.NET not have bundling/minimfication support?
score: 0
type: Comment

http://stackoverflow.com/comment/38844349
has text: See my edit, I added the files array in `karma.conf.js`. `angular-route.js` is already included. If I comment it out, all four tests fail, rather than just the one.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24986155
type: Comment

http://stackoverflow.com/q/24946832
has answer: http://stackoverflow.com/a/24946873
has body: I am trying to figure out how to parse the SQL data I pulled using PHP to a javascript file. I need to store the PHP array into java because I have a graph that uses a javascript array to populate the data. Right now I have a button that refreshes my graph data, and when it is clicked it calls this javascript that's included in my main HTML file: button.js $(function(){ $('#refreshchart').click(function() { var chart = $('#chart').highcharts(); chart.series[0].setData(dataarray); }); }); The Java array "dataarray" needs to be pulled from a SQL database. I have a PHP script that pulls the required data from the database. Here is my PHP script: query.php &lt;?php include 'dbcon.php'; $query0 = "SELECT count(*) FROM test WHERE ans=0"; $query1 = "SELECT count(*) FROM test WHERE ans=1"; $query2 = "SELECT count(*) FROM test WHERE ans=2"; $query3 = "SELECT count(*) FROM test WHERE ans=3"; $query4 = "SELECT count(*) FROM test WHERE ans=4"; $query5 = "SELECT count(*) FROM test WHERE ans=5"; $query6 = "SELECT count(*) FROM test WHERE ans=6"; $query7 = "SELECT count(*) FROM test WHERE ans=7"; $query8 = "SELECT count(*) FROM test WHERE ans=8"; $query9 = "SELECT count(*) FROM test WHERE ans=9"; $result0 = $mysqli-&gt;query($query0) or die($mysqli-&gt;error.__LINE__); $result1 = $mysqli-&gt;query($query1) or die($mysqli-&gt;error.__LINE__); $result2 = $mysqli-&gt;query($query2) or die($mysqli-&gt;error.__LINE__); $result3 = $mysqli-&gt;query($query3) or die($mysqli-&gt;error.__LINE__); $result4 = $mysqli-&gt;query($query4) or die($mysqli-&gt;error.__LINE__); $result5 = $mysqli-&gt;query($query5) or die($mysqli-&gt;error.__LINE__); $result6 = $mysqli-&gt;query($query6) or die($mysqli-&gt;error.__LINE__); $result7 = $mysqli-&gt;query($query7) or die($mysqli-&gt;error.__LINE__); $result8 = $mysqli-&gt;query($query8) or die($mysqli-&gt;error.__LINE__); $result9 = $mysqli-&gt;query($query9) or die($mysqli-&gt;error.__LINE__); $row0 = $result0-&gt;fetch_row(); $row1 = $result1-&gt;fetc…
score: 0
tagged with: sql
tagged with: arrays
has answer: http://stackoverflow.com/a/24946944
tagged with: php
possible better answer: http://stackoverflow.com/a/24946873
answer count: 4
has title: Grabbing SQL data using PHP then sending Array to Javascript
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24946885
type: Question
has answer: http://stackoverflow.com/a/24946973
accepted answer: http://stackoverflow.com/a/24946973
tagged with: javascript

http://stackoverflow.com/comment/38930374
comment on: http://stackoverflow.com/q/25031477
has text: You can use the HTML FileAPI for this. It's supported by most modern browsers. You can write multiple files in the sandbox of the browser and after finish writing, download them (moving from sandbox to PC).
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38807815
has text: @ElliottFrisch i maybe lost with the terminologies here but my main goal is to put those `a` and `b` variable in an `ArrayList`. can it be done?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24966678
type: Comment

http://stackoverflow.com/a/34136125
upvote count: 14
downvote count: 1
type: Answer
score: 13
answers question: http://stackoverflow.com/q/24924343
has body: window.addEventListener("error", function (e, url) { var eleArray = ["IMG", "SCRIPT", "LINK"]; var resourceMap = { "IMG": "Picture file", "SCRIPT": "JavaScript file", "LINK": "CSS file" }; var ele = e.target; if(eleArray.indexOf(ele.tagName) != -1){ var url = ele.tagName == "LINK" ? ele.href: ele.src; console.log("src：" + url + " File " + resourceMap[ele.tagName] + " failed loading. "); return true;// dont show in console } }, true);

http://stackoverflow.com/comment/39270061
comment on: http://stackoverflow.com/a/25213399
type: Comment
score: 0
type: AnswerComment
has text: I will do some experimentation with this and get back to you. Sounds like it might work better than my solution.

http://stackoverflow.com/comment/38969821
type: AnswerComment
score: 0
type: Comment
has text: How can we display some message in between java code using html tag?
comment on: http://stackoverflow.com/a/25052654

http://stackoverflow.com/comment/38859083
score: 0
has text: Using `new Array()` and `[]` has the same effect, so this changes nothing.
type: Comment
comment on: http://stackoverflow.com/a/24994153
type: AnswerComment

http://stackoverflow.com/comment/38702413
comment on: http://stackoverflow.com/q/24910775
type: Comment
type: QuestionComment
has text: if you know php and javascript /jquery you can use `load` http://api.jquery.com/load/ and or `ajax` http://api.jquery.com/jQuery.ajax/ both jquery function
score: 1

http://stackoverflow.com/comment/38879872
score: 0
type: Comment
type: QuestionComment
has text: I think he is only able to change the web page which is viewed within the app, but not the app itself...
comment on: http://stackoverflow.com/q/25004948

http://stackoverflow.com/q/25037216
has comment: http://stackoverflow.com/comment/38940264
has answer: http://stackoverflow.com/a/39640146
has title: Declare an object with darkroom
type: UnansweredQuestion
has body: i try to use the lib darkroom. I have clone the git project on github click here I have install the lib an run the index.html whitout probleme but i have an error on my console. On the github on usage, MattKetmo say to declare an new object on darkroom. I had try to put this declaration on jQuery dom ready and it always doesn't work. Like this $( document ).ready(function() {¬ new Darkroom('#target');¬ }); And in my console my error is "Darkroom is not defined". I have include all files .css and .js . Like this ¬ ¬ ¬ ¬ ¬ Any person have an idea ? Thanks a lot.
has comment: http://stackoverflow.com/comment/38940006
type: Question
has comment: http://stackoverflow.com/comment/38940158
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: github
has comment: http://stackoverflow.com/comment/38940854
has comment: http://stackoverflow.com/comment/38942053
score: 0
has comment: http://stackoverflow.com/comment/38940126
has comment: http://stackoverflow.com/comment/64539541

http://stackoverflow.com/q/25009094
has answer: http://stackoverflow.com/a/25326595
has answer: http://stackoverflow.com/a/25359624
favorite count: 0
has answer: http://stackoverflow.com/a/25383772
accepted answer: http://stackoverflow.com/a/25383772
tagged with: ember.js
answer count: 4
has title: How to create an Ember JS Master Detail where detail appears between rows of data
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/25015683
upvote count: 1
possible better answer: http://stackoverflow.com/a/25359624
type: Question
has body: I'm trying to create a page that contains master/detail, which is obviously easy using a static {{ outlet }} in ember, however, I'd like the detail to slide down after the row that was selected. For example, on this page: http://jsbin.com/ijejap/1/edit, if the detail of the name was to appear after the currently selected name instead of at the bottom of the page. The problem I'm trying to solve is that I can't have an outlet within a repeater so that when I click Row 1, I want the outlet to be positioned below Row 1, and when I click Row 2, I want the outlet after Row 2. In other words, I want to dynamically position an outlet, I think, unless there's another way to do it.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38893242
downvote count: 0

http://stackoverflow.com/comment/38756127
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24936242
has text: Yes, it's quite interesting that the outside points don't seem to be drawn when x-axis has equal min and max. Adding more points doesn't "solve" it though ([see here](http://jsfiddle.net/gy3bV/6/)). You still need to have a x-axis with min and max not being the same. I'm guessing the answer is somewhere in the source code on this one.

http://stackoverflow.com/comment/38941985
has text: Okay That has worked, and what If I wanted to display the chosen date for the user after the pressed fetch would I do the same
comment on: http://stackoverflow.com/a/25038232
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24926361
upvote count: 13
has comment: http://stackoverflow.com/comment/38731879
downvote count: 1
score: 12
accepted answer of: http://stackoverflow.com/q/24925336
answers question: http://stackoverflow.com/q/24925336
type: AcceptedAnswer
has body: According to MDN there is no property to set that attridute directly. So it looks like you're stuck with setAttribute() You should also note that DOM manipulations come with some performance ovehead so it is some times best to minimise them. You might want to consider the following: var _form = document.body.appendChild(document.createElement('form')), _input = _form.appendChild(document.createElement('input')), _datalist = _form.appendChild(document.createElement('datalist')); _datalist.id = 'exampleList'; _input.setAttribute('list','exampleList'); var _option = ""; for (var i = 0; i &lt; 5; i++) { _option += "&lt;option value='" + i + "' /&gt;"; }; _datalist.innerHTML = _option; Demo
type: Answer

http://stackoverflow.com/comment/38919565
type: Comment
comment on: http://stackoverflow.com/a/25025915
has text: While your method works perfectly fine, I suggest using the an object for ng-model (such as `new_entry.stickie_text`), and then simply `.post('/api/stickies', $scope.new_entry)`. Note that the input name on the receive side is now `stickie_text`. More importantly, this is much easier if you want to send a few items over.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25010295
downvote count: 0
answers question: http://stackoverflow.com/q/24999890
type: Answer
accepted answer of: http://stackoverflow.com/q/24999890
has comment: http://stackoverflow.com/comment/38924350
has body: You should use jquery: $(document).ready(function(){ $("button").click(function(){ var div=$("div"); div.animate({height:'300px',opacity:'0.4'},"slow"); div.animate({width:'300px',opacity:'0.8'},"slow"); div.animate({height:'100px',opacity:'0.4'},"slow"); div.animate({width:'100px',opacity:'0.8'},"slow"); }); }); This catch a 'click' event, but you can change it as you wish
score: 4
upvote count: 4
type: AcceptedAnswer

http://stackoverflow.com/a/24922710
has body: One of two approaches: Anchor the script reference to the site root with an absolute reference via "/script/folder1/menu.js" (note how it starts with a forward slash). For example, &lt;script src="/script/folder1/menu.js"&gt;&lt;/script&gt;. This says to look at the root of the site and carry on from there. Have the script tag runat="server" and root it to the application root via "~/script/folder1/menu.js" (note the "~/" start). For example &lt;script runat="server" src="~/script/folder1/menu.js"&gt;&lt;/script&gt;. This determines the site root server-side and generates the correct path accordingly. In all cases except for when your development environment doesn't allow it (I'm showing my age there going back to WinXP for development) or you are configuring an app that will live in a virtual application sub-directory in your site, go with the first option.
answers question: http://stackoverflow.com/q/24921950
type: Answer
has comment: http://stackoverflow.com/comment/38760495
has comment: http://stackoverflow.com/comment/38760505
has comment: http://stackoverflow.com/comment/38750864
score: 0

http://stackoverflow.com/a/24969926
type: Answer
downvote count: 0
score: 9
answers question: http://stackoverflow.com/q/24969908
has comment: http://stackoverflow.com/comment/38813609
upvote count: 9
has body: You can trigger a click by omitting the callback function: $('#button1').click();
has comment: http://stackoverflow.com/comment/38813578

http://stackoverflow.com/q/24990722
type: UnansweredQuestion
has title: It is possible to save charts as images using am charts
linked to: http://stackoverflow.com/q/3975499
tagged with: amcharts
type: Question
answer count: 1
tagged with: javascript
has body: actually my requirement is to save the charts as images and saved it in server while loading the page.. I'm using amcharts so is there any possible way to do this.. thanks in advance.
score: 0
has answer: http://stackoverflow.com/a/24990874

http://stackoverflow.com/q/24987723
linked to: http://stackoverflow.com/q/14320925
has comment: http://stackoverflow.com/comment/38847916
has comment: http://stackoverflow.com/comment/38847969
answer count: 0
linked to: http://stackoverflow.com/q/24222457
type: UnansweredQuestion
type: Question
duplicate of: http://stackoverflow.com/q/24222457
tagged with: ember-data
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38847631
has title: Does ember.js still support embedded relationships?
tagged with: javascript
has body: My Setup DEBUG: ------------------------------- DEBUG: Ember : 1.5.1 DEBUG: Ember Data : 1.0.0-beta.8.2a68c63a DEBUG: Handlebars : 1.3.0 DEBUG: jQuery : 1.11.0 DEBUG: ------------------------------- I understand ember-data by default wants "sideloaded relationships". http://emberjs.com/guides/models/the-rest-adapter/#toc_sideloaded-relationships It simply doesn't make any sense to me why they would choose to design their REST adapter as such. Regardless I've seen some posts that suggest I can embed the relationships: https://stackoverflow.com/a/14324532/1251349 http://discuss.emberjs.com/t/ember-data-embedded-records-handling/4132 However can't seem to get it to work. The answer's I've found are of older versions of emberjs. So I'm not sure if I'm doing something wrong, or the old solutions no longer work. TL:DR; Does ember-data still support "embedded relationships" Here is an example of what I got: GDL.Event = DS.Model.extend( title: DS.attr('string') time: DS.attr('date') time_i: DS.attr('number') live: DS.attr('boolean') category: { embedded: 'load' } ) GDL.Category = DS.Model.extend( name: DS.attr('string') ) My JSON { "events":[ { "id":2411, "title":"Green Bay Packers vs. Seattle Seahawks", "time":"2014-09-05T00:30:00.000Z", "time_i":1409877000, "category":{ "id":109, "name":"Football" } }, { "id":2412, "title":"New Orleans Saints vs. Atlanta Falcons", "time":"2014-09-07T17:00:00.000Z", "time_i":1410109200, "category":{ "id":109, "name":"Football" } }, ] }
has comment: http://stackoverflow.com/comment/38848674
score: 0
tagged with: ember.js
has comment: http://stackoverflow.com/comment/38847998

http://stackoverflow.com/q/25067963
tagged with: javascript
linked to: http://stackoverflow.com/q/25083305
type: AnsweredQuestion
score: 3
favorite count: 0
tagged with: angularjs
type: Question
accepted answer: http://stackoverflow.com/a/25068416
has body: app.factory('Greeter', ['$resource',function($resource){ return $resource( 'http://123.com/processor.php?'+'myvar=1066', {callback: 'JSON_CALLBACK'}, { query: {method:'GET',isArray:true} }); }]); I tried to pass a simple static variable into a php file to get call back value yet, its seem not pass correctly with the way I use above. Since the chrome inspector shows that Query String Parametersview parsed callback=JSON_CALLBACK I wonder what is the right way to do it? Thank You
answer count: 1
has comment: http://stackoverflow.com/comment/38999324
upvote count: 3
tagged with: angularjs-resource
has title: pass a variable in url to resource callback function in AngularJS
has answer: http://stackoverflow.com/a/25068416
downvote count: 0

http://stackoverflow.com/a/24909567
has body: to move an element (of which you know the index) to the end of an array, do this: array.push(array.splice(index, 1)[0]); If you don't have the index, and only the element, then do this: array.push(array.splice(array.indexOf(element), 1)[0]); Example: var arr = [1, 2, 6, 3, 4, 5]; arr.push(arr.splice(arr.indexOf(6), 1)[0]); console.log(arr); // [1, 2, 3, 4, 5, 6] NOTE: this only works with Arrays (created with the [ ... ] syntax or Array()) not with Objects (created with the { ... } syntax or Object())
score: 157
answers question: http://stackoverflow.com/q/24909371
accepted answer of: http://stackoverflow.com/q/24909371
has comment: http://stackoverflow.com/comment/108947478
has comment: http://stackoverflow.com/comment/100405410
has comment: http://stackoverflow.com/comment/121621581
has comment: http://stackoverflow.com/comment/114050941
has comment: http://stackoverflow.com/comment/114051235
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/108960756
upvote count: 157

http://stackoverflow.com/comment/38879200
comment on: http://stackoverflow.com/a/25004354
type: Comment
score: 0
type: AnswerComment
has text: @j08691:please see my complete code:`http://jsfiddle.net/Tdafh/6/` 1 - i validate select box using jquery selectbox plugin. when you submit form without value(ie :remove red from select box) u see red error if u click outside selectbox red error switch to green error. i think `change(); conflicted with line 59. 2 - if remove selected from option select2 not work and not styled option.

http://stackoverflow.com/a/24975965
type: Answer
answers question: http://stackoverflow.com/q/24970772
score: 0
has body: Another option would be to install a local web server, then pass any data from javascript to the local web server over HTTP, execing AutoIt in a CGI script (or similar) on the web server. Just be careful how you setup the web server, disallow or firewall out remote connections, because you probably don't want other computers to exec your AutoIt scripts.

http://stackoverflow.com/q/24953359
tagged with: javascript
score: 1
accepted answer: http://stackoverflow.com/a/24955196
has body: This is a follow on question from Splitting and grouping records into daily sets using d3.js and dc.js. I have a data set structure that looks as follows: [ {"device":"device_1", "date": "01/01/2014", "cumulative": 2530}, {"device":"device_2", "date": "01/01/2014", "cumulative": 1234}, {"device":"device_1", "date": "01/02/2014", "cumulative": 456}, {"device":"device_2", "date": "01/02/2014", "cumulative": 198}, ... ] I am trying to create a bar chart using crossfilter to display the total uptime as a % on the Y-Axis and the date on the X-Axis. The cumulative is a value in seconds and given that there are (roughly/generally) 86400 seconds in a day I can get the % uptime for a single device pretty easily: d3.json("daily.json", function(error, json_data) { ... json_data.forEach(function(d) { d.dd = dateFormat.parse(d.date); ... }); var das = crossfilter(json_data); var all = das.groupAll(); // dimension by date var dateDimension = das.dimension(function(d) { return d.dd; }); var uptimeDaysGroup = dateDimension.group().reduceSum(function(d) { return Math.round(((86400 - d.cumulative) / 86400) * 100); }); ... } The problem being (as you can see from the original dataset) there is more than one device per day. The number of devices could be anywhere between 1 and 500K, so I need to modify the uptimeDaysGroup function to take this into account by somehow obtaining the number of objects that have been added to the group for a given day.
favorite count: 0
tagged with: d3.js
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24955196
has title: Crossfilter (d3js/dcjs) get group size in group
tagged with: dc.js
type: Question
tagged with: crossfilter
answer count: 1
downvote count: 0
linked to: http://stackoverflow.com/q/24906877

http://stackoverflow.com/comment/38960273
type: QuestionComment
type: Comment
has text: You mention a function incommingEvents, but I don't see that anywhere in your examples.
comment on: http://stackoverflow.com/q/24962570
score: 0

http://stackoverflow.com/q/25040604
type: Question
has body: I was doing a lot of mocking of a layout page. I wrote lots of javascript using $(document).ready in the header to test. $(document).ready(function () { $('.errorPopup').hide(); $('#account').mask('9999-9999-9999-9999'); $('#code').mask('9999'); $("#form").validate({ errorPlacement: function (error, element) { $('.errorPopup').show(); }, success: function (label, element) { $('.errorPopup').hide(); }, rules: { "account": { required: true }, "code": { required: true, max:1000 } }, messages: { "account": { required: "Account is required." }, "code": { required: "Code is required", max: "Sorry only 1000 max" } }, submitHandler: function (form) { return false; } }); }); Now I have to add it to the main.js file that site use and everything is organized in class/objects. //main.js var checkAccount = { init: function(holder){ messages = holder; $('elment1').click(//do something); $('elment2').click(//do something); }, someAction: function(misc) ... } How would I write my stuff in that format? How would I have it behave like before in $document.ready()? THanks
has comment: http://stackoverflow.com/comment/38947711
has comment: http://stackoverflow.com/comment/38949233
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: class
has comment: http://stackoverflow.com/comment/38948855
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38946679
tagged with: object
score: 1
tagged with: ready
has title: Moving from document ready to js file class/object

http://stackoverflow.com/comment/38965100
has text: Does that mean you want a different behaviour if only 1 item is different? Or 1 or more?
comment on: http://stackoverflow.com/q/25050184
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38780799
type: Comment
has text: @click: My answer is based on the assumption that you are properly escaping this user content as you are displaying it on your original HTML page. If the user added something malicious here, it would likely to be rendered on your original HTML page if not properly escaped - the AJAX request does not increase this risk. Yes there are attacks such as mXSS, but these only apply if you are attempting to _sanitize_ a subset of HTML for display. If you are not doing this, then your AJAX request is as safe as the original page load.
comment on: http://stackoverflow.com/a/24952097
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38839293
type: Comment
score: 0
has text: Well I have just noticed that the content in the json file were with double quotes and not single as I put in the example. I don't know if this makes any difference. And yes, Firebug is showing the json content just fine.
type: AnswerComment
comment on: http://stackoverflow.com/a/24983339

keyboard-shortcuts
tags question: http://stackoverflow.com/q/24995316
tag name: keyboard-shortcuts
type: Tag

http://stackoverflow.com/a/25021791
has comment: http://stackoverflow.com/comment/38924692
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/25021631
score: 1
downvote count: 0
has body: Yes, because you have not added 'underscore' javascript library in your code here. In jsfiddle, you can refer it via provided tools but in your code you need to add it in the head section. So, add this line to your head section OR if you have added underscore library to your script folder, then add this line

http://stackoverflow.com/a/25064125
upvote count: 3
has comment: http://stackoverflow.com/comment/38998366
has comment: http://stackoverflow.com/comment/39011748
accepted answer of: http://stackoverflow.com/q/25062132
has comment: http://stackoverflow.com/comment/39011866
has comment: http://stackoverflow.com/comment/38998026
has comment: http://stackoverflow.com/comment/38997197
type: AcceptedAnswer
downvote count: 0
has body: You can do it if you're retrieving the file through true ajax (that is, through XMLHttpRequest), provided you configure your server to send the Last-Modified header when sending the data. The fundamental thing here is that when you use XMLHttpRequest, you can access the response headers. So if the server sends back Last-Modified, you can use it: var xhr = $.ajax({ url: "data.json", success: function(response) { display("Data is " + response.data + ", last modified: " + xhr.getResponseHeader("Last-Modified")); } }); Just tried that on Chrome, Firefox, IE8, and IE11. Worked well (even when the data was coming from cache). You've said below that you need to do this in a loop, but you keep seeing the last value of the variable. That tells me you've done something like this: // **WRONG** var list = /*...some list of URLs...*/; var index; for (index = 0; index < list.length; ++index) { var xhr = $.ajax({ url: list[index], success: function(response) { display("Data is " + response.data + ", last modified: " + xhr.getResponseHeader("Last-Modified")); } }); } The problem there is that all of the success callbacks have an enduring reference to the xhr variable, and there is only one of them. So all the callbacks see the last value assigned to xhr. This is the classic closure problem. Here's one solution: var list = /*...some list of URLs...*/; list.forEach(function(url) { var xhr = $.ajax({ url: url, success: function(response) { display("Data for " + url + " is " + response.data + ", last modified: " + xhr.getResponseHeader("Last-Modified")); } }); }); Since each iteration of the forEach callback gets its own xhr variable, there's no cross-talk. (You'll need to shim forEach on old browsers.) You said below: I already thought about a closure problem, thats why I used an array xhr[e] in my loop over e... But your example doesent help... and linked to this code in a gist: //loop over e.... nodename=arr[e]; node_json=path_to_node_json+nodename; html +='data ' +' '; xhr[e] = $.a…
answers question: http://stackoverflow.com/q/25062132
type: Answer
has comment: http://stackoverflow.com/comment/39011486
score: 3

http://stackoverflow.com/a/24915066
downvote count: 0
has comment: http://stackoverflow.com/comment/38737502
has comment: http://stackoverflow.com/comment/38737223
answers question: http://stackoverflow.com/q/24914886
type: Answer
has comment: http://stackoverflow.com/comment/38739813
has comment: http://stackoverflow.com/comment/38740692
score: 2
has comment: http://stackoverflow.com/comment/38740418
upvote count: 2
has body: Your webmethod should be having the syntax: [WebMethod] public static string Page_LoadComplete(int id) { .... return "hello"; } and similarly your ajax call: $.ajax({ type: "POST", url: "YourPage.aspx/Page_LoadComplete", data: "{'id':'1'}", dataType: "json", contentType: "application/json; charset=utf-8", success: function (data) { //do something with data } });
has comment: http://stackoverflow.com/comment/38737313
has comment: http://stackoverflow.com/comment/38741262

http://stackoverflow.com/comment/39282705
type: Comment
score: 2
comment on: http://stackoverflow.com/a/25220289
type: AnswerComment
has text: Thank you very much! Really glad there is a different opinion presented. Most of us use sublime and webstorm, and we are still debating about the naming.

mnist
tags question: http://stackoverflow.com/q/25024179
type: Tag
tag name: mnist

http://stackoverflow.com/q/24968987
accepted answer: http://stackoverflow.com/a/24969023
has body: I had send word document file in my mail when i send this document at that time it will generate unknown format like asdfADFDF 0000sadfas15454454 I had use mail function for sending mail . Here is my code for that please check and let me know . function sendfile() { $id = $_REQUEST['id']; $s=mysql_query("select * from file_doc where id='".$id."'"); $r= mysql_fetch_array($s); $r['email']; // user email address $docfile = "upload/".$r['cv']; // $r['cv'] is docfile }
upvote count: 0
has comment: http://stackoverflow.com/comment/38812085
type: AnsweredQuestion
has title: send wordfile in email using mail() in php?
score: -1
has comment: http://stackoverflow.com/comment/38811941
type: Question
has comment: http://stackoverflow.com/comment/38811956
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38811958
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/11764156
tagged with: php
has answer: http://stackoverflow.com/a/24969023

http://stackoverflow.com/q/25020601
type: Question
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/csv
answer count: 1
tagged with: nvd3.js
has answer: http://stackoverflow.com/a/25032628
tagged with: d3.js
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25032628
has body: I have an issue where I try to display average values over a single day; Hours, minutes (%H:%M), but the chart does not properly interpret the data and switches times around, 23:30 comes after 00:00, creating a messy display. I think the issue is related to how time formatting, but am not sure how. Can anyone identify what is wrong? Any tips are appreciated! Code &lt;script&gt; d3.csv("17_predicted_hourly_holiday.csv", function(error, data) { data.sort(function(a, b) { return a.length - b.length; }); var exampleData = Object.keys(data[0]).filter(function(k) { return k != 'length' }) .map(function(k) { return { 'key': k, 'values': data.map(function(d) { return [ d3.time.format('%Y-%m-%d' + '%H:%M').parse("2000-01-01" + d.length), //d3.time.format('%Y-%b-%d' + '%H:%M:%S').parse("2000-01-01" + d.length + ':00') +d[k] ] }) } }); //alert(JSON.stringify(exampleData)); console.log(exampleData); //console.log(data); var colors = d3.scale.category20(); keyColor = function(d, i) { return colors(d.key) }; var chart; nv.addGraph(function() { chart = nv.models.stackedAreaChart() .x(function(d) { return d[0] }) .y(function(d) { return d[1] }) .color(keyColor) .clipEdge(true); chart.xAxis .tickFormat(function(d) { return d3.time.format('%H:%M')(new Date(d)); }); chart.yAxis .tickFormat(d3.format(',.2f')); d3.select('#chart') .datum(exampleData) .transition().duration(500).call(chart); nv.utils.windowResize(chart.update); chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); }); return chart; }); // end read csv }); Plunker http://plnkr.co/edit/GYI8oq?p=info Image of issue: https://i.sstatic.net/NXStQ.png
has comment: http://stackoverflow.com/comment/38909759
has title: Wrong display of csv input to nvd3 chart (related to timeformatting)

http://stackoverflow.com/comment/38972497
type: AnswerComment
has text: I tried doing everything but still i have problem. plz help me !
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24950791

http://stackoverflow.com/q/24965209
favorite count: 0
tagged with: regex
upvote count: 4
has body: I like the \b word boundary delimiter but in my view, a - isn't a word delimiter. It should be part of the word. # in node &gt; 'peter bengtsson o-peter'.replace(/\b(pete|be)/gi, 'X') 'Xr Xngtsson o-Xr' I wish the output would be Xr Xngtsson o-peter instead. How can I do something nearly like this but make - be part of the word and not a boundary?
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24966297
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/24966297
has comment: http://stackoverflow.com/comment/38806136
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24966904
score: 4
has answer: http://stackoverflow.com/a/24966904
answer count: 2
has title: Word boundary excluding hyphen in Javascript

http://stackoverflow.com/q/25058667
has comment: http://stackoverflow.com/comment/38981322
has comment: http://stackoverflow.com/comment/38981445
possible better answer: http://stackoverflow.com/a/25058734
has answer: http://stackoverflow.com/a/44136150
has comment: http://stackoverflow.com/comment/38980652
has title: State city dropdown list
has answer: http://stackoverflow.com/a/25058734
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38981244
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25059001
has body: I tested this state city dropdown not working JavaScript code for state and city drop down. My question is when this prog runs the first city from the respective state is displayed , one cannot select another city in the same state. Eg: In Maharashtra state the city which gets displayed is Mumbai. IF i select pune from the list, it does not work. I want pune or nasik city to be also selected. Any idea ?
type: Question
tagged with: javascript
favorite count: 0
answer count: 3
has answer: http://stackoverflow.com/a/25059001
has comment: http://stackoverflow.com/comment/38980692

http://stackoverflow.com/q/24977260
type: Question
has body: I'm completely new with AngularJS and attempting to capture, parse, and display data from a SOAP web service. So far I can call successfully call a public weather service, capture and display the returned XML data, convert the XML to a JSON string, but I'm not having any success binding/displaying the JSON data. Below are my HTML and JS files. Thanks in advance for any advice/suggestions! MyHelloView.html My Simple Angular App {{soapResponse}} {{jsonData}} WeatherReturn: Success: ResponseText: State: City: WeatherStationCity: WeatherID: Description: Temperature: RelativeHumidity: {{field.name}}: MyHelloController.js function MyHttpController($scope, $http) { $scope.loaded = false; $scope.soapResponse = 'no response yet'; $http.get('http://wsf.cdyne.com//WeatherWS/Weather.asmx/GetCityWeatherByZIP?ZIP=60301').then(function(result){ $scope.soapResponse = result.data; var x2js = new X2JS(); // convert XML data to JSON $scope.jsonData = x2js.xml_str2json(result.data); $scope.loaded = true; }); }
tagged with: javascript
has answer: http://stackoverflow.com/a/24978305
has comment: http://stackoverflow.com/comment/38827543
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
accepted answer: http://stackoverflow.com/a/24978305
has title: AngularJS - Data-binding from JSON string

http://stackoverflow.com/comment/39002937
has text: Would you mind elaborating on this? As stated here: http://stackoverflow.com/questions/13104494/does-javascript-pass-by-reference everything not primitive is passed by "copy of reference" and thus still a reference.
type: Comment
comment on: http://stackoverflow.com/a/25045204
score: 0
type: AnswerComment

http://stackoverflow.com/a/25066164
type: Answer
score: 0
has body: Place "var top=[]" inside the loop and change array.push(top) to array.unshift(top), unshift method always insert element to the index 0.
answers question: http://stackoverflow.com/q/25065957

pivot-table
tag name: pivot-table
tags question: http://stackoverflow.com/q/24969924
type: Tag

http://stackoverflow.com/q/25035057
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: esri
favorite count: 0
has title: Uncaught TypeError: Cannot read property 'lat' of undefined Leaflet map ArcIGS
has answer: http://stackoverflow.com/a/25040680
type: UnansweredQuestion
score: 1
upvote count: 1
has body: I am trying to use a rest service from arcIGS, using the dynamicMapLayer property but when I add this feature the map becomes unresponsive. //Add Real map of Ireland to the maps var myAGSLayer = new L.esri.dynamicMapLayer("http://atlas.marine./arcgis/rest/services/Atlas/MarineAdministrativeUnits/MapServer/", { opacity: 1 }).addTo(map); The rest service i call fits on the map perfect but then it causes the map to become unresponsive. Is there any reason it should be doing this ?
type: Question
tagged with: leaflet

http://stackoverflow.com/a/24957027
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38789234
type: Answer
accepted answer of: http://stackoverflow.com/q/24956641
answers question: http://stackoverflow.com/q/24956641
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38790811
has body: I see several issues. First: if ( !promise ) is only going to return true the first time. You are assigning it to the $http call. Secondly: You never access the async method in your factory. You either need to return that from factory return recentClients.async or call it from scope recentClients.async().then(..

http://stackoverflow.com/comment/38812869
type: Comment
comment on: http://stackoverflow.com/a/24969530
has text: This isn't a weird part of javascript, it is context/scope assignment. jQuery contextually assigns `this` to the DOM element that was clicked using `.apply` or `.call`. Saying that, this solution will work so +1
score: 0
type: AnswerComment

http://stackoverflow.com/a/24992579
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24992494
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24992494
has body: you did not show how you handle clicking on LI (in your js) but the thing with dynamically generated content is if you want to add event listeners you need to use delegate one. So instead: $('#list li').click(function() { /* your code here */ }); You need to use: $('#list').on('click', 'li', function() { /* your code here */ });
downvote count: 0
score: 1

http://stackoverflow.com/comment/38860733
type: AnswerComment
has text: It is not possible to edit this dialog. All you can do is add the message, as you already did. See http://msdn.microsoft.com/en-us/library/ms536907%28VS.85%29.aspx
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24994768

http://stackoverflow.com/q/25012780
accepted answer: http://stackoverflow.com/a/25030094
favorite count: 0
tagged with: selenium-webdriver
downvote count: 0
tagged with: selenium
has body: We have a web application that I am trying to automate testing for, using Java, Web Driver and TestNG. The biggest challenge I'm facing (failing at) is to stay ahead of development and prevent the test framework from breaking with even minor code changes. Problem There's a text field that accepts numbers. Up till now, sendKeys did the job for me. In a recent change to the page source, when numbers are entered, commas get automatically inserted. So "50000" becomes "50,000" for example. Now sendKeys enters the value correctly, but after I move out of the field to editing other fields, the value resets to 0. Here's the source for the element. Note the values for onkeyup and onfocus: &lt;input type="text" class="form-control tooltip-default" id="my_budget" value="" data-mask="fdecimal" data-rad="." data-toggle="tooltip" data-placement="top" data-original-title="test tooltip" onfocus="removeErrors('my_budget');" onkeyup="removeNegativeSign('my_budget');"&gt; I've faced this issue before, and tried to hack a solution using W3Schools and other research. Approach 1: Keys.TAB I've read that sendKeys(Keys) can trigger a keyup event, so I tried sending Keys.TAB driver.findElement(By.id("my_budget")).sendKeys(Keys.TAB); This had no effect whatsoever. Approach 2: send keyDown-keyUp I used this question as a reference, and just simulated pressing the Ctrl-key. new Actions(driver).keyDown(driver.findElement(By.id("my_budget")), Keys.CONTROL).keyUp(driver.findElement(By.id("my_budget")), Keys.CONTROL).perform(); This had no effect whatsoever. Approach 3: execute Javascript manually Finally, I tried manually executing the Javascript, first for onfocus, then when that didn't work, for onkeyup. SeleniumHelper.doJavascriptOnElement(driver, driver.findElement(By.id("my_budget")), driver.findElement(By.id("my_budget")).getAttribute("onfocus")); SeleniumHelper.doJavascriptOnElement(driver, driver.findElement(By.id("my_budget")), driver.findElement(By.id("my_budget")).getAttribute("onkeyup…
tagged with: onkeyup
type: AnsweredQuestion
score: 1
type: Question
linked to: http://stackoverflow.com/q/11388327
answer count: 1
tagged with: javascript
tagged with: onfocus
upvote count: 1
has answer: http://stackoverflow.com/a/25030094
has title: How do I enter text in textfield with onkeyup/onfocus javascript?

http://stackoverflow.com/a/24994242
score: 1
has body: You are using the inner array as an object. The properties that you set on the array still is there, when you display it only the array items are shown. You should use an object instead of an array, as you are not using the array as an array: post_data[id] = {}; Instead of setting the properties after creating the object, you can set them when you create it: post_data[id] = { name: 'abc', date: '01-03-2014', country: 'India' };
answers question: http://stackoverflow.com/q/24994066
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/a/24946541
answers question: http://stackoverflow.com/q/24946498
score: 3
has comment: http://stackoverflow.com/comment/38770301
has comment: http://stackoverflow.com/comment/38770412
has comment: http://stackoverflow.com/comment/38771519
type: AcceptedAnswer
downvote count: 0
has body: If you add dataType: "json" to the call the response will be made a json object: $.ajax({ url: 'buildings.php', data: "building=" + building, dataType: "json", complete: function (response) { alert(response.name); } }); Edit: so it appears that for whatever reason jQuery wasn't able to parse it automatically, but JSON.parse(response.responseText) did the trick.
has comment: http://stackoverflow.com/comment/38770392
type: Answer
has comment: http://stackoverflow.com/comment/38770360
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24946498

http://stackoverflow.com/q/24915964
type: Question
linked to: http://stackoverflow.com/q/833032
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
duplicate of: http://stackoverflow.com/q/833032
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24916079
upvote count: 1
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24916079
has comment: http://stackoverflow.com/comment/38712832
tagged with: forms
has body: This is such a simple thing, or so I thought. But I just don't get why this is happening... jQuery's .submit() method. Seems easy enough – pass it a function and that serves as the listener. Don't pass it anything and it calls .trigger('submit'). But it's been a huge headache for me over the past 24 hours. Basically what I'm trying to do is build a simple validation script. The user clicks the submit button on a form, a function runs to validate the inputs, and if all is good in the world, the form submits (the default way, no fancy ajax in this scenario). The issue comes in when trying to call .submit on either the jQuery object or just the plain 'ole HTML DOM element object. I've learned that jQuery kills the native .submit on HTMLFormElement, so it makes sense why that doesn't work (I guess, but that seems dumb). But... why wouldn't jQuery's .trigger('submit') (or .submit() for short) work? Example (or take a look at the Fiddle): HTML: &lt;form class="comment-form" action="#" method="get"&gt; &lt;input type="submit" id="submit" name="submit" value="submit"/&gt; &lt;/form&gt; JavaScript: $('.comment-form').on('click', '#submit', function(e) { var form = e.delegateTarget; e.preventDefault(); // For the purpose of demonstration, just setting it true if (true) { form.submit(); // object is not a function - this makes sense since jQuery is overriding this $(form).submit(); // nothin at all :( $(form).trigger('submit'); // nope, nada } }); I did find a workaround by calling the form using .call() on the HTMLFormElement prototype, but why should I have to do this? Why? Why? Why?
has title: $.submit() not working

http://stackoverflow.com/comment/38927104
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25029842
has text: thanks, just want to as if getting the cell data is hard-coded? what if have 3 td? see this http://jsfiddle.net/8kP9y/4/
score: 0

http://stackoverflow.com/comment/38808826
type: QuestionComment
comment on: http://stackoverflow.com/q/24967204
has text: @TLS It's possible if I can browse to the directory? How does a directory become visible? I don't mind it being visible to the browser.
score: 0
type: Comment

http://stackoverflow.com/a/25034227
has body: The only thing I could find is the forkit library. https://github.com/hakimel/forkit.js You can see a demo here. http://lab.hakim.se/forkit-js/ This would probably be the same script they are using..
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25034087
answers question: http://stackoverflow.com/q/25034087
has comment: http://stackoverflow.com/comment/38934395
type: Answer
score: 1

http://stackoverflow.com/q/25063470
answer count: 1
has body: In chrome function but in IE10 return error for the variable name in the function, how I can have access to this variable from the function? $('.kpit').on('click', function() { var url = $(this).attr('id'); var name = $(this).attr('href'); $('.kpi').html(''); $.post(url, {idKpi: id}, function(result) { $(name).html(result); }); });
linked to: http://stackoverflow.com/q/4345427
favorite count: 0
has comment: http://stackoverflow.com/comment/38990523
has title: Error access variable form function
has comment: http://stackoverflow.com/comment/38990180
has comment: http://stackoverflow.com/comment/38989826
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25064260
tagged with: internet-explorer
tagged with: internet-explorer-10
downvote count: 1
type: Question
upvote count: 0
tagged with: javascript
tagged with: jquery
score: -1
accepted answer: http://stackoverflow.com/a/25064260
has comment: http://stackoverflow.com/comment/38991484

http://stackoverflow.com/q/24982196
has body: console.log(game.gameQuestions); The above code outputs: [Object, Object, Object]. I would like to somehow count the number of objects. When I try console.log(game.gameQuestions.count()); The console outputs : Exception from Deps recompute function: TypeError: undefined is not a function Additionally if I try: console.log(game.gameQuestions.length()); The console outputs : Exception from Deps recompute function: TypeError: number is not a function How do I count the number of objects within an attribute?
has title: Counting number of objects within a field of mongodb
has answer: http://stackoverflow.com/a/24982319
score: 0
answer count: 1
tagged with: mongodb
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24982319
type: AnsweredQuestion
tagged with: meteor
type: Question

http://stackoverflow.com/a/24921989
has comment: http://stackoverflow.com/comment/38724195
score: 5
has comment: http://stackoverflow.com/comment/38724501
has comment: http://stackoverflow.com/comment/38724412
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38724565
has comment: http://stackoverflow.com/comment/38724864
type: Answer
has comment: http://stackoverflow.com/comment/38724623
accepted answer of: http://stackoverflow.com/q/24921977
has comment: http://stackoverflow.com/comment/38724302
upvote count: 5
downvote count: 0
answers question: http://stackoverflow.com/q/24921977
has comment: http://stackoverflow.com/comment/38724463
has body: Change the button so it's just a button, not a submit button: Sign up By default, buttons are of the type submit which will cause the form itself to submit.

http://stackoverflow.com/q/24924073
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25519912
type: Question
tagged with: raspberry-pi
tagged with: javascript
has comment: http://stackoverflow.com/comment/38728091
tagged with: jquery
has title: JQuery misreading serverside csv file
has comment: http://stackoverflow.com/comment/38728520
score: 0
tagged with: http://stackoverflow.com/tag/csv
accepted answer: http://stackoverflow.com/a/25519912
answer count: 1
has comment: http://stackoverflow.com/comment/38727957
has comment: http://stackoverflow.com/comment/38846019
has body: I have written a program on the Raspberry Pi to read GPIO inputs and write them to a .csv file which is then read by a Javascript script and displayed on a webpage hosted on the Pi. The Pi polls the pins and writes to the file every 0.1 seconds and the script reads this file every 0.2 seconds and updates the webpage. The problem I am having is that sometimes the script will read the values as all zeroes rather than the actual numbers saved in the file without throwing any errors. This occurs randomly and sometimes the script does read the file correctly. refreshing the page, restarting apache and rebooting the Pi seem to have no effect. The fact that the script returns no errors leads me to believe the problem occurs before the script gets the file but viewing the file in cat shows the correct values. Anyone have any ideas? The relevant Javascript code: var csv_path = "/data/loads.csv"; function update_vars() { //get latest data var response = $.get(csv_path, function(data) { var csv_string = data; var res = csv_string.split("\n")[1].split(","); //parse values into variables ... }); Sample file contents: TV,AC,Oven,Light,Solar,inverter,inverter(controlled) 1,3,2,6,0,0,0 Sample Javascript log output: TV,AC,Oven,Light,Solar,inverter,inverter(controlled) 0,0,0,0,0,0,0

http://stackoverflow.com/q/24941668
type: Question
score: -1
has answer: http://stackoverflow.com/a/24941738
has body: If you were to run this code in Console on the page, you would get the value of the element- $('[name="__RequestVerificationToken"]').value But i'm having trouble running this in a get request (So I dont have to visit the page to get the value of that element). This is what i have so far (Which doesnt work): $.get( link, function (data){ console.log($('[name="__RequestVerificationToken"]').value); } );
answer count: 1
downvote count: 1
tagged with: javascript
has title: Reading information in a .get request
tagged with: get
accepted answer: http://stackoverflow.com/a/24941738
type: AnsweredQuestion
upvote count: 0
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/38934434
comment on: http://stackoverflow.com/q/25034229
has text: Code is fine, the problem is somewhere else. DOM ready?
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/38823064
type: Comment
has text: Adding the whole Order as a pre constructed array did the trick, thank you very much for the help.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24959569

http://stackoverflow.com/comment/38801875
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24963453
has text: Well yes - you're selector is simply `select` - it targets all `select` elements on the page. Use a common class if you wish to target a select few.

http://stackoverflow.com/a/24974074
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24974029
has body: As this question is a duplicate, I'll just answer to make the answer more clear. Create a php page like this: myFile.pdf.php &lt;?php header('Content-Disposition: attachment; filename="path/to/your/file.pdf"'); ?&gt; and if you call this page (e.g. http://domain.com/myFile.pdf) it will download the pdf file. Make sure this page and the actual file don't have the same exact name and location!

http://stackoverflow.com/q/24980067
tagged with: javascript
score: 0
upvote count: 1
answer count: 1
downvote count: 1
has body: I am trying to get an object which has the type SVGComponentTransferFunctionElement. Can someone show me an example (html) where the returned (created) output is of type SVGComponentTransferFunctionElement? More details on this type: http://msdn.microsoft.com/en-us/library/ie/hh973367%28v=vs.85%29.aspx
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: AnsweredQuestion
has title: How to get object type SVGComponentTransferFunctionElement
type: Question
has answer: http://stackoverflow.com/a/24981827
accepted answer: http://stackoverflow.com/a/24981827

http://stackoverflow.com/q/25039263
has answer: http://stackoverflow.com/a/25039468
has body: I am working on trying to assign a dynamic variable in Javascript within my template for URLs. This is to pass the data back to the page. At the moment this is hard coded. I'm stuck trying to figure out best way to fix this. Here is my code: JS function MyModule.init() { var myXHR = new XMLHttpRequest(), seconds = (new Date()).getTime(); // Load my data myXHR.addEventListener('readystatechange', function () { var preXHR = new XMLHttpRequest(), data; if (myXHR.readyState === 4) { data = JSON.parse(myXHR.responseText); timestamp = data['timestamp']; myData = data['my']; // Load rep data preXHR.addEventListener('readystatechange', function () { if (preXHR.readyState === 4) { repData = JSON.parse(preXHR.responseText)['reps']; organizeData(); showMYTable(); } }); // This hardcoded path is what I am trying to change, as it is bad preXHR.open('GET', '/catalog/1/my-reps?t=' + seconds); preXHR.send(); } }); // This hardcoded path is what I am trying to change, as it is bad myXHR.open('GET', '/catalog/1/my-data?t=' + seconds); myXHR.send(); TEMPLATE &lt;script&gt; $(function(){ MyModule.init('{% url catalog.data %}'); }); &lt;/script&gt; URL url(r'^(?P&lt;company&gt;.+)/(?P&lt;name&gt;.+)', 'data', name='catalog.data')
tagged with: javascript
tagged with: django-urls
score: 0
answer count: 1
accepted answer: http://stackoverflow.com/a/25039468
has title: Assigning a dynamic variable in Javascript in a template for URLs
tagged with: django
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/24942313
has comment: http://stackoverflow.com/comment/38767566
has comment: http://stackoverflow.com/comment/38766545
has comment: http://stackoverflow.com/comment/38765113
type: Question
tagged with: javascript
score: 0
has title: I'm interrupting an repeating jquery animation with stop() so that hover will prevent a carousel from moving, however, it stops the animation itself
tagged with: jquery
has body: Everything works on this carousel except for that the stop() applies during the animation when it's sliding, is there a way for it to prevent the animation from occurring on hover (as it is now) and not when it's during the sliding animation effect? var roundabout = setInterval(function(){ spin() }, 3000); function spin(){ var kerosene = document.getElementById('carousel-frame-holder'); var s = kerosene.offsetLeft; if (s &gt;= -1700 ){ $("#carousel-frame-holder").animate({left: (s - 600 +'px')}); } else{ $("#carousel-frame-holder").animate({left: (s + 1800 +'px')}); }; // interruption $('#carousel-view-window').hover(function(){ //Stop Animation here $("#carousel-frame-holder").stop(); clearInterval(roundabout); }, function(){ //Restart Animation here roundabout = setInterval(function(){spin()}, 3000); }); //end interruption var carouselInerta = s; $('#bastion').html(carouselInerta); //location 1 if (s == -1800) {$('#f1').addClass('active')} else {$('#f1').removeClass('active')} //location 2 if (s == 0) {$('#f2').addClass('active')} else {$('#f2').removeClass('active')} //location 3 if (s == -600) {$('#f3').addClass('active')} else {$('#f3').removeClass('active')} //location 4 if (s == -1200) {$('#f4').addClass('active')} else {$('#f4').removeClass('active')} }; //wrap-round $('#nav-left').click(function(){ var kerosene = document.getElementById('carousel-frame-holder'); var s = kerosene.offsetLeft; if (s &lt;= -1 ){ $("#carousel-frame-holder").animate({left: (s + 600 +'px')}); } else { $("#carousel-frame-holder").animate({left: (s - 1800 +'px')}); }; }); $('#nav-right').click(function(){ var kerosene = document.getElementById('carousel-frame-holder'); var s = kerosene.offsetLeft; if (s &gt;= -1700 ){ $("#carousel-frame-holder").animate({left: (s - 600 +'px')}); } else { $("#carousel-frame-holder").animate({left: (s + 1800 +'px')}); }; }); //location $("#f1").on("click", function(){ {$('#f1').addClass('active')} {$('#f2').removeClass('active')} {$('#f3').removeClass…
type: UnansweredQuestion
tagged with: animation
tagged with: css
answer count: 0

http://stackoverflow.com/q/24997875
has answer: http://stackoverflow.com/a/24998393
tagged with: spam
has comment: http://stackoverflow.com/comment/38866986
tagged with: php
answer count: 4
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24998280
has body: I have taken over the maintenance of a website which was built by someone else. This site is mainly HTM/CSS, however it uses the odd javascript code along with PHP which was implemented by a back-end programmer that was contracted in. The issue I'm having is this - the site consists of a lot of pages, each one with its own unique e-mail form. Each one of these forms were created without concern for spam. Now these forms are receiving a ton of spam, and I am expected to rectify the issue (regardless of the fact that I am neither a Javascript nor PHP programmer). I need some help, as I can't try and guesstimate a solution due to the importance of this e-mail system. I'm hoping I can post the code up and have someone guide me through the process of implementing a honeypot or an easy mathematical equation (I know that isn't 100% foolproof, but these are just poorly made spambots, and this site likely won't be actively targeted). The Form Page: This page consists of some PHP, some Javascript but mostly just content which I will avoid posting as it is of little importance. However, I'll post the scripts in order. (Also, the productformvalidation.js file is a simple Javascript script that throws pop-up messages if the e-mail/phone number doesn't have correct characters. I can provide that too if necessary) <?php /* validation function for when they press the submit button */ function validateFields($fields, $form_vars) { $errors = array(); foreach($fields as $field_name => $error_msg) { $value_entered = trim(@$form_vars[$field_name]); if(empty($value_entered)) { $errors[$field_name] = $error_msg; } } return $errors; } function safe($str) { return htmlentities(strip_tags($str)); } ?> Name: (required) Email: (required) Phone: (required) Company: (required) The "Action" Page: <?php $date1=date("F d,Y"); $nameField=$_POST['name']; $companyField=$_POST['company']; $countryField=$_POST['country']; $stateField=$_POST['state']; $emailField=$_POST['email']; $phoneField=$_POST['phon…
has title: Trying to Implement a Simple Spam Blocker
type: Question
has comment: http://stackoverflow.com/comment/38867197
has answer: http://stackoverflow.com/a/70609555
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24998304
has answer: http://stackoverflow.com/a/24998304
tagged with: spam-prevention
score: 0
has comment: http://stackoverflow.com/comment/38866521
has answer: http://stackoverflow.com/a/24998280
tagged with: email
linked to: http://stackoverflow.com/q/2530

http://stackoverflow.com/comment/38701674
has text: as you are having just one jsp, try using GET method in form instead of POST method.
type: QuestionComment
comment on: http://stackoverflow.com/q/24910466
score: 0
type: Comment

http://stackoverflow.com/a/24965958
has comment: http://stackoverflow.com/comment/38807870
answers question: http://stackoverflow.com/q/24965699
has comment: http://stackoverflow.com/comment/38819690
accepted answer of: http://stackoverflow.com/q/24965699
has body: Useing jQuery: Put your php script into a separate file. I'll call it script.php Here is what your LoadThread function should look like. LoadThread(id) { var jsID = id; $().ajax({ url: "www.josecaballero.tk/location/of/script.php", type: 'POST', data:{ID: jsID }, success: function(result){ document.getElementById('textContent').innerHTML = result; } }); }; Your PHP should look like this: require_once ("select_on_click.php"); $ID = $_POST["ID"] $varMakeQuerys3 = new Make_Querys; $varMakeQuerys3-&gt;SendQuery("SELECT * FROM Threads WHERE idThread=\""."".$ID.""."\""); echo json_encode($varMakeQuerys3-&gt;LoadThread());
has comment: http://stackoverflow.com/comment/38819644
score: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38809513
has comment: http://stackoverflow.com/comment/38807315
type: Answer

http://stackoverflow.com/comment/38880230
type: QuestionComment
has text: Here's a fiddle that will do what you're after, but as Dominic says - id: 3 is not actually identical, so comparing the objects wont help. You might just need to compare id, text and whether or not there are any children (regardless of what they are). If you're after exact matches, [this fiddle](http://jsfiddle.net/scrowler/u6kLt/) might help you.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25004895

http://stackoverflow.com/comment/38749383
comment on: http://stackoverflow.com/a/24935585
type: Comment
has text: It is much more complicated than this to create a dropdown that is actually useful and does not create more problems than it solves. OP should use a ready solution that is professionally built.
score: 0
type: AnswerComment

http://stackoverflow.com/a/24936871
downvote count: 0
type: Answer
has body: Did you look into the transpiled coffee code? When using something like dbHandler:(err, row)-&gt; a JSON-Object with the property dbHandler is generated. This is why you cannot pass dbHandler and dbFinal to the db.each call. This only works when defining a class. Additionally, you got an unmatched bracket in the line 10 and a bracket too much in the last two lines. You should always check the compiled code (respectively check whether it even compiles). Here is a helpful site for this. There, you can even convert your JS code to coffeescript.
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24935524
accepted answer of: http://stackoverflow.com/q/24935524
type: AcceptedAnswer

http://stackoverflow.com/q/24932829
has comment: http://stackoverflow.com/comment/38743827
has comment: http://stackoverflow.com/comment/38744724
has answer: http://stackoverflow.com/a/24933075
has body: I have a form that takes three steps to fill it. At each of these steps you fill some info, click "Next" and then see either errors you have to fix in order to get to the next step or if there are no errors it takes you to the next step (change "display" to "block" in CSS). At first step it uses $.ajax() to call file lib/ajax.php which returns some results in JSON that matter a lot to filling the rest of the form. The thing is this works locally on my http://my.dev address, but live on https://something.example.com it does not. Where should I first try looking to go about it? What are the most common workarounds on this? Both lib/ajax.php and the index.php file (that has the jQuery call) are on the same domain (https://something.example.com) so we are not talking about cross-domain calls. Here's some of the code. $.ajax({ type: 'GET', url: 'lib/ajax.php', async: false, data: {id: id}, dataType: 'json', // what type of data do we expect back from the server }).done(function(data){ // do stuff with data }); and the lib/ajax.php //stuff with db and retrieving row by id header('Content-type: application/json'); echo json_encode($result); That's pretty much it. It doesn't work when I place it on live HTTPS server.
tagged with: https
type: Question
has answer: http://stackoverflow.com/a/24933166
has comment: http://stackoverflow.com/comment/38745231
has comment: http://stackoverflow.com/comment/38745037
tagged with: javascript
tagged with: jquery
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38744533
answer count: 2
has comment: http://stackoverflow.com/comment/38744509
has comment: http://stackoverflow.com/comment/38744456
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38743763
has comment: http://stackoverflow.com/comment/38743962
has title: jQuery Ajax call on HTTPS
tagged with: php
has comment: http://stackoverflow.com/comment/38744862
has comment: http://stackoverflow.com/comment/38744157
has comment: http://stackoverflow.com/comment/38744611
has comment: http://stackoverflow.com/comment/38745373

http://stackoverflow.com/comment/38951488
type: AnswerComment
has text: @Fustigador You didn't understand what I said, I am not asking you to create an array, instead you change the param name, add "[]" to end as part of the param name, you should enclosed it like this "ids[]", inside the double quota.
comment on: http://stackoverflow.com/a/25021877
type: Comment
score: 0

http://stackoverflow.com/q/25008427
has title: Nesting AJAX and user events
has comment: http://stackoverflow.com/comment/38886239
has answer: http://stackoverflow.com/a/25008718
tagged with: javascript
has body: I have a mini project where I need to do an ajax call against a relatively slow server, take user input, and then process the ajax response with the user input. Because it takes a while for the AJAX call to complete, I began the call as soon as the document loaded. In theory, it should be done by the time the user is done with their input. This is kind of how I have it setup at the moment: $(document).ready(function() { var table = $.ajax({ . . . }); $('#btn').click(process(table)); }; function process(jqXHR) { //code not dependent on AJAX call var table = jqXHR.done(function(data) { return data; }); //code that is dependent on AJAX call } The idea is that I keep the AJAX call asynchronous, but at a certain point I need it to be complete before I can fire off the rest of my code. I thought that jqXHR.done() nested under an onClick() event might be what I'm looking for, but it looks like jqXHR.done() fires regardless of where I put the handler. So, is there a way to to keep everything running asynchronously up until a certain point, then wait until the AJAX call is finished to continue executing a block of code? --edit-- I have considered trying to somehow implement callbacks to do it, but honestly I have no idea how to link callbacks from 2 different co-dependent event handlers. The co-dependent nature of it is what is really confusing me.
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25008718
has comment: http://stackoverflow.com/comment/38886347
answer count: 2
downvote count: 0
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38886127
upvote count: 2
has comment: http://stackoverflow.com/comment/38886278
has answer: http://stackoverflow.com/a/25008835
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25008835
type: Question

http://stackoverflow.com/a/24993157
upvote count: 7
type: AcceptedAnswer
type: Answer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24993081
score: 7
answers question: http://stackoverflow.com/q/24993081
has body: reset() is a DOM method so use it on DOM object $f[0]

http://stackoverflow.com/comment/38947444
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25040111
has text: You answer is good for a beginning it excludes the span tag which is what I wanted but it selects all the text. I need only certain word or part of word, for example in your example I want to select only blo. How I need to modify your regex?
score: 0

http://stackoverflow.com/comment/38800918
comment on: http://stackoverflow.com/a/24962879
type: AnswerComment
type: Comment
has text: Sorry for confusion. updated the question. I wanted to add CartHeader.cshtml not just a class
score: 0

http://stackoverflow.com/comment/39001934
type: QuestionComment
has text: Your margin is in percentage. Try using a fixed value.
type: Comment
comment on: http://stackoverflow.com/q/25069594
score: 0

http://stackoverflow.com/comment/38756907
score: 0
type: Comment
has text: can you please provide as an example
type: AnswerComment
comment on: http://stackoverflow.com/a/24939522

http://stackoverflow.com/q/25003167
has answer: http://stackoverflow.com/a/25003565
downvote count: 1
linked to: http://stackoverflow.com/q/14312955
type: Question
has answer: http://stackoverflow.com/a/25003366
has comment: http://stackoverflow.com/comment/38876907
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25003366
has comment: http://stackoverflow.com/comment/38876888
tagged with: class
has comment: http://stackoverflow.com/comment/38876628
answer count: 3
linked to: http://stackoverflow.com/q/111102
accepted answer: http://stackoverflow.com/a/25003565
has comment: http://stackoverflow.com/comment/38876227
has comment: http://stackoverflow.com/comment/38883853
has answer: http://stackoverflow.com/a/25009308
favorite count: 0
has comment: http://stackoverflow.com/comment/38889342
linked to: http://stackoverflow.com/q/16063394
has body: For the longest time i have been doing JavaScript classes by doing the following function MyClass(){ this.v1; this.foo = function(){ return true; } }; Then i found TypeScript and it looks like it compile its Classes down to var MyClass = (function () { function MyClass(message) { this.v1 = message; } MyClass.prototype.foo = function () { return "Hello, " + this.v1; }; return MyClass; })(); Another Method i have found a lot on the web is var MyClass = { v1:1, foo: function(){ return true; } }; This looks ugly to me but maybe i'm missing something beneficial with this method, as it looks to be the way most people on the web do objects in javaScript. The first method i'm able to do inharitance from a function i made. Function.prototype.extends = function(parent){ this.prototype = new parent(); this.prototype.constructor = this; }; I have also seen many other methods on making classes in JavaScript. I would like to know if my method is wrong or if there is a best practice method in doing OOP. All of my projects I have done use the first example. You can see on https://github.com/Patrick-W-McMahon now that I see what JavaScript compilers are doing i'm starting to question my methods. I would like to know what other JavaScript programmers advise is the best method and if there is a difference between the methods. I came from a C++/Java background and as such I write my JavaScript to match my background.
type: AnsweredQuestion
has title: javascript different OOP methods standards
tagged with: oop
score: 0
has comment: http://stackoverflow.com/comment/38878407
upvote count: 1
tagged with: methods

http://stackoverflow.com/q/25010597
has title: Optimalize jQuery .each - hiding options in DropDownList
accepted answer: http://stackoverflow.com/a/25013894
type: AnsweredQuestion
tagged with: twitter-bootstrap
has answer: http://stackoverflow.com/a/25014891
has answer: http://stackoverflow.com/a/25013894
has comment: http://stackoverflow.com/comment/38893907
tagged with: each
type: Question
has body: I have 2 optionsets. When ddlProduct is changed i hide and show some options in ddlPackage. Mapping between Product and Package is in value in each package option. Like this &lt;select name="ctl00$MidContent$ddlPackage" class="selectpicker" id="ddlPackage" style="display: none;" data-width="100%" data-style="btn-own btn-select hideDisabled"&gt; &lt;option value="134260004;Administrace;AXAPTA"&gt; I'm splitting this string and comparing if last part to currently selected Product. For DropDownList is used bootstrap extension: bootstrap-select http://silviomoreto.github.io/bootstrap-select/. But it is too slow. Expecialy in IE. $("#ddlProduct").change(function () { var product = $("#ddlProduct option:selected").text().trim(); $("#ddlPackage option").each(function () { var optValues = $(this).val().split(";"); var opt2 = optValues[2].trim(); if (opt2 == "") { $(this).show(); } else { if (opt2 == product) { $(this).show(); } else { $(this).hide(); } } }); $("#ddlPackage").val($("#ddlPackage option:first").val()); $("#ddlPackage").selectpicker('refresh'); &lt;asp:Panel ID="Panel39" runat="server" CssClass="row"&gt; &lt;asp:Panel ID="Panel40" runat="server" CssClass="row compenserow col-lg-4 col-md-4 col-sm-6"&gt; &lt;asp:Label ID="Label29" runat="server" CssClass="col-lg-4 col-md-4 col-sm-4 col-xs-4"&gt;Prudukt: &lt;/asp:Label&gt; &lt;asp:Panel ID="Panel63" runat="server" CssClass="bootstrap-select col-lg-8 col-md-8 col-sm-8 col-xs-8"&gt; &lt;asp:DropDownList ID="ddlProduct" data-style="btn-own btn-select" data-width="100%" runat="server" CssClass="selectpicker" ClientIDMode="Static"&gt;&lt;/asp:DropDownList&gt; &lt;/asp:Panel&gt; &lt;/asp:Panel&gt; &lt;asp:Panel ID="Panel41" runat="server" CssClass="row compenserow col-lg-4 col-md-4 col-sm-6"&gt; &lt;asp:Label ID="Label31" runat="server" CssClass="col-lg-4 col-md-4 col-sm-4 col-xs-4"&gt;Balík: &lt;/asp:Label&gt; &lt;asp:Panel ID="Panel64" runat="server" CssClass="bootstrap-select col-lg-8 col-md-8 col-sm-8 col-xs-8"&gt; …
has comment: http://stackoverflow.com/comment/38892223
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38890356
has comment: http://stackoverflow.com/comment/38892081
has comment: http://stackoverflow.com/comment/38890370
possible better answer: http://stackoverflow.com/a/25014891
tagged with: bootstrap-select
tagged with: jquery

http://stackoverflow.com/a/25040371
answers question: http://stackoverflow.com/q/25040230
upvote count: 1
has comment: http://stackoverflow.com/comment/39051712
type: Answer
downvote count: 0
score: 1
has body: The encoding of that file is most likely not UTF-8, unlike your other files. To change it in Visual Studio (at least in VS 2013) go to File &gt; Advanced Save Options.

http://stackoverflow.com/comment/39010165
type: QuestionComment
comment on: http://stackoverflow.com/q/25059979
has text: @runTarm thanks for taking the time, that may be something like that
score: 0
type: Comment

http://stackoverflow.com/comment/38908420
type: Comment
comment on: http://stackoverflow.com/q/25020016
score: 0
type: QuestionComment
has text: @MuhammadAli *Ah*, yes. I think that's what the OP should be using; most likely, since he/she is using `display:none`, that could work.

http://stackoverflow.com/a/25057043
type: AcceptedAnswer
has body: Just try with: function exists(str, arr) { var parts = str.split('.'); for (var i = 0; i &lt; parts.length; i++ ) { if (arr.hasOwnProperty(parts[i])) { arr = arr[parts[i]]; } else { return false; } } return true; }
type: Answer
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25056953
answers question: http://stackoverflow.com/q/25056953
upvote count: 2

http://stackoverflow.com/comment/38869094
score: 0
type: Comment
type: QuestionComment
has text: Thanks for the notice Charles, will do so in future posts!
comment on: http://stackoverflow.com/q/24980403

http://stackoverflow.com/comment/38918158
comment on: http://stackoverflow.com/a/25019808
type: Comment
has text: +1, a capture group is the way to go. Maybe the downvote is because it's not 100% clear from the question that `annaheimkreiter` is what CodeToad wants: on the one hand it is in bold; on the other hand he says he wants the string after `.com`, which would be `photos`. (In that case Code Toad it's a tiny tweak to anubhava's regex: `m=s.match(/\/flickr\.com\/([^/]+)/)`)
type: AnswerComment
score: 1

http://stackoverflow.com/comment/38742300
type: QuestionComment
has text: "howManyScenarios" creates an array [Scenario 1, Scenario 2, etc] which I then iterate through in "createScenarios". The reason I'm doing it that way is because I don't know how many scenarios I might decide to use, so I don't want to build them all out separately. Tried to declare each var i and that didn't work. It does properly iterate through each scenario, but then i resets to 0 for some reason and it starts over at Troll
score: 0
comment on: http://stackoverflow.com/q/24923751
type: Comment

http://stackoverflow.com/comment/38757670
type: AnswerComment
has text: `var selFocus = function() { console.log("a"); var txt = $(this); $(this).off("focus.fcs").blur(); window.setTimeout( function(){ txt.selectRange(6,15).on("focus.fcs", selFocus);; },10); }; `
type: Comment
comment on: http://stackoverflow.com/a/24939704
score: 0

http://stackoverflow.com/comment/38766992
comment on: http://stackoverflow.com/q/24944738
type: QuestionComment
type: Comment
has text: Here's a general rule that every programmer should learn immediately after they write their first 'hello world' program. If you find yourself writing `var1`, `var2`, etc. you should probably using arrays (or something similar) instead.
score: 1

http://stackoverflow.com/a/25038022
answers question: http://stackoverflow.com/q/25037822
has body: Well, when you have a container width a smaller size than the image is. Say 20px by 20px. Then you set the sprite image as background image: style="background-image: no-repeat 0px 0px url(sprite.png)"; Now only the first image in thh sprite will show, the others are hidden. When you want to show the second, move the image 20px up: style="background-position: 0px -20px"; In CSS you can set this to classes: .icon-folder, .icon-pdf, .icon-file { background-image: no-repeat 0px 0px url(sprite.png); } .icon-pdf { background-position: 0px -20px; } .icon-file { background-position: 0px -40px; }
upvote count: 1
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38840080
comment on: http://stackoverflow.com/a/24983729
has text: Thanks, but seems like if I put another caption in other post it duplicates like this: http://jsfiddle.net/U6Qd3/1/ Do you know any solution for this?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24965685
answers question: http://stackoverflow.com/q/24965615
has body: It seems like the content is still being loaded via the AJAX call while that code is running (hence getElement returning null). I would suggest using a callback like ajaxComplete on the request that calls getAnchor and scrollToDiv then you're guaranteed the content is there.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38806553

http://stackoverflow.com/comment/39068106
comment on: http://stackoverflow.com/a/25053653
type: Comment
has text: @JVT if you think this answer was helpful, you can also upvote it. :)
score: 0
type: AnswerComment

http://stackoverflow.com/q/25027547
has answer: http://stackoverflow.com/a/25027658
has title: How to use ng-if in angularJS
has comment: http://stackoverflow.com/comment/38922696
has body: I have used angularJS and i wonder how to use its if statement like this way. I don't know if my question is right but i just want to explain it through my example. I have if like this.. 0"> //some html div's here with angularJS //some html div's here with angularJS I have a code like that.. that //some html div's here with angularJS have common codes the only thing that deferent is the red and blue color in the container.. I think it is redundant to use that kind of code.. is it possible to use same that //some html div's here with angularJS for both if? I tried like this. 0"> `//some html div's here with angularJS` but there's no output.. Thanks for help.. I know my question is different from what i want.. but i don't really have an idea how to ask it..
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25028017
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38922766
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25027658
possible better answer: http://stackoverflow.com/a/25028017
has comment: http://stackoverflow.com/comment/38922637
type: Question

http://stackoverflow.com/comment/38765883
comment on: http://stackoverflow.com/q/24943255
score: 0
has text: This is a screen shot I took from my chrome console : http://s28.postimg.org/o9axv9mm5/b64.png
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/41498523
type: Comment
type: QuestionComment
score: 0
has text: Similar to reported [Issue 2877](https://code.google.com/p/google-apps-script-issues/issues/detail?id=2877).
comment on: http://stackoverflow.com/q/24956775

http://stackoverflow.com/q/25055478
linked to: http://stackoverflow.com/q/18119721
type: AnsweredQuestion
has title: How to add column to a table using javascript and take the column name from a textbox?
has comment: http://stackoverflow.com/comment/38976722
tagged with: dynamic
has comment: http://stackoverflow.com/comment/38975570
type: Question
has body: I wrote this code to add column to a table using javascript and take the column name from a html textbox. But this is not working. JavaScript :- HTML :- Employee ID Employee Name Basic Salary Mobile Allowances Travel Allowences Internet Allowences Sales Commission Bonus Net Salary <?php $sql1="SELECT user_id, user_fname, user_lname FROM ".$prefix."users_info WHERE user_st='1'"; $employee_info = $wpdb->get_results($sql1); //var_dump($employee_info); foreach ($employee_info as $employee_info_row) { $user_id = $employee_info_row->user_id; $user_fname = $employee_info_row->user_fname; $user_lname = $employee_info_row->user_lname; echo " "; echo " "; echo "$user_id"; echo " "; echo " "; echo "$user_fname $user_lname"; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; echo ""; echo " "; echo " "; } ?> Add new column I also want to add the new column between 'Internet Allowences' and 'Sales Commission'. Can anyone pls tell me how to do that. Thank You
tagged with: javascript
has answer: http://stackoverflow.com/a/25071961
has comment: http://stackoverflow.com/comment/38976306
has comment: http://stackoverflow.com/comment/38974945
score: 0
has comment: http://stackoverflow.com/comment/38974985
answer count: 1
tagged with: jquery
linked to: http://stackoverflow.com/q/1655319
has comment: http://stackoverflow.com/comment/39005654
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25071961

http://stackoverflow.com/comment/38719586
type: Comment
has text: File contents looks correct. Is the path to the file correct? Read these articles to [learn](http://juliepagano.com/blog/2014/05/18/javascript-debugging-for-beginners) [how to](http://www.creativebloq.com/javascript/javascript-debugging-beginners-3122820) [**debug** JavaScript](https://developers.google.com/chrome-developer-tools/docs/javascript-debugging), so you can provider more useful context information (and help yourself).
comment on: http://stackoverflow.com/q/24915304
score: 0
type: QuestionComment

http://stackoverflow.com/a/24997626
answers question: http://stackoverflow.com/q/24984618
type: Answer
has comment: http://stackoverflow.com/comment/38875783
upvote count: 1
has comment: http://stackoverflow.com/comment/69081012
downvote count: 0
has body: So since you're using remotes images you can use the following fix doing some modifications in your script: function getPNGBase64forHtml() { var imageString; html2canvas(document.body, { useCORS: true, logging : true, //Enable log (use Web Console for get Errors and Warnings) proxy :"html2canvasproxy.php", onrendered: function(canvas) { var img = new Image(); img.onload = function() { img.onload = null; document.body.appendChild(img); }; img.onerror = function() { img.onerror = null; if(window.console.log) { window.console.log("Not loaded image from canvas.toDataURL"); } else { alert("Not loaded image from canvas.toDataURL"); } }; imageString = canvas.toDataURL('image/png'); } }); return imageString; } If you are using php then the proxy setting must use the following script: html2canvas-php-proxy Otherwise with .NET projects you can use these script resources: html2canvas proxy with asp-classic - vb html2canvas proxy with asp.net - csharp If you decided to use local images this bug will not appear. Hope it works for you, here is the original thread for this html2canvas bug https://github.com/niklasvh/html2canvas/issues/145
score: 1

http://stackoverflow.com/q/25000752
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25001042
tagged with: jquery
has comment: http://stackoverflow.com/comment/38871992
tagged with: ajax
has comment: http://stackoverflow.com/comment/38871519
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38871881
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38871635
has title: JQuery returning [object Object]
has comment: http://stackoverflow.com/comment/38871672
type: Question
has body: I'm doing an calendar, and i created a page to show the events from a certain day. I'm using Ajax because i dont want my users to reload the page everytime that a new event is created. So, i'm using Json encode to get the values from an array, and everytime that i print a day with two events, i receive this: [{"event_day":"9","event_name":"test"}, {"event_day":"9","event_name":"test2"}] But when i try to print the elements in JQuery to put inside an element, i receive [object Object] I inserted the array inside a while loop because i'm getting multiple rows from my database table. PHP function function eventPrint($list_day, $month, $year){ $select = mysql_query("SELECT * FROM events WHERE event_day = '".$list_day."' AND event_month = '".$month."' AND event_year = '".$year."'") or die(mysql_error()); $data = array(); while($row = mysql_fetch_assoc($select)) { $event_day = $row['event_day']; $event_name = $row['event_name']; $data[] = array('event_day' =&gt; $event_day, 'event_name' =&gt; $event_name ); } echo json_encode($data); } Ajax $.ajax({ type: 'get', url: "modules/groups/new.php", data: { 'list_day': getday, 'month': getmonth, 'year': getyear, 'action': 'selection' }, success: function (response) { var obj = jQuery.parseJSON(response); $('.' + getmonth).html(obj.event_day); } });
tagged with: javascript

wijmo
type: Tag
tags question: http://stackoverflow.com/q/24938215
tag name: wijmo

http://stackoverflow.com/q/24957685
has comment: http://stackoverflow.com/comment/38790487
type: Question
score: -2
has title: Is there any way to get an object from a json object that has an unpredictable key/name?
tagged with: javascript
has body: JSON object: { "users": { "1403365934870556481": { "userId": "1403365934863466416", "id": "1403365934870556481", "relationType": "CHILD", "nickname": "Nameson", "active": "1", "created": "2014-06-21 16:52:14", "relationDetails": { "userId": "1403365934863466416", "title": "UNSELECTED", }, "hasFinanceAccount": true }, "1406296959993232380": { "userId": "1406296959978437904", "id": "1406296959993232380", "relationType": "CHILD", "nickname": "Izzy", "active": "1", "created": "2014-07-25 15:02:39", "relationDetails": { "userId": "1406296959978437904", "title": "UNSELECTED", }, "hasFinanceAccount": true } } } Scheme of the object: --&gt; somenumber -&gt; obj obj-&gt;users --&gt; somenumber -&gt; obj The only thing I can think is parse that object as string and replace the number with something else any suggestion? My Solution is: var tmp = JSON.stringify( currentPageData.getChildren ); tmp = t.replace(/[\d]+\"\:\{\"userId/g, 'child":{"userId'); myobj = JSON.parse(tmp);
answer count: 2
downvote count: 2
has answer: http://stackoverflow.com/a/24957715
has comment: http://stackoverflow.com/comment/38790511
has answer: http://stackoverflow.com/a/24957806
has comment: http://stackoverflow.com/comment/38790539
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38790881
upvote count: 0
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38791059

http://stackoverflow.com/a/25002130
answers question: http://stackoverflow.com/q/25002094
has body: Well, you can use the ternary operator: var asbMax = max &gt; 100000 ? 100000 : max; As a suggestion to prevent further typos on the allowed maximum: var allowedMax = 100000; var asbMax = max &gt; allowedMax ? allowedMax : max; See: MDN – Conditional (ternary) Operator
type: Answer
upvote count: 4
downvote count: 0
score: 4

http://stackoverflow.com/comment/38947846
type: QuestionComment
has text: "it didnt worked" is extremely vague
type: Comment
comment on: http://stackoverflow.com/q/25041126
score: 0

http://stackoverflow.com/comment/38795376
score: 0
type: Comment
type: QuestionComment
has text: I updated the code you posted in your question. try using that instead
comment on: http://stackoverflow.com/q/24958660

http://stackoverflow.com/comment/39027873
score: 0
comment on: http://stackoverflow.com/a/25013838
type: AnswerComment
type: Comment
has text: Thank you Itay, a small improvement to your code will just be to omit the http:

http://stackoverflow.com/a/24940176
accepted answer of: http://stackoverflow.com/q/24939934
has comment: http://stackoverflow.com/comment/38759921
answers question: http://stackoverflow.com/q/24939934
upvote count: 2
has comment: http://stackoverflow.com/comment/38759544
type: AcceptedAnswer
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38758549
has body: Hi i have created a jsfiddle example:- var setIntervals = function (start, end, inc) { start = start.toString().split(':'); end = end.toString().split(':'); inc = parseInt(inc, 10); var pad = function (n) { return (n &lt; 10) ? '0' + n.toString() : n; }, startHr = parseInt(start[0], 10), startMin = parseInt(start[1], 10), endHr = parseInt(end[0], 10), endMin = parseInt(end[1], 10), currentHr = startHr, currentMin = startMin, previous = currentHr + ':' + pad(currentMin), current = '', r = []; do { currentMin += inc; if ((currentMin % 60) === 0 || currentMin &gt; 60) { currentMin = (currentMin === 60) ? 0 : currentMin - 60; currentHr += 1; } current = currentHr + ':' + pad(currentMin); r.push(previous + ' - ' + current); previous = current; } while (currentHr !== endHr); return r; }; click here to see example:-http://jsfiddle.net/w6EQ6/3/ or if you don't want to print the range then see the below given link:- http://jsfiddle.net/w6EQ6/6/ fixed the issue:http://jsfiddle.net/w6EQ6/8/
downvote count: 0
has comment: http://stackoverflow.com/comment/38760200
has comment: http://stackoverflow.com/comment/38758198
has comment: http://stackoverflow.com/comment/38758641

http://stackoverflow.com/comment/38997601
type: Comment
comment on: http://stackoverflow.com/a/25065646
has text: The extra selector should make it more efficient. `$(".viewbio")` selects *all* of the elements with this class. `$(".viewbio:contains('HIDE BIO')")` will cut down on run time, not by a lot, but it's good practice to make your javascript fast.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24947156
has answer: http://stackoverflow.com/a/24947212
downvote count: 0
has answer: http://stackoverflow.com/a/57430854
tagged with: javascript
score: 50
possible better answer: http://stackoverflow.com/a/56483533
has body: I have a JSON response object which contains a percentage value. For example: { completionPercent: 42 } The UI result I'm aiming for is: ┌──────────────────────────────────────────────────┐ |█████████████████████ | └──────────────────────────────────────────────────┘ The JSON object is used as the ng-model of an element in AngularJS. Now I want to bind the completionPercent as the width of an element in AngularJS. But CSS width expects a String like '42%', not a Number. So the following does not work: &lt;div id="progressBackground" ... &gt; &lt;div id="progressBar" ng-model="..." ng-style="{ 'width': completionPercent }" ... &gt;&lt;/div&gt; &lt;/div&gt; Currently, I have this working by generating the entire style in the controller: ng-style="getStyleFromCompletionPercent()" But this is not a good idea, as it becomes very difficult to extend the ng-style. Is there another way to implicitly specify that the width is in percent? Something like this would be ideal: ng-style="{ 'width-percentage': completionPercent }"
upvote count: 50
has answer: http://stackoverflow.com/a/56483533
tagged with: css
answer count: 4
favorite count: 0
accepted answer: http://stackoverflow.com/a/24947212
tagged with: data-binding
has comment: http://stackoverflow.com/comment/38771496
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38771463
has answer: http://stackoverflow.com/a/32887969
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has title: Setting HTML element width using ng-style and percentage value in AngularJS
type: Question

http://stackoverflow.com/q/24983211
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/24983284
has comment: http://stackoverflow.com/comment/38838686
type: UnansweredQuestion
has body: I have an input that is empty after page load, and if a user suddenly fill a value on it the value of the two inputs on the if condition should change to. My problem is when I fill an input, the if condition result doesn't changed in real time. script: $(document).ready(function(){ var countTimerEmailName = setInterval( function () { emailName(); }, 500); function emailName(){ if($('#emailCodeResult').val() != '' || $('#email').val() == ''){ clearInterval(countTimerEmailName); } $.ajax({ url:"view.php", type:"GET", data: { term : $('#email').val() }, dataType:"JSON", success: function(result) { } }); }; });
has title: How to continuously check the value of an input using jquery?
tagged with: if-statement
type: Question
score: 5
upvote count: 5
has answer: http://stackoverflow.com/a/24983295
downvote count: 0
has comment: http://stackoverflow.com/comment/38838657
has comment: http://stackoverflow.com/comment/38838724
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/75257439
answer count: 3

http://stackoverflow.com/comment/38963354
type: Comment
has text: What do you want your output to look like? I might have misread your question.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25049132

http://stackoverflow.com/a/25043869
answers question: http://stackoverflow.com/q/25043826
score: 4
has comment: http://stackoverflow.com/comment/38954120
has comment: http://stackoverflow.com/comment/38966796
has comment: http://stackoverflow.com/comment/38953652
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38953478
has comment: http://stackoverflow.com/comment/38953047
has comment: http://stackoverflow.com/comment/38954172
has body: CSS does not provide a selector for the nth element matching some complex selector. jQuery makes up for this with the :eq() selector: $("#myId &gt; li:nth-child(2) &gt; a:eq(8)") Note that :eq() is 0-indexed, unlike :nth-child() which is 1-indexed, so this will return the ninth element that matches the selector #myId &gt; li:nth-child(2) &gt; a. The equivalent XPath, should you choose to use that instead, is: (id('myId')/li[2]/a)[9] Your situation is unique, however, because if we assume that #myId is unique, as it should be, then you can use the CSS pseudo-class :nth-of-type() to find the ninth a child of the second li child of the element #myId: $("#myId &gt; li:nth-child(2) &gt; a:nth-of-type(9)") Note that :nth-of-type() and :eq() are not the same. :nth-of-type() behaves much like :nth-child() in that it considers children of the same parent, except that it looks at the element type, or the tag name. In this case, the element type we're concerned with is a. The use of &gt; combinators in your existing selector implies a parent-child relationship between your li and a elements, which is compatible with the :nth-of-type() selector. This is why I believe it can be used in your specific situation.
has comment: http://stackoverflow.com/comment/38953465
type: Answer
has comment: http://stackoverflow.com/comment/38953940
has comment: http://stackoverflow.com/comment/38960176
has comment: http://stackoverflow.com/comment/38953100
upvote count: 4
accepted answer of: http://stackoverflow.com/q/25043826
downvote count: 0
has comment: http://stackoverflow.com/comment/38960801

http://stackoverflow.com/q/24951042
tagged with: javascript
has answer: http://stackoverflow.com/a/24999793
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/24999793
favorite count: 0
tagged with: nvd3.js
has title: Loading csv data with d3.csv in nvd3 multiBar Chart example (JSON format)
upvote count: 2
tagged with: d3.js
tagged with: http://stackoverflow.com/tag/csv
linked to: http://stackoverflow.com/q/21149469
has body: I am trying to reproduce a nvd3.js multiBar Chart using my own .csv data. Similar questions have been asked in the past, but have been unable to help me in solving it for this particular issue. In different question I have seen the use of d3.entries d3.nest and variable creation to reproduce the correct input format, but have a hard time grasping how it works. Similar questions: d3.js csv to nvd3 (stacked area chart) format ScatterChart in NVD3 –&#160;Reading the data from csv file d3 csv data loading These questions try to reproduce other chart types which expect different JSON data format. I have issues with creating the "x" and "y" values in the nest. In the chart example they use a function to generate data and in the function they create the x (number of bars) and y (actual input) values. I wish to reproduce this graph: http://nvd3.org/examples/multiBar.html With this csv data: date,Equipment:Electricity:LGF,Equipment:Electricity:GF,Equipment:Electricity:1st,Equipment:Electricity:2nd jan,6726.864146,5648.080727,2598.709507,2042.260163 feb,6405.091236,5377.910358,2474.402801,1944.570663 mar,6727.448125,5648.571054,2598.935109,2042.437457 apr,6433.12227,5401.446071,2485.231698,1953.080819 may,6993.742947,5872.160325,2701.809623,2123.28394 jun,6433.12227,5401.446071,2485.231698,1953.080819 jul,6727.448125,5648.571054,2598.935109,2042.437457 aug,6993.742947,5872.160325,2701.809623,2123.28394 sep,6166.827448,5177.8568,2382.357183,1872.234336 oct,6993.742947,5872.160325,2701.809623,2123.28394 nov,6699.417092,5625.035342,2588.106212,2033.927301 dec,6167.411428,5178.347127,2382.582785,1872.411631 It expects this type of data, JSON format (actual version has more data): [ { "key": "Stream #0", "values": [ { "x": 0, "y": 0.4428573444644372 }, { "x": 1, "y": 1.1148710782512004 }, { "x": 2, "y": 1.4665579659689634 } ] }, { "key": "Stream #1", "values": [ { "x": 0, "y": 0.14053699714131654 }, { "x": 1, "y": 0.1493057878687978 }, { "x": 2, "y": 0.12193947387887433 } ] } ] I …
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/18752395
type: Question
linked to: http://stackoverflow.com/q/14986435

http://stackoverflow.com/q/25052044
has title: show nearby places in marker's infobubble with distance and duration
answer count: 1
has comment: http://stackoverflow.com/comment/38972010
favorite count: 0
has comment: http://stackoverflow.com/comment/39008471
has body: My function of getting distance and duration var distance_o_marker=''; var duration_to_marker=''; var directionsService = new google.maps.DirectionsService(); function calcRoute_all(center,nearby) { var start = center; var end = nearby; var request = { origin:start, destination:end, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { distance_o_marker=response.routes[0].legs[0]['distance'].text; duration_to_marker=response.routes[0].legs[0]['duration'].text; } }); } center is latlng for which nearby has to show nearby is latlng of nearby place got from places api json object giving odd results i.e. places which are close getting more distance and duration or sometimes getting undefined sorry for my bad english but try to give solution please Edit: i m getting to JSON responses, 1) nearby places 2) directionService how to connect them
type: UnansweredQuestion
downvote count: 2
type: Question
score: -2
tagged with: javascript
tagged with: google-maps-api-3
has answer: http://stackoverflow.com/a/25080225
tagged with: google-maps
upvote count: 0

http://stackoverflow.com/q/25052442
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38969524
tagged with: http://stackoverflow.com/tag/html
has title: is it possible to close a div containing another html?
has comment: http://stackoverflow.com/comment/38969256
score: -1
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38972769
upvote count: 1
has body: is it possible to close or empty the div containing an html? and the code where you want to close/empty the div is in the html. my div is a pop up. like this. #document ...... the code that empty the id="n_test"
type: Question
has comment: http://stackoverflow.com/comment/38969296
has comment: http://stackoverflow.com/comment/38969336
has answer: http://stackoverflow.com/a/25052478
has comment: http://stackoverflow.com/comment/38969185
has comment: http://stackoverflow.com/comment/38969211

http://stackoverflow.com/q/25013599
has comment: http://stackoverflow.com/comment/38896299
has comment: http://stackoverflow.com/comment/38896093
type: AnsweredQuestion
type: Question
has title: Why AJAX doesnt work with for-loop
score: 0
tagged with: for-loop
answer count: 1
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/25013854
has comment: http://stackoverflow.com/comment/38896109
tagged with: php
has comment: http://stackoverflow.com/comment/38897194
accepted answer: http://stackoverflow.com/a/25013854
has body: I am working on small application which is supposed to generate working schedules and count hours: http://www.ankieta.gorna.pl/kalendarz.php. I wrote the function kalkulacja() which is supposed to count each row's inputs and output results via ajax. I can't figure out why it does only the last row, throwing error in all previous cases. I would appreciate your help. < > tydz. miesiąc <?php $dane = $_POST["staff"]; $link = mysqli_connect("") or die("Error " . mysqli_error($link)); if($link) { echo ""; } else { echo "nie ok"; } $result = mysqli_query($link,"SELECT staff FROM Staff"); while($row = mysqli_fetch_array($result)) { $pracownik = $row['staff']; print " " . $pracownik . " "; } ?> function init() { var zlap_plus = document.getElementById("tydz_plus"); var zlap_minus = document.getElementById("tydz_minus"); zlap_plus.onclick = plus_tydz; zlap_minus.onclick = minus_tydz; dni(); for(var e = 0 ; e < 19 ; e++) { kalkulacja(e); } } var dzis = new Date(); var day = 86400000; var pon = Date.now() - ((dzis.getDay()*day)-day); //zwraca pierwszy dzień tygodnia var pierwszy = Date.now() - ((dzis.getDate() - dzis.getDay())*day); //zwraca pierwszy dzień miesiąca //Funkcja tworzy nagłówek tabeli i generuje daty function dni() { document.getElementById("pon").innerHTML = " " + new Date(pon).toLocaleDateString() + " "; document.getElementById("wt").innerHTML = new Date(pon + day).toLocaleDateString(); document.getElementById("sr").innerHTML = new Date(pon + (2*day)).toLocaleDateString(); document.getElementById("czw").innerHTML = new Date(pon + (3*day)).toLocaleDateString(); document.getElementById("pn").innerHTML = new Date(pon + (4*day)).toLocaleDateString(); document.getElementById("sob").innerHTML = new Date(pon + (5*day)).toLocaleDateString(); document.getElementById("ndz").innerHTML = new Date(pon + (6*day)).toLocaleDateString(); } //Funkcja przesuwa kalendarz o tydzień function plus_tydz() { pon = pon+7*day; return dni(); } //Funkcja cofa kalendarz o tydzień function min…

http://stackoverflow.com/comment/38977448
has text: Thansk Sandeep your a star , cool this works so if i use var arrObj = $scope.filteredItems will this work ?
type: AnswerComment
comment on: http://stackoverflow.com/a/25055890
score: 0
type: Comment

http://stackoverflow.com/q/25040792
has answer: http://stackoverflow.com/a/25090418
has comment: http://stackoverflow.com/comment/38996578
possible better answer: http://stackoverflow.com/a/25086946
upvote count: 2
has answer: http://stackoverflow.com/a/25086946
has answer: http://stackoverflow.com/a/25113327
has comment: http://stackoverflow.com/comment/38991616
has answer: http://stackoverflow.com/a/25177111
type: Question
has comment: http://stackoverflow.com/comment/38947014
tagged with: javascript
has comment: http://stackoverflow.com/comment/38991558
has comment: http://stackoverflow.com/comment/38995665
tagged with: mapreduce
tagged with: mongodb
has comment: http://stackoverflow.com/comment/39230220
has comment: http://stackoverflow.com/comment/38995753
downvote count: 0
accepted answer: http://stackoverflow.com/a/25177111
has comment: http://stackoverflow.com/comment/38947035
has title: Return limited number of records of a certain type, but unlimited number of other records?
favorite count: 0
has comment: http://stackoverflow.com/comment/38996400
has comment: http://stackoverflow.com/comment/38995407
tagged with: aggregation-framework
has comment: http://stackoverflow.com/comment/38996921
tagged with: php
has body: I have a query where I need to return 10 of "Type A" records, while returning all other records. How can I accomplish this? Update: Admittedly, I could do this with two queries, but I wanted to avoid that, if possible, thinking it would be less overhead, and possibly more performant. My query already is an aggregation query that takes both kinds of records into account, I just need to limit the number of the one type of record in the results. Update: the following is an example query that highlights the problem: db.books.aggregate([ {$geoNear: {near: [-118.09771, 33.89244], distanceField: "distance", spherical: true}}, {$match: {"type": "Fiction"}}, {$project: { 'title': 1, 'author': 1, 'type': 1, 'typeSortOrder': {$add: [ {$cond: [{$eq: ['$type', "Fiction"]}, 1, 0]}, {$cond: [{$eq: ['$type', "Science"]}, 0, 0]}, {$cond: [{$eq: ['$type', "Horror"]}, 3, 0]} ]}, }}, {$sort: {'typeSortOrder'}}, {$limit: 10} ]) db.books.aggregate([ {$geoNear: {near: [-118.09771, 33.89244], distanceField: "distance", spherical: true}}, {$match: {"type": "Horror"}}, {$project: { 'title': 1, 'author': 1, 'type': 1, 'typeSortOrder': {$add: [ {$cond: [{$eq: ['$type', "Fiction"]}, 1, 0]}, {$cond: [{$eq: ['$type', "Science"]}, 0, 0]}, {$cond: [{$eq: ['$type', "Horror"]}, 3, 0]} ]}, }}, {$sort: {'typeSortOrder'}}, {$limit: 10} ]) db.books.aggregate([ {$geoNear: {near: [-118.09771, 33.89244], distanceField: "distance", spherical: true}}, {$match: {"type": "Science"}}, {$project: { 'title': 1, 'author': 1, 'type': 1, 'typeSortOrder': {$add: [ {$cond: [{$eq: ['$type', "Fiction"]}, 1, 0]}, {$cond: [{$eq: ['$type', "Science"]}, 0, 0]}, {$cond: [{$eq: ['$type', "Horror"]}, 3, 0]} ]}, }}, {$sort: {'typeSortOrder'}}, {$limit: 10} ]) I would like to have all these records returned in one query, but limit the type to at most 10 of any category. I realize that the typeSortOrder doesn't need to be conditional when the queries are broken out like this, I had it there for when the queries were one query, ori…
answer count: 4
score: 2
type: AnsweredQuestion

http://stackoverflow.com/q/24933574
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/46326051
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/46326051
answer count: 3
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24955757
favorite count: 0
linked to: http://stackoverflow.com/q/21292052
tagged with: rest
tagged with: angularjs
has body: I am trying to set the header for a single post request using restangular but the request is being sent as plain text instead of json. I have read the documentation here as well as a similar question. I have followed the prescribed methods but to no avail. On the server side am using Express 4.x and communicating with Mongodb using an ORM called Moongoose. Server side: server.js using express.js 4.0 'use strict'; var express = require('express'), morgan = require('morgan'), port =process.env.PORT || 3000, bodyParser = require('body-parser'), methodOverride = require('method-override'), app = express(); app.use(morgan('dev')); app.use(bodyParser()); app.use(methodOverride()); app.use(express.static(__dirname+"/app")); require('./config/models'); require('./config/user_ctrl'); require('./config/comt_ctrl'); require('./config/routes')(app); app.listen(port); console.log('Magic happens on port: '+port); //Server side: routes.js var pips = require('./user_ctrl'); module.exports = function(app){ app.get('/api/pipplez',pips.getPipplez); //Gets all users in collection app.post('/api/pipplez/wan',pips.getPipplezById); //Gets the specified user app.all('/api/*', function(req, res) { res.send(404); }); app.get('/*', function(req, res){ res.send('index.html'); }); }; On the client side I have this. Client side: app.js after config .factory('userServ',function(Restangular){ var ol = Restangular.withConfig(function(conf){ conf.setBaseUrl('/api/') }); var an = Restangular.withConfig(function(conf){ conf.setBaseUrl('/api/users/') }); return{ oldem: ol.one('users').getList(), wandem: an.one('one') } }); Client side: userCtr.js 'use strict'; ting.controller('userCtrl', function($scope, userServ){ $scope.pip = { name: '' }; $scope.getOlPips = function(){ userServ.oldem.then(function(rez){ if(rez!=='null'){ $scope.dem = rez; console.log($scope.dem); } }, function(err){ console.log('Error!!!\n', err ); }) }; $scope.getWanPip = function(pip){ //console.log(pip); RestServ.wandem.post(pip,…
tagged with: restangular
has title: Restangular not setting headers on post
accepted answer: http://stackoverflow.com/a/24955757
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/35492471

http://stackoverflow.com/a/24941271
has body: Fiddle: fiddle here is the js code $(document).ready(function(){ commonHeightToAllDiv('.common'); }); // value will be changed if resied $(window).resize(function(){ commonHeightToAllDiv('.common') }); function commonHeightToAllDiv(handeler){ // calculating all the heights of .common var heights = $(handeler).map(function () { return $(this).height(); }).get(); // calculating maximum value among the heights var max_height_of_content_boxes = function (array) { return Math.max.apply(Math, array); }; // implementing maximum to all .common $(handeler).height(max_height_of_content_boxes(heights)); } CSS codes .lower-content { border-top: 1px solid #b2b2b2; margin: 1% auto 0; padding: 1% 0 0; width:1200px; } .col-1 { display: inline-block; padding: 0 1% 0 0; vertical-align: top; width: 22%; } .scrollbox{ font-size: 1.2em; overflow: auto; } .col-2 { display: inline-block; margin: 0 1% 0 0; vertical-align: top; width: 53%; } .col-3 { display: inline-block; margin: 0; vertical-align: top; width: 22%; } Explanation: Each div has its dynamic height. First we need to find what are those. Then get the maximum value. And implement that value on every div. Calling responsive function to make the js code responsive.
has comment: http://stackoverflow.com/comment/38793134
has comment: http://stackoverflow.com/comment/38802698
type: Answer
has comment: http://stackoverflow.com/comment/39495002
has comment: http://stackoverflow.com/comment/39526535
answers question: http://stackoverflow.com/q/24938477
score: 0

http://stackoverflow.com/comment/38749123
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24935133
type: QuestionComment
has text: or jQuery('#template-list').jqGrid('setSelection','2');

grunt-concurrent
tag name: grunt-concurrent
tags question: http://stackoverflow.com/q/24924136
type: Tag

http://stackoverflow.com/comment/38970427
score: 0
has text: @downvoter what is wrong in my answer???
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25052977

http://stackoverflow.com/comment/38728820
has text: You will need to initialize `result` before the ajax call (otherwise it will be undefined)
type: Comment
comment on: http://stackoverflow.com/a/24924740
score: 1
type: AnswerComment

http://stackoverflow.com/q/24917867
upvote count: 3
tagged with: scroll
downvote count: 1
linked to: http://stackoverflow.com/q/967815
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24918999
duplicate of: http://stackoverflow.com/q/967815
type: Question
score: 2
tagged with: http://stackoverflow.com/tag/html
has title: Temporarily highlight html element when jumping to section on webpage
favorite count: 0
has body: I am trying to have an html element, say a &lt;div&gt;, temporarily be highlighted then fade out after jumping to that element on the webpage. I am looking for an effect similar to this highlighting effect: What is your best programmer joke? How would I go about implementing an effect like this? I tried looking at the page source for that link, but I couldn't see how it was being done.
tagged with: css
answer count: 1

http://stackoverflow.com/comment/38930576
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25031264
type: Comment
has text: i had this php code.. otherAmount if it is clicked? <?php $con = mysql_connect("localhost","root","Balibolista.7"); mysql_select_db("adding", $con); @$fullname=$_POST['name']; @$amnt=$_POST['amounts']; if(@$_POST['submit']) { $sql="insert into amount(name,money) values('$fullname','$amnt')"; mysql_query($sql); } ?>

http://stackoverflow.com/comment/38812834
comment on: http://stackoverflow.com/a/24969172
type: AnswerComment
score: 0
type: Comment
has text: Thanks Neil. I added in a colon after the "$set" because it was erroring on an unexpected token. But it's throwing me a: "errmsg" : "unknown top level operator: $gte" I've tried variations with/without the ", but can't solve it. What do you think?

http://stackoverflow.com/comment/38861069
comment on: http://stackoverflow.com/q/24995074
has text: @Satpal-will event delegation help on this???
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25013812
tagged with: jquery
type: Question
has answer: http://stackoverflow.com/a/25015093
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/26293012
tagged with: jquery-ui
tagged with: autocomplete
has body: One of the columns in a jqgrid Grid contains a autocomplete textbox during the edit mode. The autocomplete is wired correctly with the ajax call to get the data for autocomplete. When an item from the autcomplete list is selected using the mouse, the selection works correctly with no errors thrown. However when i use keyboard down arrow to select an item and then press enter key, the item does not get selected and infact the jquery.ui plugin for autocomplete throws an error, stating item is undefined. The problem here is that both the jqgrid edit complete event and and autocomplete select event are listening to the enter key and the jqgrid edit complete event fires before the jquery.ui autocomplete's select event and hence the edit cell is closed for editing and the select event of jquery.ui autocomplete plugin does not receive the selected item and hence we get the error item is undefined. Can anyone suggest as to how to ensure that both the edit complete event and the autocomplete events COMPLETE successfully without the short circuit that is currently happening with the jqgrid's edit complete event.????
tagged with: jqgrid
type: UnansweredQuestion
has title: autocomplete textbox within jqgrid shows error, item is undefined
tagged with: javascript

http://stackoverflow.com/q/24927577
tagged with: checkbox
has body: I have below view page in ASP.NET MVC3, Based on checkbox selection i need to show associated span tag. Ex: In 1st tag, 1st td has span tag, 2nd td has checkbox, 3rd td has some message. if the checkbox is checked hide span tag which is in 1st td. if the checkbox is unchecked show span tag. I need to show the span tag specific to particular checkbox is checked or unchecked. Sample Example: if the 1st checkbox is checked, hide span tag which is in same 1st if the 2nd checkbox is unchecked, show span tag which is in same 2nd Now i am wondering how would i go about, showing span tag which is based on checkbox selection, anyone help me out. * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus1", name = "cbCheckedStatus" }) Message1 * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus2", name = "cbCheckedStatus" }) Message2 * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus3", name = "cbCheckedStatus" }) Message3 * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus4", name = "cbCheckedStatus" }) Message4 * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus5", name = "cbCheckedStatus" }) Message5 * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus6", name = "cbCheckedStatus" }) Message6 * <\td> @Html.CheckBoxFor(m => m.CheckedStatus, new { id = "cbCheckedStatus7", name = "cbCheckedStatus" }) Message7 My jQuery: jQuery.ready(function domReady($) { jQuery(function ($) { $('#cbCheckedStatus7').on('change', function () { $('#spBlueCheckbox').slideToggle(this.checked); }); }); $('#BtnAccept').click(function () { if ($('input:checkbox').length == $('input:checkbox:not(:checked)').length) { alert('All are not checked') $('input:checkbox:not(:checked)').addClass("outLineRed"); $('.errorMessage').show(); $('#errorMsg').show(); $('#spMsgError').show(); $('#spMsgError').html("Please confirm all the items above, and place a check mark in every c…
has comment: http://stackoverflow.com/comment/38742894
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38741781
has comment: http://stackoverflow.com/comment/38741642
has title: Show span tags based on checkbox checked or unchecked by using jquery
upvote count: 1
has answer: http://stackoverflow.com/a/24934353
has comment: http://stackoverflow.com/comment/38741442
has comment: http://stackoverflow.com/comment/38742206
type: Question
has comment: http://stackoverflow.com/comment/38742489
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/38746708
tagged with: javascript
has comment: http://stackoverflow.com/comment/38741268
has comment: http://stackoverflow.com/comment/38741387
has comment: http://stackoverflow.com/comment/38741830
has comment: http://stackoverflow.com/comment/38746227
answer count: 3
accepted answer: http://stackoverflow.com/a/24934353
downvote count: 0
has answer: http://stackoverflow.com/a/24949498
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38743223
favorite count: 0
has answer: http://stackoverflow.com/a/25226566
possible better answer: http://stackoverflow.com/a/24949498

http://stackoverflow.com/a/24954947
has comment: http://stackoverflow.com/comment/38786142
has comment: http://stackoverflow.com/comment/38786196
answers question: http://stackoverflow.com/q/24954765
type: Answer
has comment: http://stackoverflow.com/comment/38785557
has comment: http://stackoverflow.com/comment/38785712
has comment: http://stackoverflow.com/comment/38785900
has body: The endpoint should return: myprogid({ "pcCartCt": 0, "pcCountryCode": "au", "pcCountrySite": "WWW", "pcExpDomCt": 0, "pcFirstName": "", "pcIsCdc": false, "pcIsDiscount": false, "pcIsGdEmployee": false, "pcIsTrusted": false, "pcLanguageCookie": "en-us", "pcModalData": "", "pcRepEmail": "", "pcRepExt": "", "pcRepName": "", "pcSelectedCurrFullDesc": "United States Dollar $ (Transactional)", "pcSelectedCurrType": "USD", "pcSetLanguageLogo": true, "pcShopperId": "" }); I don't understand your question about parsing multiple parameters. JSONP just expects one special parameter: callback=myprogid. This parameter should be used as the name of the function at the beginning of the response.
score: 0

http://stackoverflow.com/q/25068084
tagged with: angularjs
has answer: http://stackoverflow.com/a/35395284
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39011581
type: Question
has title: How could I create different interceptors for different API-endpoints?
tagged with: javascript
has body: I have 2 Services in AngularJS that for 2 different API-endpoints, they are based on $http service (or simply they are wrappers of $http). Now I have task to create errorHandling for each of the services. What is the best way to do it in Angular? pseudo code: angular.service('api1', function($http){ ... }); angular.service('api2', function($http){ ... });
score: 0
has comment: http://stackoverflow.com/comment/38999238
answer count: 1
accepted answer: http://stackoverflow.com/a/35395284
tagged with: interceptor

http://stackoverflow.com/q/25065837
tagged with: angularjs
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25065994
has title: ng-Grid with ng-repeat horizontal headers
type: Question
tagged with: javascript
tagged with: ng-grid
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: css
has body: Hey thanks for checking out my question, I am trying to create headers in ng-grid with an ng repeat but horizontally. I am able to the ng-repeat working but the items are repeating vertically. Is it possible to make them horizontal? Here is my template: headerCellTemplate: '&lt;div ng-repeat="day in dayInfo" ng-class="col.colIndex()" &gt;{{day.dayId}}&lt;/div&gt;'

http://stackoverflow.com/a/25025803
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25025035
upvote count: 2
downvote count: 0
has body: with q.all, it seems the immediate functions in my array are not executing Yes. Q.all does not expect an array of functions, but an array of promises! You are supposed to execute them yourself, Q.all does not need to (should not) know where the promises are coming from. They might not be created on the fly every time, some applications use promises that have been created long times ago. but Q.all seems satisfied and triggers 'then' with 2 null values Not exactly. Q.all does not only take promises in that array, but also arbitrary values, which are automatically wrapped in promises. That means your code is equal to putting two promises that resolve with functions as their result values, which are passed in the r array to your callback then. It's JSON.stringify() that yields null values, they're functions actually. Do console.log('A and B are done', r) instead.

http://stackoverflow.com/comment/38709371
comment on: http://stackoverflow.com/a/24914097
type: AnswerComment
type: Comment
score: 0
has text: My issue I was facing was iterating the textboxes with .each, I've tried multiple times and couldn't get it to work :S

http://stackoverflow.com/q/24912687
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24912733
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I wrote a code that clicking an item displays a context menu like div to enabling user to cut and paste a list item, I added disabled class to buttons in div that are related to paste operation. but when something selected I want to remove the class 'disable' to enable paste buttons. the code is as below: html: Kes Yapıştır Üstüne Ekle Altına Ekle JS: $(document).on('click', '.ContextMenu', function () { event.preventDefault(); var anySelected = $('.selected').length; if (anySelected > 0) { $("button", "#contextManu").removeClass('disabled'); } var widgetPosition = $('#contextMenu').parent().offset(); $('#contextMenu').css('position', 'absolute'); var currentPosition = $(this).offset(); var contextLeft = (currentPosition.left) - $('#contextMenu').width() - widgetPosition.left - 10; var contextTop = (currentPosition.top + 80) - widgetPosition.top; $('#contextMenu').css('left', contextLeft); $('#contextMenu').css('top', contextTop); $('#contextMenu').slideDown(300); $selectedListItem = $(this).parents('div.categoryItemContainer').parent(); }); I Trace code using google chrome browser, $("button", "#contextManu") founds two button in the contextMenu div but not changes it.
score: 0
answer count: 2
has title: Jquery .addClass and .removeClass Not Working?
accepted answer: http://stackoverflow.com/a/24912733
possible better answer: http://stackoverflow.com/a/24912881
has answer: http://stackoverflow.com/a/24912881
type: AnsweredQuestion

http://stackoverflow.com/q/24950325
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24950571
tagged with: jquery
tagged with: optimization
has comment: http://stackoverflow.com/comment/38777703
answer count: 3
has title: script for open all pages of my website
favorite count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38777717
score: 2
has answer: http://stackoverflow.com/a/24951494
has comment: http://stackoverflow.com/comment/38777675
has body: I have one website made with Wordpress. I installed the plugin "cache quick" in order to optimize it. Now it loads faster. But I have the little issue, which is: I make little changes and upload to the production environment. I clean cache Now when each page, post, of Wordpress is visited for the first time, it loads very slowly (is the first time) Then, I try to visit all the links of the website to cache them, and so serve the users quickly, with latest changes. I have thought to make a script to do this for me :-) Anyone can help me, please?
tagged with: wordpress
has comment: http://stackoverflow.com/comment/38777532
has comment: http://stackoverflow.com/comment/38777650
has comment: http://stackoverflow.com/comment/38777621
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/24950587

http://stackoverflow.com/comment/38912786
type: QuestionComment
comment on: http://stackoverflow.com/q/25022198
score: 1
has text: @Tyblitz I'm working on a polyfill for html5 color for incompatible browsers
type: Comment

http://stackoverflow.com/comment/38703913
type: Comment
has text: @DaveBriand wish we could make that a pre-requisite before posting on the tags of this question!
type: QuestionComment
comment on: http://stackoverflow.com/q/24911675
score: 0

http://stackoverflow.com/a/25064752
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25064555
has body: Since you're using var keyword inside the function, time and now are created again within the function's scope. That means they're different from the variables outside the function although they have the same name. If you remove that keyword, the value of the variables in global scope will be updated and you can access the values set by your function from outside. Also, I would put that if-statement inside of the intervalled function. JavaScript will execute your if-statement before setting that time variable to the new value otherwise. See: http://jsfiddle.net/Whre/7VBcn/1/
upvote count: 2
type: Answer

http://stackoverflow.com/q/25057350
upvote count: 0
has answer: http://stackoverflow.com/a/25057409
tagged with: javascript
tagged with: jquery
score: -1
answer count: 3
favorite count: 0
type: UnansweredQuestion
has title: How to replace last part of URL using Regex and jQuery?
tagged with: regex
has comment: http://stackoverflow.com/comment/38978011
has body: I'm not using REGEX very often so I don't know it well. Want to match last digits before / end of string. so my regex will be\d+/$ Now I want to replace matched part of href inside the link. First thing SyntaxError: illegal character var regex = \d+/$ so I escaped it (I think) var regex = /\d+//$ I thought it will be simple from now: $('a').attr('href').replace(regex,'00/') But it seems no use. I'm using firebug console for testing
has comment: http://stackoverflow.com/comment/38978077
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25057516
has answer: http://stackoverflow.com/a/25057412

http://stackoverflow.com/q/25069242
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25069552
has comment: http://stackoverflow.com/comment/39001358
has body: I've got an issue with the password validation. That's my code: function validatePassword(){ var password = document.getElementById("password").value; var re = /^(?=.*[0-9])(?=.*[!@#$%^&amp;*])[a-zA-Z0-9!@#$%^&amp;*]{6,16}$/; if(!password.match(re)){ producePromt("The password is invalid","commandPasswordPrompt","red"); return false; } producePromt("Password is OK","commandPasswordPrompt","green"); return true; } It says that its only invalid, So I thought that its because of the regex. I asked you if you can help with everything here. Thanks a lot for helpers!
tagged with: validation
has comment: http://stackoverflow.com/comment/39001472
has comment: http://stackoverflow.com/comment/39001305
favorite count: 0
has answer: http://stackoverflow.com/a/25070811
tagged with: regex
possible better answer: http://stackoverflow.com/a/25070811
has comment: http://stackoverflow.com/comment/39001466
tagged with: passwords
has answer: http://stackoverflow.com/a/25069552
type: AnsweredQuestion
score: 3
upvote count: 3
has title: Java Script - Regex - Password validation with Hebrew characters
has comment: http://stackoverflow.com/comment/39001325
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/39001550

http://stackoverflow.com/comment/38944223
comment on: http://stackoverflow.com/q/25038858
type: Comment
type: QuestionComment
has text: I have looked through all answers with both duplicate questions, none of them work. No wonder none of the answers have been marked as accepted!
score: 4

http://stackoverflow.com/q/25028443
tagged with: javascript
score: 0
has title: conditionally loading scripts on window.onresize
has comment: http://stackoverflow.com/comment/38924950
answer count: 3
has comment: http://stackoverflow.com/comment/38924348
has comment: http://stackoverflow.com/comment/38924331
tagged with: jquery
has answer: http://stackoverflow.com/a/25028910
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25088562
tagged with: modernizr
has body: I want to conditionally load some files (javascript and css) based on window size. I would like the files to be "swapped" on window resize, but also to be correctly loaded when the site first load. I am using Modernizr with the yepnope library to do so. However, the code only works on load, and not on resize. I checked the resize event using an alert, and it seems to trigger correctly, but the function only runs onlaod.When I resize the browser, it seems to flicker, as if it is trying to switch between the different files. I am not very good at js, so I can't figure out what is wrong. Any help would be greatly appreciated. Here is the code I am using: &lt;script src="scripts/modernizr.custom.js"&gt;&lt;/script&gt; &lt;script&gt; function myLoader(){ Modernizr.load([ { load: [ 'scripts/jquery-1.11.1.min.js' ] }, { test: Modernizr.mq('(max-width:600px)'), yep: [ 'css/jquery.mobile-1.4.3.min.css', 'css/custom.css', 'scripts/jquery.mobile-1.4.3.min.js' ], nope: [ 'css/mystyle.css' ] } ]); } window.onresize = myLoader(); window.onload = myLoader(); &lt;/script&gt;
has answer: http://stackoverflow.com/a/25074946
type: Question
has comment: http://stackoverflow.com/comment/38924320

http://stackoverflow.com/comment/38968522
has text: @Phil, we totally overlooked asking about Javascript, I never assumed for the world of me that any organization would disable javascript. I've learned the hard way. Our usual concern is with IE versions and % of users.
comment on: http://stackoverflow.com/q/25051893
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38783877
type: Comment
comment on: http://stackoverflow.com/q/24954120
has text: after what happens in your code
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38840905
comment on: http://stackoverflow.com/q/24981811
has text: Just a small bug bro...when I use arrow keys its showing the site url..any help for that??..really thank you
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38878389
comment on: http://stackoverflow.com/a/25003209
type: Comment
score: 0
type: AnswerComment
has text: I didn't remove anything. I made a new file pasted the filter code in, added the script in the html and added the filter module into the app module.

http://stackoverflow.com/comment/38838835
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24983227
has text: @ValentinMercier and that is based on what criteria?
type: AnswerComment

http://stackoverflow.com/comment/38792144
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24958486
has text: When I "wrap the entire thing" what am I actually doing exactly? Thanks!
type: Comment

search-engine
type: Tag
tags question: http://stackoverflow.com/q/24986720
tag name: search-engine

http://stackoverflow.com/q/24918757
score: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38718248
tagged with: ajax
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38718332
has title: Change checkbox depends of
has body: I have select and if I choose something, then id of &lt;option&gt; is send to .php file and then I want to (after check something in database) check or uncheck checkbox. I have everything except last thing. I wanted to do in that way: if ($zmienna == 0) { ?&gt; &lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ $('input[name=nazwa]').attr('checked', true); }); &lt;/script&gt; &lt;?php } else { ?&gt; &lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ $('input[name=nazwa]').attr('checked', false); }); &lt;/script&gt; &lt;?php } But it don't want works;/ The problem is that if I paste &lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ $('input[name=nazwa]').attr('checked', true); }); &lt;/script&gt; at once on head or somewhere else it works, but if I call it: &lt;script&gt; function showUser(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 &amp;&amp; xmlhttp.status==200) { document.getElementById("txtHint").innerHTML=xmlhttp.responseText; } } xmlhttp.open("GET","info_o_klience.php?q="+str,true); xmlhttp.send(); } &lt;/script&gt; And in info_o_klience.php I want to check if I have to check or uncheck checkbox and write jQuery(document).ready(function(){ $('input[name=nazwa]').attr('checked', true); }); With true or false it don't want works...
has answer: http://stackoverflow.com/a/24918947
type: Question

http://stackoverflow.com/comment/38890259
type: Comment
comment on: http://stackoverflow.com/q/25010608
score: 0
type: QuestionComment
has text: try nth selector `$('table tbody tr td:nth(3)').html();`

http://stackoverflow.com/a/24937344
answers question: http://stackoverflow.com/q/24937232
has comment: http://stackoverflow.com/comment/38755752
score: 0
has comment: http://stackoverflow.com/comment/38756156
has comment: http://stackoverflow.com/comment/38763212
has comment: http://stackoverflow.com/comment/38756327
has comment: http://stackoverflow.com/comment/38756490
has body: You shouldn't call __doPostBack() from your code. It's a function that should be called only by ASP.NET Web Forms to invoke server-side events / code. If you inspect the implementation of the __doPostBack() function you will notice that is submits an HTML Form. Therefore your program will never reach the point where it calls __doPostBack() a second time.
has comment: http://stackoverflow.com/comment/38753315
type: Answer
has comment: http://stackoverflow.com/comment/38763250

http://stackoverflow.com/q/24991978
type: Question
tagged with: javascript
tagged with: invokescript
upvote count: 2
answer count: 1
favorite count: 0
has body: Ok, this is silly. I have an existing variable in the HTML I load into my WebView, called caret_position I want to retrieve it via InvokeScriptAsync in my Windows Store app. Here's what I've tried. return await HtmlEditor.InvokeScriptAsync("eval", new string[] { "return caret_position;" }); return await HtmlEditor.InvokeScriptAsync("eval", new string[] { "caret_position;" }); Neither of these work. The only way I can get it to work is to write it to a hidden input in javascript and then use this call. return await HtmlEditor.InvokeScriptAsync("eval", new string[] { "document.getElementById('this_is_silly').value;" }); Is there a way I can just access the javascript variable directly or do I have to jump through these hoops every time?
tagged with: windows-store-apps
has answer: http://stackoverflow.com/a/25091382
accepted answer: http://stackoverflow.com/a/25091382
type: AnsweredQuestion
score: 2
has title: Return an existing javascript variable from a WebView via InvokeScriptAsync
downvote count: 0
tagged with: webview

http://stackoverflow.com/comment/38960364
has text: You have no script reference to jquery-ui, just the base jquery.
comment on: http://stackoverflow.com/q/25047622
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38734555
comment on: http://stackoverflow.com/q/24926146
score: 0
has text: @NitzanShaked this is the result http://pastebin.com/MKbZ42uK
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38878372
comment on: http://stackoverflow.com/a/25004101
type: Comment
score: 0
has text: I tried your solution and it still shows all 3 errors instead of just the first for my username ;(
type: AnswerComment

http://stackoverflow.com/a/25032955
has comment: http://stackoverflow.com/comment/38933546
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38933831
has comment: http://stackoverflow.com/comment/38933971
answers question: http://stackoverflow.com/q/25032887
has comment: http://stackoverflow.com/comment/38933014
has body: You forgot a comma here title: val['permissionName'] tooltip:val['permissionName'] Should be title: val['permissionName'], tooltip:val['permissionName']
accepted answer of: http://stackoverflow.com/q/25032887
has comment: http://stackoverflow.com/comment/38939747
type: Answer
has comment: http://stackoverflow.com/comment/38937416
has comment: http://stackoverflow.com/comment/38935435
has comment: http://stackoverflow.com/comment/38940274
has comment: http://stackoverflow.com/comment/38936314
score: 0
has comment: http://stackoverflow.com/comment/38932855
has comment: http://stackoverflow.com/comment/38942684
has comment: http://stackoverflow.com/comment/38935259
has comment: http://stackoverflow.com/comment/38933464
has comment: http://stackoverflow.com/comment/38940369

http://stackoverflow.com/q/25032321
tagged with: javascript
has comment: http://stackoverflow.com/comment/38960860
tagged with: jquery
has comment: http://stackoverflow.com/comment/45281521
favorite count: 0
has comment: http://stackoverflow.com/comment/38931263
has title: JSHint says "Argument types do not match parameters" for jQuery(this)
has comment: http://stackoverflow.com/comment/38945039
has comment: http://stackoverflow.com/comment/38944960
possible better answer: http://stackoverflow.com/a/28479244
has answer: http://stackoverflow.com/a/28479244
type: AnsweredQuestion
upvote count: 3
has body: It's all in the title. It happens with jQuery(document) as well. I don't understand what is wrong in the code. Here's the excerpt: var checkboxes = jQuery('.js-selected-items', self.$el); checkboxes.each( function (i) { if (!jQuery(this).is(':disabled')) { jQuery(this).prop('checked', true); } } ); ... That warning is shown for all occurrences of jQuery(this). The code works, of course, but I'd like to get rid of all JSHint warnings.
has answer: http://stackoverflow.com/a/28479464
type: Question
score: 3
tagged with: jshint
answer count: 2
downvote count: 0
accepted answer: http://stackoverflow.com/a/28479464

http://stackoverflow.com/comment/38807432
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24966372
has text: Awesome, thanks! I keep running into old descriptions of the web audio API. Do you know where the best place is to look for things like the type of oscillator.type?
type: AnswerComment

http://stackoverflow.com/comment/38845032
has text: So you're declaring our variables, I missed that. It Just looks a little strange. I would ave probably opted to declare them all first `var error, value, a, q, i` Then set each one on a new line just for readability. `error = 1;` etc etc.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24944563
type: Comment

http://stackoverflow.com/a/25017234
has body: I haven't studied your code for very long but shouldn't you use $routeChangeSuccess to stop the spinner? $scope.isViewLoading = false; $scope.$on('$routeChangeStart', function() { $scope.isViewLoading = true; }); $scope.$on('$routeChangeSuccess', function() { $scope.isViewLoading = false; });
score: 0
has comment: http://stackoverflow.com/comment/38902839
type: Answer
answers question: http://stackoverflow.com/q/25016170

http://stackoverflow.com/q/25051929
has comment: http://stackoverflow.com/comment/38968274
has title: To get year from DateTimePicker and also to compare this year with previous year in javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25051974
type: Question
has body: $(document).ready(function() { $("#q_dr_from").datetimepicker({ dateFormat: 'yy-mm-dd',minDate: "-1Y", maxDate: "0"}); ); function find(){ var fromDate = $("#q_dr_from").val(); alert("fromDate" + fromDate); var year = fromDate.getFullYear(); alert("year" + year); } i am unable to display year it fails at var year = fromDate.getFullYear();. and one more requirement is i want to compare this date with date 1 year ago from current date. Could someone please help.
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38968266
has comment: http://stackoverflow.com/comment/38968438
has answer: http://stackoverflow.com/a/25052218

http://stackoverflow.com/comment/38884679
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24997461
score: 0
has text: Please, provide your code. If you were using same solution as in ref. and it didn't work, please, mention that. There are so many duplicated and stupid questions that every new question is supposed to be duplicated, until it described properly.

http://stackoverflow.com/comment/38833872
type: QuestionComment
has text: what is `xxx`.`xxx` is it a table or a column xxx in a table xxx ?
score: 0
comment on: http://stackoverflow.com/q/24980736
type: Comment

http://stackoverflow.com/comment/38712459
type: QuestionComment
comment on: http://stackoverflow.com/q/24915428
has text: guess i'll investigate some with a custom test script until someone contributes to figure this out, since there's conflicting test results in the linked posts
score: 0
type: Comment

http://stackoverflow.com/comment/39893177
type: AnswerComment
type: Comment
has text: Hi @redV, I believe the scroll height value is taken relative to its scroll and as this value is passed to the other scroll it makes it look like the the value is in fact taken from the other scroll, so regardless of height, each scroll will scroll the same height based on that value it is passed.. thus it will still synchronise the two scrolls.
score: 0
comment on: http://stackoverflow.com/a/25548719

http://stackoverflow.com/comment/38810551
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24968013
has text: @AndreiDvoynos, except that if a legitimate value was say `0` (a falsy value) the block would be skipped cause it would see it as false
score: 1

http://stackoverflow.com/comment/38823517
score: 0
type: Comment
type: QuestionComment
has text: From my question - `in what cases do I need to use bindAll()` - if any.
comment on: http://stackoverflow.com/q/24974854

http://stackoverflow.com/comment/38789793
type: QuestionComment
comment on: http://stackoverflow.com/q/24956979
has text: Exactly, @eg_dac - how do I go about getting that pushed into the first function with use with the closeSticky?
score: 0
type: Comment

http://stackoverflow.com/q/24953082
score: 1
upvote count: 1
has title: How to add items to a specific dictionary within an item in a list with AngularFire?
accepted answer: http://stackoverflow.com/a/25040534
type: Question
tagged with: javascript
answer count: 1
downvote count: 0
tagged with: angularfire
favorite count: 0
has answer: http://stackoverflow.com/a/25040534
tagged with: angularjs
has body: The below code shows a list from firebase and shows a corresponding comment field for each item in the list. The user can make a comment on that item and it will update the comment field for that item in the list. Currently, each time a comment is made, it overwrites the previous one, but I'd like for all comments to be saved. How do I make it so that every time a comment is added, the previous ones are saved as well? http://jsfiddle.net/chrisguzman/PS9J2/ indx.html {{item.title}} Comment app.js angular.module('MyApp', ['firebase']) .controller('MyCtrl', function MyCtrl($scope, $firebase) { var furl = "https://helloworldtest.firebaseio.com"; var ref = new Firebase(furl); $scope.data = $firebase(ref); $scope.CommentAdd = function (id) { $scope.data.$save(id); }; }); The following is the data structure within firebase that is generated {helloworldtest: {-JSQhsAnY5zhf0oVKfbb: {title: "nameA", comment:"Second Comment"}, -JSQhsAnY5zhf0oVKfbb: {title: "nameB", comment:"Second Comment"}} } However, I'd like to create the following where there is a 'comments' branch that holds all comments. {helloworldtest: {-JSQhsAnY5zhf0oVKfbb: {title: "nameA", comments:{-JSQhsAnY5zhf0oVKfbb:{Comment:"Second Comment"},-JSQhsAnY5zhf0oVKfbb:{Comment:"First Comment"}}}, {-JSQhsAnYdfdfdffbb: {title: "nameA", comments:{-JSQhsAnY5zhf0oVKfAb:{Comment:"Another Comment"},-JSQhsAnY5zhf0oVKfbb:{Comment:"First Comment"}}} } I've tried to do this by replacing $scope.data.$save(id); with $scope.data.$add(id); I've also tried using : $scope.data[id].$add({foo: "bar"})
tagged with: http://stackoverflow.com/tag/html
tagged with: firebase
type: AnsweredQuestion

http://stackoverflow.com/q/25031342
has comment: http://stackoverflow.com/comment/38929197
has answer: http://stackoverflow.com/a/25031436
type: Question
has comment: http://stackoverflow.com/comment/38929228
has body: function loadProvinces(data){ var province = " Options Province "; var json = $.parseJSON(data); for(var i=0; i<json.province_info.length; i++){ province += " "+json.province_info[i].province_name+" "; } $("#appendprovince").empty(); $("#appendprovince").append(province); $("#appendprovince").show(); $(":input").click(function(e) { var id = this.id; var url = "http://localhost:8080/CurdServlet/ProvinceServlet"; $.post(url,{"getProvince" : "delete_province","province_id":""+id}, function(data){ alert(data); // its working and shows data successfully loadProvinces(data); // here loadProvinces function not working only }); }); }//end loadProvinces i have called loadprovinces function when user add a province for a particular country as user adds a province it inserts into a province table so it is working , a problem is that loadProvinces function is not calling when user presses a delete button .
score: 0
linked to: http://stackoverflow.com/q/1525664
answer count: 3
accepted answer: http://stackoverflow.com/a/25031436
has title: Calling function itself in jquery not works
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38929456
possible better answer: http://stackoverflow.com/a/25031415
has answer: http://stackoverflow.com/a/25031415
has answer: http://stackoverflow.com/a/25031433
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38929243
has comment: http://stackoverflow.com/comment/38929230

http://stackoverflow.com/q/25040338
tagged with: http://stackoverflow.com/tag/html
tagged with: php
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38946204
has answer: http://stackoverflow.com/a/25040470
has answer: http://stackoverflow.com/a/25040505
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38946128
score: 0
answer count: 3
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25040505
has title: Hide/show div with javascript and while loop
has answer: http://stackoverflow.com/a/25040645
accepted answer: http://stackoverflow.com/a/25040470
has body: I am trying for hours now and for some reason i can't find a solution for my problem. The thing is, i need something like a div thats showing up when i click on an link. That's working so far. But the main problem is, that i need it work within a while loop. So i can get the data dynamically into grid, but all of the php created links have the same id and all of the "to-show-divs" show up at the same time. so my question is how can i create dynamic ids or classes and how do i get them to work within javascript? echo " "; $db=mysql_query("SELECT * FROM work") or die (mysql_error()); while($var=mysql_fetch_array($db)) { echo " $var[link] "; } echo " ";

http://stackoverflow.com/comment/38987268
comment on: http://stackoverflow.com/a/25061872
score: 0
type: AnswerComment
type: Comment
has text: :O I see now what you did, but I don't get why mine didn't work :S

http://stackoverflow.com/comment/38995819
has text: @vol7ron Ill be honnest, i did only ready the last 5 lines when I posted my comment, but I retracted it after reading the entire question. But still, I disagree that this question is suitable for SO since you can run the test when you have time and after that the answer will be *"because the algorithme of X is better than the algorithme of Y"*. But well, that's just my opinion.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25066342
score: 1

http://stackoverflow.com/q/24984322
has answer: http://stackoverflow.com/a/24984559
tagged with: javascript
tagged with: express
has title: How to pass client values from browser side to node.js controller
answer count: 1
downvote count: 0
favorite count: 0
has body: I am building a simple nodejs app and using dust at the client side. I am trying to get the lat, lng from the users location and want to make API call using node js express framework. So I get the lat, lng at the client side from the geolocation api. Now I want to pass the lat, lng to the controller so that I can query an API to show the user content. Sorry if this is really basic. I am new to both nodejs and dust. What I tried so far? 1. I tried to submit the form using jquery 2. Setting some dom values etc $(document).ready( function() { var options = { enableHighAccuracy: true, timeout: 5000, maximumAge: 0 }; function success(pos) { var crd = pos.coords; document.querySelector("[name='latitude']").value = crd.latitude; document.querySelector("[name='longitude']").value = crd.longitude; console.log('Latitude : ' + crd.latitude); console.log('Longitude: ' + crd.longitude); }; function error(err) { console.warn('ERROR(' + err.code + '): ' + err.message); }; navigator.geolocation.getCurrentPosition(success, error, options); }); Controller code: module.exports = function (router) { router.get('/', function (req, res) { //How do I pass the lat, lng from the client to controller? }); }
accepted answer: http://stackoverflow.com/a/24984559
upvote count: 2
tagged with: dust.js
tagged with: node.js
score: 2
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/38929032
score: 0
type: QuestionComment
type: Comment
has text: Use UTC dates maybe? http://stackoverflow.com/questions/9756120/utc-timestamp-in-javascript
comment on: http://stackoverflow.com/q/25031083

http://stackoverflow.com/comment/38836974
has text: if you got your answer then why dont you just mark this question as answered so that it no longer remain in the catagory of unanswered.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24982367
type: AnswerComment

google-fusion-tables
type: Tag
tags question: http://stackoverflow.com/q/24922157
tag name: google-fusion-tables

http://stackoverflow.com/a/79510810
answers question: http://stackoverflow.com/q/24967314
score: -3
type: Answer
has comment: http://stackoverflow.com/comment/140235747
has comment: http://stackoverflow.com/comment/140242342
downvote count: 3
has body: This works: class Observable { constructor(ids) { this.generator = async function *generator() { let response; let people; for (const id of ids) { response = await fetch(`https://swapi.dev/api/people/${id}`); people = await response.json(); yield people.name; } }; } subscribe(callback) { (async function() { for await (const i of this.generator()) { callback(i); } }).bind(this)(); } } const observable = new Observable([1, 2, 3]); observable.subscribe(console.log);
upvote count: 0

http://stackoverflow.com/q/25041296
type: AnsweredQuestion
has body: I'm designing a simple jquery animation so when you click a tile, it displays its info by hiding all other tiles, and displaying its information. Its basic stuff. My problem exists in the deeper core of jquery where although I am using .stop() to prevent queuing, I don't want to want .stop() to function during the animation when it transitions out the tiles and displays the description. My code is broken down in 3 parts. 1st is a mouseeneter which changes the opacity to adjust the opacity of each tile, the 2nd one is the mouseleave where it changes either the opacity of all tiles to normal, or adjusts the others if the mouse enters another tile. The last is basically a click function where if you click a tile, it will fade the other 4 out and show the product description. The third part is the part where things get tricky. The .stop() function in the first part is interfering with the animation when you click if your mouse happens to be in the way during the animation. I don't know how to remedy this issue. function bannerFader(currentBanner, otherBanners, expandButton, appendInfo){ var disableHover = false; $(currentBanner).mouseenter(function(){ if (disableHover == false) { $(otherBanners).stop(true); $(otherBanners).fadeTo(100, .8); } }); $(currentBanner).mouseleave(function(){ if (disableHover == false) { $(otherBanners).fadeTo(100, 1); }; }); $(expandButton).click(function(){ disableHover = true; $(otherBanners).hide(200, function(){ $(appendInfo).show(300); }); }); } function autoRunner() { bannerFader('.banner-one', '.banner-two, .banner-three, .banner-four, .banner-five', '.banner-one','.append-one') bannerFader('.banner-two', '.banner-one, .banner-three, .banner-four, .banner-five', '.banner-two','.append-two') bannerFader('.banner-three', '.banner-two, .banner-one, .banner-four, .banner-five', '.banner-three','.append-three') bannerFader('.banner-four', '.banner-two, .banner-three, .banner-one, .banner-five', '.banner-four','.append-four') bannerFader('.ba…
has answer: http://stackoverflow.com/a/25042795
has comment: http://stackoverflow.com/comment/38948601
type: Question
has title: How can I prevent .stop() in certain situations?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38948640
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/25042795
tagged with: jquery
has comment: http://stackoverflow.com/comment/38948445
has comment: http://stackoverflow.com/comment/38949071
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25041791
tagged with: css
has answer: http://stackoverflow.com/a/25041791

http://stackoverflow.com/q/25041814
answer count: 2
tagged with: collections
has title: How to preserve order of hashmap in JavaScript?
tagged with: java
has comment: http://stackoverflow.com/comment/38948894
upvote count: 4
has comment: http://stackoverflow.com/comment/38948972
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/25041958
type: Question
has answer: http://stackoverflow.com/a/25041958
score: 4
has answer: http://stackoverflow.com/a/51497754
accepted answer: http://stackoverflow.com/a/51497754
has body: Java has LinkedHashMap but there doesn't seem to be a similar solution in JavaScript. Basically, I want to be able to say var map = {}; map['a'] = 1; map['b'] = 2; Then when I iterate over the map, they are always in [{a:1}, {b:2}...] order.

http://stackoverflow.com/q/25016622
has comment: http://stackoverflow.com/comment/38906920
has comment: http://stackoverflow.com/comment/38901784
tagged with: colors
upvote count: 2
type: UnansweredQuestion
has body: I'm trying to insert or edit HTML elements with JavaScript, but I can't figure out how to get JavaScript to output HTML with HEX colors instead of RGB. For example, if I wanted to change the color of an element to #ff0000 the JavaScript would actually output rgb(255, 0, 0), even when I use HEX colors in the script. Please see this JSFiddle for an example. What's the shortest route I can take to get the HTML code to have HEX colors instead of RGB? Note: This is not a duplicate of this question. It's a very different problem. Converting the RGB value of one specific element to a HEX value for use in something else is completely different. I'm trying to generated HTML elements with HEX values instead of RGB. I need the innerHTML of a container to contain HEX values.
has answer: http://stackoverflow.com/a/25018242
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38901600
has title: HEX Colors in HTML Generated via Javascript
has comment: http://stackoverflow.com/comment/38902241
has comment: http://stackoverflow.com/comment/90684566
type: Question
has comment: http://stackoverflow.com/comment/38903356
linked to: http://stackoverflow.com/q/1740700
tagged with: javascript
tagged with: rgb
has comment: http://stackoverflow.com/comment/38901675
score: 2
has comment: http://stackoverflow.com/comment/38903853
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38901641
favorite count: 0
tagged with: hex

http://stackoverflow.com/comment/38722292
type: QuestionComment
has text: @tymeJV Thanks for the edit, apologies...
comment on: http://stackoverflow.com/q/24920953
score: 0
type: Comment

http://stackoverflow.com/comment/38713833
type: QuestionComment
score: 1
has text: It looks like you've found a solution - what's the question here?
comment on: http://stackoverflow.com/q/24916648
type: Comment

angular-ui-router
tags question: http://stackoverflow.com/q/25068172
tags question: http://stackoverflow.com/q/24957003
tags question: http://stackoverflow.com/q/24964727
tags question: http://stackoverflow.com/q/25000380
tags question: http://stackoverflow.com/q/24960288
tags question: http://stackoverflow.com/q/25010789
tags question: http://stackoverflow.com/q/25028597
tags question: http://stackoverflow.com/q/24975514
tags question: http://stackoverflow.com/q/25029173
tag name: angular-ui-router
tags question: http://stackoverflow.com/q/25023786
tags question: http://stackoverflow.com/q/24922311
tags question: http://stackoverflow.com/q/24925255
tags question: http://stackoverflow.com/q/24909805
tags question: http://stackoverflow.com/q/24940554
tags question: http://stackoverflow.com/q/24927784
tags question: http://stackoverflow.com/q/25042764
tags question: http://stackoverflow.com/q/25005231
tags question: http://stackoverflow.com/q/24929233
type: Tag

http://stackoverflow.com/comment/38714482
comment on: http://stackoverflow.com/a/24912600
has text: it's a completely different lightbox than the one you are using, but I use this method for my sites, and it's is very easy to use.http://fearlessflyer.com/how-to-add-lightbox-to-wp-without-plugin/ Not sure how helpful it will be to you.
type: Comment
type: AnswerComment
score: 0

http://stackoverflow.com/q/25066326
has title: Add class to link on scroll plus add same class on click
tagged with: wordpress
upvote count: 1
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25070274
tagged with: javascript
has body: i need a little bit of help with this page: http://www.levelidiomes.com/new/ (on the part called Formaciò) i have this js http://www.levelidiomes.com/new/wp-content/themes/Kronos-WP2/js/formacio.js That is adding a class to the menu on the left (called nav.stickymeny) also is doing other stuff for this specific part. So, i need to: add the active class when scrolling over the section add the active class to the clicked link I don't know why is not working correctly please helps
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25070274
score: 1

http://stackoverflow.com/comment/38787082
score: 1
has text: you mean "wrap" not "warp" right?
comment on: http://stackoverflow.com/q/24955745
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24990162
type: Answer
score: 1
answers question: http://stackoverflow.com/q/24989596
has comment: http://stackoverflow.com/comment/38853668
accepted answer of: http://stackoverflow.com/q/24989596
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38852040
has body: From the information that you have given I think you have not included the jasmine file http://searls.github.io/jasmine-all/jasmine-all-min.js Tried your code after including this and it is working fine. Here is a working fiddle
upvote count: 1
downvote count: 0

http://stackoverflow.com/comment/38847508
has text: Then use `background-size:cover` for example. I'm pretty sure you can do what you want without JS. Can you post a demo to reproduce the issue?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24987759

http://stackoverflow.com/q/25058453
type: UnansweredQuestion
has title: Multiple values passed in query string
has answer: http://stackoverflow.com/a/25064747
has comment: http://stackoverflow.com/comment/38980944
score: 2
has comment: http://stackoverflow.com/comment/38990927
type: Question
has comment: http://stackoverflow.com/comment/38980804
has body: I am using something the below code to pass a single value via query string to my html page on button click using Javascript function. window.location.href("somepage.html?w1=" + hello); The above code is working fine. But when I am trying to append second variable with this URL, nothing happens on click of the button. window.location.href("somepage.html?w1=" + hello + "&amp;w2=" + world); What am I doing wrong here?
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: query-string
has comment: http://stackoverflow.com/comment/38980185
has comment: http://stackoverflow.com/comment/38980725
has comment: http://stackoverflow.com/comment/38980223
favorite count: 0
upvote count: 2

web-applications
tags question: http://stackoverflow.com/q/24957976
tags question: http://stackoverflow.com/q/24910775
tags question: http://stackoverflow.com/q/24923447
tags question: http://stackoverflow.com/q/24969112
tags question: http://stackoverflow.com/q/24974146
tag name: web-applications
type: Tag
tags question: http://stackoverflow.com/q/24915092

http://stackoverflow.com/comment/83943667
comment on: http://stackoverflow.com/a/25032663
type: AnswerComment
score: 0
has text: I have the same scenario, and adding `magnificPopup('open');` works but the close button when the popup is open doesnot work. Instead after the close button is clicked, the video starts again.
type: Comment

http://stackoverflow.com/a/24985698
downvote count: 0
type: Answer
upvote count: 1
score: 1
has body: You either need to take the file input out of the form tags, write a custom form submission script, or set the file field to disabled when the submit button is clicked, the latter is probably the best bet
answers question: http://stackoverflow.com/q/24985656

http://stackoverflow.com/comment/38990410
type: AnswerComment
has text: also you can replace {{}} with ng-bind, or check out [bindonce](https://github.com/Pasvaz/bindonce)
type: Comment
comment on: http://stackoverflow.com/a/25063667
score: 0

http://stackoverflow.com/a/24979193
downvote count: 0
score: 1
has body: you need to change the location of login controller app.config(function($routeProvider) { $routeProvider.when("/user/login", { templateUrl: "/user/login.html", //controller: "LoginCtrl" // remove this }); }); and replace html like this
type: Answer
has comment: http://stackoverflow.com/comment/38841583
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24979169
answers question: http://stackoverflow.com/q/24979169
has comment: http://stackoverflow.com/comment/38831565
type: AcceptedAnswer

http://stackoverflow.com/a/35083410
has body: if you have multiple selection and want to collect first column of all selected row. use following code var allSelected = ""; var selectedRows = this.select(); for (i = 0; i &lt; selectedRows.length ; i++) { allSelected = allSelected + ", " + this.dataItem(selectedRows[i]).task_number; }
type: Answer
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/25014788

http://stackoverflow.com/a/24988713
has body: Don't abuse regex! If you are testing for single strings, test for single strings. Since JavaScript doesn't have a built in replaceAll method (yet) for strings, you can make your own: String.prototype.replaceAll = function(find, replace) { return this.split(find).join(replace); }; Then just call it like this: mystring.replaceAll('\\n', '\n'); // for the "find" argument, you need to escape the backslash Of course, if you don't like fiddling with the prototype (there are reasons to, and not to - decide yourself), you can define it as a regular function: function replaceAll(string, find, replace) { return string.split(find).join(replace); } Then call it like this: replaceAll(mystring, '\\n', '\n');
has comment: http://stackoverflow.com/comment/38868532
has comment: http://stackoverflow.com/comment/38866466
has comment: http://stackoverflow.com/comment/38868210
has comment: http://stackoverflow.com/comment/38902023
has comment: http://stackoverflow.com/comment/38849676
has comment: http://stackoverflow.com/comment/38862496
has comment: http://stackoverflow.com/comment/38862481
has comment: http://stackoverflow.com/comment/38877528
has comment: http://stackoverflow.com/comment/38868504
has comment: http://stackoverflow.com/comment/38890378
has comment: http://stackoverflow.com/comment/38899981
has comment: http://stackoverflow.com/comment/38849510
has comment: http://stackoverflow.com/comment/38890641
has comment: http://stackoverflow.com/comment/38901092
answers question: http://stackoverflow.com/q/24988686
has comment: http://stackoverflow.com/comment/38849621
downvote count: 27
score: 5
has comment: http://stackoverflow.com/comment/38849460
has comment: http://stackoverflow.com/comment/38878118
has comment: http://stackoverflow.com/comment/38849484
has comment: http://stackoverflow.com/comment/38899837
has comment: http://stackoverflow.com/comment/38862434
has comment: http://stackoverflow.com/comment/38866449
has comment: http://stackoverflow.com/comment/38849527
has comment: http://stackoverflow.com/comment/38881838
has comment: http://stackoverflow.com/comment/38849436
has comment: http://stackoverflow.com/comment/38882711
has comment: http://stackoverflow.com/comment/38849556
has comment: http://stackoverflow.com/comment/38868628
type: Answer
has comment: http://stackoverflow.com/comment/38899707
has comment: http://stackoverflow.com/comment/38849505
has comment: http://stackoverflow.com/comment/38849512
has comment: http://stackoverflow.com/comment/38867504
upvote count: 32
has comment: http://stackoverflow.com/comment/38900071
has comment: http://stackoverflow.com/comment/38902075
has comment: http://stackoverflow.com/comment/38876517
has comment: http://stackoverflow.com/comment/38849819

http://stackoverflow.com/comment/38986774
type: QuestionComment
has text: It's not bubbling, the click occurs on the same element
score: 0
comment on: http://stackoverflow.com/q/25061641
type: Comment

http://stackoverflow.com/comment/38993695
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25052820
has text: where do you use `length` property?

http://stackoverflow.com/q/24922499
tagged with: javascript
tagged with: datatables
answer count: 1
downvote count: 0
has title: Datatables with AJAX - How to share a URL with a specific page?
score: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/24930862
has body: I am using Datatables, and I get the data via AJAX (on my server side I have Rails). Say that I want to share with another user, the page number 2 of one of the views that is using Datatables. Since the pagination is done with AJAX, there is no track of the page number in the URL, and therefore it can't be done. How do you deal with pagination that is done via AJAX when you want to share a specific page (?page=1) ? Thanks
type: AnsweredQuestion
upvote count: 1
tagged with: ruby-on-rails
type: Question
accepted answer: http://stackoverflow.com/a/24930862
linked to: http://stackoverflow.com/q/7407111

http://stackoverflow.com/comment/38888108
has text: I got help from the SO chat and as this is similar, I accepted. Thanks.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25000972

http://stackoverflow.com/comment/39211093
has text: You might want to go a different direction. Its like you need to add the external source, via a queue, to a local media stream device or some type of proxy. Then Chromecast reads it from your local stream device. I found https://play.google.com/store/apps/details?id=com.bubblesoft.android.bubbleupnp which looks pretty interesting.
comment on: http://stackoverflow.com/q/25003269
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38894317
type: Comment
type: QuestionComment
has text: @Mritunjay: You can't use `tel-prefix` as an identifier, so you would need to use a string as in `document.forms[0]["tel-prefix"].value`, but that only works if the element is a field in that form, which a span tag isn't.
comment on: http://stackoverflow.com/q/25012201
score: 0

http://stackoverflow.com/comment/38747604
type: QuestionComment
comment on: http://stackoverflow.com/q/24934069
has text: Isn't there a option into the JQuery.ajax() function that can make them synchronous? Or if they are always in the same order you could call each one in the success function of the previous one?
score: 0
type: Comment

http://stackoverflow.com/comment/38838629
comment on: http://stackoverflow.com/a/24980455
has text: Then you have to do what I described some comment ago. Actually it's not a real "popup" you're looking for. A popup is a new window, but no modern CMS does that ; it's always only a message in the same window (what we call a "popin", like a fake popup inside the window)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24910769
tagged with: javascript
has answer: http://stackoverflow.com/a/24910903
answer count: 1
tagged with: highcharts
has title: bootstrap data-toggle="tab" - how to make a tab active with a JS call
accepted answer: http://stackoverflow.com/a/24910903
tagged with: jquery
has comment: http://stackoverflow.com/comment/38702078
favorite count: 0
tagged with: twitter-bootstrap
score: 11
type: AnsweredQuestion
has body: I have a JSP page which uses bootstraps data-toggle="tab" functionality. Upon page load I make one tab active. First Tab Second Tab I have a Highcharts chart on the page, whenever a user clicks on one of the columns I call a JS function which makes tab2 the active tab on the page. Inside this function I've tried a few different commands but none seem to work. I'm quite new to jQuery so I'm hoping someone might be able to point out where I'm going wrong with my syntax. function handleClick(){ //I've tried the following, none seem to work $('#tab2').toggleClass('active'); $('#tab2').show(); $('#tab2').tab('show'); }
downvote count: 1
type: Question
upvote count: 12

http://stackoverflow.com/q/24962677
tagged with: extjs
type: Question
score: 0
answer count: 1
has title: ExtJS 5 - Error using ext-all-debug.js
has comment: http://stackoverflow.com/comment/38802812
has answer: http://stackoverflow.com/a/24968250
has body: I am getting following error using extjs 5. Object doesnt support this method on line 11130 which is below doc.addEventListener('DOMContentLoaded', me.onReadyEvent, false) Here is the markup Couldnt figure out what i am missing. Appreciate any help, thanks.
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38927877
tagged with: xpages
has comment: http://stackoverflow.com/comment/38915900
has comment: http://stackoverflow.com/comment/38814526

http://stackoverflow.com/comment/38798666
has text: actually i'm not good at english language. that's the problem
type: Comment
comment on: http://stackoverflow.com/a/24961845
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38869098
score: 0
type: AnswerComment
type: Comment
has text: I actually tried that but it didn't work. It errors with a stack error because it keeps on getting invoked as it's being spied /watched.
comment on: http://stackoverflow.com/a/24998947

http://stackoverflow.com/a/25006841
has body: It can be accomplished two ways, using purely just CSS or with the aid of javascript (jQuery). Using CSS3 :nth-child() Selector: #yourTable td { background: #ccc; height: 2em; width: 8em; } #yourTable tr:hover td:nth-child(2) { background: red; } fiddle demo here: http://jsfiddle.net/7F3ge/ or Using jQuery to add hover class to a specific DOM element: $('document').ready(function(){ $('#yourTable tr').hover(function() { $(this).children('td:eq(1)').toggleClass('hover'); }); }); fiddle demo here: http://jsfiddle.net/u527u/3/
upvote count: 2
answers question: http://stackoverflow.com/q/24951644
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24951644
type: Answer

http://stackoverflow.com/comment/38812584
has text: How did you place it in the lightbox? What was the error you got?
type: AnswerComment
comment on: http://stackoverflow.com/a/24965075
score: 0
type: Comment

http://stackoverflow.com/comment/38973081
type: Comment
type: QuestionComment
has text: Well every time the month is changed, you would need to retrieve the current value.
comment on: http://stackoverflow.com/q/25053532
score: 0

http://stackoverflow.com/comment/38810979
type: AnswerComment
type: Comment
score: 1
has text: one more idea is use unique `id` instead of class `.dp` try my update2
comment on: http://stackoverflow.com/a/24968437

http://stackoverflow.com/comment/38954161
type: Comment
comment on: http://stackoverflow.com/a/25044267
has text: @thomas It is undefined. It's declared, but undefined.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38785987
type: QuestionComment
comment on: http://stackoverflow.com/q/24940414
score: 0
type: Comment
has text: I am the OP: no element using this class exists yet (it will be created later by a script), so the css('z-index') solution cannot be applied (unless we create a hidden element, as mentioned by answers below)

http://stackoverflow.com/comment/38781105
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24949071
has text: this code is not working because it is in the separate folder..typo error..
score: 0

http://stackoverflow.com/q/25051629
has answer: http://stackoverflow.com/a/25054896
score: 0
has title: JavaScript - Array behaves like object
answer count: 4
has comment: http://stackoverflow.com/comment/38967863
has comment: http://stackoverflow.com/comment/38967817
has answer: http://stackoverflow.com/a/25051757
has comment: http://stackoverflow.com/comment/38967757
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25051661
tagged with: object
has comment: http://stackoverflow.com/comment/38967654
has answer: http://stackoverflow.com/a/25051911
has comment: http://stackoverflow.com/comment/38967707
type: Question
has comment: http://stackoverflow.com/comment/38967764
tagged with: arrays
tagged with: javascript
has body: I'd like to ask a question about JavaScript arrays. Does the array behave like an object when we use for..in loop to iterate. I mean in this case can indexes take the role of properties(keys).

http://stackoverflow.com/q/25001520
accepted answer: http://stackoverflow.com/a/25001660
has answer: http://stackoverflow.com/a/25001619
has body: I have json returned from Database.I want to pick only one object Value and show it in the textbox. Here is my json. [{ "ErrorMessage":"", "ID":294, "ExpenseID":0, "EffectiveDate":"/Date(1262284200000)/", "FormattedEffectiveDate":"01-01-2010", "Perunit":null, "VATRate":17.5, "ChangedByID":1, "ChangedByName":"superuser, superuser", "Expense":null, "ErrorSummary":null, "ErrorList":[] }] I have Tried var Jsoninvoice = JSON.stringify(data) alert(Jsoninvoice.VATRate) and also alert(data.VATRate) Thank you In advance.
has answer: http://stackoverflow.com/a/25001979
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38873089
tagged with: http://stackoverflow.com/tag/json
has title: Show Json Object In TextBox
type: Question
score: 0
has answer: http://stackoverflow.com/a/25001660
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25001619
answer count: 3

http://stackoverflow.com/comment/38968355
type: Comment
comment on: http://stackoverflow.com/a/25050953
has text: Thanks @jinggoy.. in fiddle works fine, but in my localhost it didn't work, please help finally.
type: AnswerComment
score: 0

http://stackoverflow.com/q/24979763
has title: How to ration amount in purely functional style
has answer: http://stackoverflow.com/a/24979881
accepted answer: http://stackoverflow.com/a/24979881
tagged with: purely-functional
type: Question
has comment: http://stackoverflow.com/comment/38832479
has comment: http://stackoverflow.com/comment/38832283
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38832635
answer count: 1
downvote count: 1
has body: I need to distribute certain amounts to array of people according to their score. The rule is that their demands are met according to their position with whatever remains. In JavaScript using Lo-Dash (JSBin): var amount = 1000, people = [ { name : 'Joe', score: 40, demand: 400}, { name : 'Sue', score: 30, demand: 350}, { name : 'Kim', score: 25, demand: 300}, { name : 'Ron', score: 20, demand: 250} ]; function distribute(people, amount){ return _.map(_.sortBy(people,'need'),function(person){ var ration = Math.min(person.demand,amount); amount -= ration; // This is the state (mutation) that I want to avoid return _.assign(person,{ ration: ration}) }); } console.log(distribute(people, amount)); Result: [{ demand: 400, name: "Joe", ration: 400, score: 40}, { demand: 350, name: "Sue", ration: 350, score: 30}, { demand: 300, name: "Kim", ration: 250, score: 25}, { demand: 250, name: "Ron", ration: 0, score: 20}] Since the solution depends on the order, is it possible to change this code to make it purely functional?
favorite count: 0
tagged with: lodash
has comment: http://stackoverflow.com/comment/38832234
has comment: http://stackoverflow.com/comment/38832312
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/q/24985101
type: Question
has answer: http://stackoverflow.com/a/24985130
has comment: http://stackoverflow.com/comment/38842201
has answer: http://stackoverflow.com/a/24985157
tagged with: javascript
has answer: http://stackoverflow.com/a/24985137
downvote count: 0
has answer: http://stackoverflow.com/a/24985296
tagged with: jquery
favorite count: 0
has title: What is the meaning of the "t" in the code and what does t(window) mean?
linked to: http://stackoverflow.com/q/8228281
has body: I am trying to learn jquery/javascript by looking at the source code of some websites. I am a bit unsure about the syntax used there: !function(t) { "use strict"; function e() { var e = parseInt(t(window).scrollTop()), n = 10; e &gt; n ? a.addClass("new-class") : (a.removeClass("new-class"), t(".sclass").removeClass("fclass")) } //...more codes... }(jQuery), I just don't really get what exactly is the meaning of that t there. Is it "this" or just any event object? and what does t(window) means? I thought it should be something like t.window? Since t is not a function. Thanks! Saldtch
has answer: http://stackoverflow.com/a/24985141
answer count: 5
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38842235
has comment: http://stackoverflow.com/comment/38842257
has comment: http://stackoverflow.com/comment/38842304
score: 1
upvote count: 1

http://stackoverflow.com/comment/38845351
type: AnswerComment
has text: Fair point, but in your example, calling the static method doesn't call the instance method for each instance. So I would still have to call the instance method for each instance manually. It seems like it would be pretty common and useful to call one method and have all instances of a certain class get updated. Is there a different way I'm not thinking of?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24986617

http://stackoverflow.com/comment/38948362
has text: Relevancy: the OP wanted to do `io.read`. That isn't scalable. You said use `io.each`. That is scalable. It's something repeated on Stack Overflow often. It's called confirming and agreeing with what you said, which is completely relevant.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25023704
type: Comment

http://stackoverflow.com/comment/38944213
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25036333
has text: Show your markup as well so we can see the structure you're trying to alter.
score: 0

http://stackoverflow.com/a/27365483
answers question: http://stackoverflow.com/q/25040701
type: Answer
has body: This problem seems to be with the Hyperlinking for JavaScript Editors. To solve this go to Window-&gt;Preferences-&gt;General-&gt;Editors-&gt;Text Editors-&gt;Hyperlinking and uncheck the option Link Kind = "JavasScript Element" Available In = "JavaScript Editor" I also tried to change the Modifier Key but that did not fix the issue. Another option would be to disable all Hyperlinking. Hope this helps!
score: 1
upvote count: 1
downvote count: 0

http://stackoverflow.com/q/24955125
upvote count: 2
tagged with: requirejs
tagged with: sigma.js
accepted answer: http://stackoverflow.com/a/24991689
tagged with: amd
score: 2
type: AnsweredQuestion
downvote count: 0
answer count: 1
tagged with: requirejs-define
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24991689
type: Question
has title: Load sigmajs through requirejs
has body: I am trying the RequireJS AMD, And would like to load - among others (jquery, bootstrap, d3, moment...) - the graph library sigmajs, But when I load it in a module, It is undefined... However it exists in the window object... Is it a bad practice to require it in a module ? Should it require it in the global requirejs bootstrapping and use it from the window ? Here is my application bootstrapping : // My application root folder index.html build.js assets/ package.json bower.json gulpfile.js js/ app.js modules/ graph.js vendor/ require-2.1.14.js jquery-2.1.1.min.js underscore-1.6.0.min.js d3-3.4.11.min.js moment-2.7.0.min.js sigma-1.0.2.min.js my-own-npm-module-1.0.0.min.js css/ My app.js file : requirejs bootstrapping, seems to work well // /assets/js/app.js requirejs.config({ baseUrl: 'assets/js/vendor', paths: { 'jquery': 'jquery-2.1.1.min', 'bootstrap': 'bootstrap-3.2.0.min', 'moment': 'moment-2.7.0.min', '_': 'underscore-1.6.0.min', 'd3': 'd3-3.4.11.min', 'sigma': 'sigma-1.0.2.min', 'my-own-npm-module': 'my-own-npm-module-1.0.0.min', 'app': '../modules' }, shim: { 'bootstrap': { deps: ['jquery'], exports: '$' } } }); // App loading requirejs([ 'jquery', 'bootstrap', 'app/graph' ], function ($, bootstrap, graph) { graph.initialize(); }); My graph.js file, requiring the unfortunately undefined sigmaJs define(['sigma', 'd3', 'my-own-npm-module'], function (sigma, d3, MyOwnModule) { var initialize, graph; initialize = function () { console.log('init', d3, sigma, sigma === window.sigma, MyOwnModule); // Here, d3 is well loaded and even MyOwnModule. // But unfortunately, sigma is undefined even if window.sigma is loaded // And of course, sigma === window.sigma returns false. graph = new sigma('graph-container'); } return { 'initialize': initialize } });

http://stackoverflow.com/q/25046808
tagged with: angular-ui
favorite count: 0
tagged with: angularjs
score: -2
type: AnsweredQuestion
tagged with: angularjs-ng-change
downvote count: 2
has answer: http://stackoverflow.com/a/25363241
type: Question
upvote count: 0
has title: Angular Checkbox with n-Change - "this"?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25363241
has body: I have a series of checkboxes: &lt;input type="checkbox" ng-change="??????"&gt; I need to set $scope.mode.someOtherValue = false if the checkbox is true. Is there a way to get the value of the checkbox in the ng-change so that I can use it to set the value of $scope.mode.someOtherValue
answer count: 1

http://stackoverflow.com/a/25068405
score: 1
upvote count: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25067752
answers question: http://stackoverflow.com/q/25067752
type: Answer
has body: I saw an estimation that each HTTP request costs around 40,000 machine instructions to execute. On mobiles it is even pricier I think. But I'd rather focus on another aspect - there are four types of mobile applications: Connected (all the time); Occasionally disconnected; Occasionally connected; Disconnected. Each case requires its own strategy. For example #3 will definitely require local DB and some synchronization means. For #2 it is enough to have some local caching with simple 15 minutes (or so) expiration time. It seems that you tend to choose #3. You need to think about client/server synchronization then. This can be quite non-trivial on some data architectures.

http://stackoverflow.com/a/24963046
answers question: http://stackoverflow.com/q/24962994
score: 0
has body: You're using jQuery and .next() wrong. Remove the inline event handler, use .find() instead of .next(), and try: function getId() { var get = $(this).find("div").attr("id"); alert(get); } $('a').click(getId) jsFiddle example
type: Answer

http://stackoverflow.com/a/32990269
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/53851257
answers question: http://stackoverflow.com/q/24955677
has body: In my case it was due to including jquery once again after included jquery-ui, So make sure jquery is included before jquery-ui.

http://stackoverflow.com/a/24977366
has comment: http://stackoverflow.com/comment/38874572
has comment: http://stackoverflow.com/comment/38868290
type: Answer
answers question: http://stackoverflow.com/q/24960288
has comment: http://stackoverflow.com/comment/40806534
score: 20
has body: 1) Why is the parent state being reinitialized when .go is called on a child state? While a transition is in process, any $state.go/transitionTo will cause the currently in process transition to be Superseded. An in-process transition that is superseded is cancelled immediately. Since your original transition to inventory is not completed by the time all the states' onEnters are called, the original transition is cancelled and a new transition to inventory.low is started from the previously active state. See ui-router src https://github.com/angular-ui/ui-router/blob/master/src/state.js#L897 ... 2) How then, would you handle redirecting to a child state? You could... Wrap $state.go in a $timeout() to allow the original transition to complete before redirecting. Call $state.go from your controller instead. UI-router invokes the controller from the ui-view directive AFTER the transition is completed. In any case, be very sure you want your app to redirect like this. If a user navigated directly to any other child state of inventory (such as inventory.high), the redirect will still occur, forcing them to inventory.low which would not be what they intended.
type: AcceptedAnswer
downvote count: 0
upvote count: 20
accepted answer of: http://stackoverflow.com/q/24960288
has comment: http://stackoverflow.com/comment/61883127

http://stackoverflow.com/q/25036787
has answer: http://stackoverflow.com/a/25036909
has answer: http://stackoverflow.com/a/25037384
has title: How to take an existing number and generate a random number based on it? [javascript]
answer count: 3
has comment: http://stackoverflow.com/comment/38939254
type: UnansweredQuestion
score: 0
linked to: http://stackoverflow.com/q/521295
has comment: http://stackoverflow.com/comment/38939261
has body: I want to take a single digit number input by the user and generate another single digit random number based on it. A real world equivalent would be a roulette or slot machine that starts at a specific value and then randomizes. This will generate a random number from 1-10, but does not involve any existing number as input. var randomnumber=Math.floor(Math.random()*10) Is this possible?
has answer: http://stackoverflow.com/a/25036862
linked to: http://stackoverflow.com/q/424292
type: Question
tagged with: random
has comment: http://stackoverflow.com/comment/38939302
has comment: http://stackoverflow.com/comment/38939269
tagged with: javascript
has comment: http://stackoverflow.com/comment/38939306

http://stackoverflow.com/q/24941429
has answer: http://stackoverflow.com/a/24941507
accepted answer: http://stackoverflow.com/a/24941507
has title: How to determine if an element has NO data-attr
tagged with: javascript
tagged with: jquery
score: -1
possible better answer: http://stackoverflow.com/a/24941486
has comment: http://stackoverflow.com/comment/38760459
downvote count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24941486
favorite count: 0
type: AnsweredQuestion
tagged with: custom-data-attribute
has body: I have a sort of a niche case here. So I'm building out a sidebar tool to utilize for quick note-taking, and I'm running into a problem without setting hundreds of data-attrs. Currently, I have a dropdown menu that displays content that contains a specific data-attr based on the selection and hides the rest. The problem I'm encountering is I also want it to display all items that do not contain any data-attrs. Is there a simple way to check if an item has no HTML defined data sets? HTML: AIV *** Appstore *** Fire TV *** Kindle *** Kindle Generic AIV Generic FireTV Generic Appstore Generic jQuery: $(function(){ var ou = ""; $('#ouSelect').change(function() { ou = $('#ouSelect option:selected').data('ou'); ouSelected(ou); }); function ouSelected(which){ $('li').each(function(){ if($(this).data(which) === undefined){ $(this).hide(); } else { $(this).show(); } }) } }); CodePen: http://codepen.io/anon/pen/GyqoK As you can see, all of the generic sets disappear when an option is selected. Ideally I'd want the items with data-kindle to display as well as items with no data-attrs at all. Any ideas how to accomplish this? Any help is appreciated!
type: Question
answer count: 2
linked to: http://stackoverflow.com/q/1894792

http://stackoverflow.com/comment/38792305
has text: @user3376708 I've added some more explanation
comment on: http://stackoverflow.com/a/24958519
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38928770
comment on: http://stackoverflow.com/q/25030789
has text: What does accordion() function do? I've replaced it with collapse() - isn't this what you want?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24939347
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24939548
score: 1
tagged with: css
possible better answer: http://stackoverflow.com/a/24939548
answer count: 2
has comment: http://stackoverflow.com/comment/38756305
has comment: http://stackoverflow.com/comment/38756337
has comment: http://stackoverflow.com/comment/38756616
has comment: http://stackoverflow.com/comment/38757112
has comment: http://stackoverflow.com/comment/38756820
has answer: http://stackoverflow.com/a/24939557
upvote count: 5
has title: How can I add a time delay to my divs, so they appear one after the other like a powerpoint slide?
accepted answer: http://stackoverflow.com/a/24939557
has body: So say I want div 1 to appear after 2 seconds, div 2 to appear after 7 seconds, and div 3 to appear after 15 seconds. Is there a way for me to add an inline style element that will make the divs go from hidden but occupying space to fully visible. I've been searching and most things I've found are hover/click triggered. I can't seem to find anything with a time trigger. Thank you. Edit: To make this more clear, I am looking for any kind of code that has a time delay to appear. When I search transition, I get a bunch of code based on actions, like a click or a hover. I am not looking for a user action to trigger this, just a time. When I search for animation, I get a bunch of results about moving images, which I also do not need. When I search for time delay, I get a bunch of results about time delay transitions, which is how long after the user action occurs does the transition occur which still requires user input, and I do not want user input. I am more asking what I should be looking for, if there is a word for it or something you are familiar that does this. I didn't provide any code because I don't want you coding me something. I'm asking for lead, because it is frustrating that I cannot find the proper word to identify what I need.
downvote count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38756593
has comment: http://stackoverflow.com/comment/38756528
tagged with: javascript

http://stackoverflow.com/q/24960459
has comment: http://stackoverflow.com/comment/41917411
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/41966152
upvote count: 12
has comment: http://stackoverflow.com/comment/40689211
has body: I am having trouble writing unit tests for some of my Angular directives. Particularly, those that use jQuery inside the directive. I have contrived an minimal example below that illustrates my issue. This silly directive binds the click event to the element. When clicked, it hides the element. According to Angular, elements passed into directives will be wrapped as jQuery elements. if jQuery is available it will use jQuery, otherwise it will use Angular's jQuery Lite. Indeed, if I use this directive in a browser with jQuery included, the directive works and will hide the clicked element. angular.module('myApp').directive('clickhide', function() { return { link: function(scope, element, attrs) { element.bind('click', function(e) { element.hide(); scope.$digest(); }); } }}); Here is the Karma unit test spec for this directive: describe('clickhide', function() { var scope, elm; beforeEach(module('MyApp')); beforeEach(inject(function($rootScope, $compile) { scope = $rootScope; elm = angular.element('&lt;div clickhide&gt;&lt;/div&gt;'); $compile(elm)(scope); scope.$digest(); })); it('should do a click', function() { elm[0].click(); //OOPS: undefined is not a function error expect($(elm).find(":hidden").length).toBe(1); }); }); When I run this test, it fails with an error of "undefined is not a function" meaning that jQuery was not loaded and Angular used jQuery Lite instead, which doesn't define hide(). I have found two ways to work around this. Don't use jQuery. Requires rewriting my directives which I don't want to do. Explicitly wrap elements in my directives to make them jQuery elements: $(element).hide(). Also requires modifications to my directives, which I would prefer not to do. If there is no alternative, I can certainly do this. I feel like it should be possible to get Angular to automatically use jQuery inside a directive when unit testing like it does when using in a web browser. I believe the key point is this line from Angular's documentation: To use jQuer…
has comment: http://stackoverflow.com/comment/39083966
has answer: http://stackoverflow.com/a/26094982
downvote count: 0
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has title: Test an Angular directive that uses jQuery
has comment: http://stackoverflow.com/comment/40918756
has comment: http://stackoverflow.com/comment/39039624
favorite count: 0
tagged with: angularjs
score: 12
type: Question
has comment: http://stackoverflow.com/comment/38988030
linked to: http://stackoverflow.com/q/21862757
answer count: 2
has comment: http://stackoverflow.com/comment/38991892
has comment: http://stackoverflow.com/comment/40853518
has comment: http://stackoverflow.com/comment/38854784
has answer: http://stackoverflow.com/a/63605812
has comment: http://stackoverflow.com/comment/38927988
has comment: http://stackoverflow.com/comment/40447045
has comment: http://stackoverflow.com/comment/38905816
tagged with: karma-runner

href
tags question: http://stackoverflow.com/q/25048203
tag name: href
type: Tag
tags question: http://stackoverflow.com/q/25010008
tags question: http://stackoverflow.com/q/24926508

download
tags question: http://stackoverflow.com/q/24974029
type: Tag
tags question: http://stackoverflow.com/q/25040970
tag name: download
tags question: http://stackoverflow.com/q/24959746
tags question: http://stackoverflow.com/q/25031477
tags question: http://stackoverflow.com/q/25055025

http://stackoverflow.com/comment/38976510
comment on: http://stackoverflow.com/a/25055024
type: AnswerComment
has text: Hahahahahhh nice image! :) like! :) Nobody said jQuery was needed, it's just this question attracted **a lot** of people with really poor knowledge and probably bad attitude. I gave on this Q 3 downz on A. You were not the one. On the contrary! ;) I would give a +2 if you only removed that inline JS...
type: Comment
score: 0

http://stackoverflow.com/comment/38841063
type: Comment
has text: Yes, that is part of it! Other than adding the rect.wid=wid/rect.hgt=hgt, what else changed?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24984125

http://stackoverflow.com/q/24938918
has body: I’m working on a SPA built with DurandalJS, which is hosted on app.example.com. The API is hosted on api.example.com. We're now planning to add backend administration for ourselves, to overlook our clients. We'll each have an account and we'll be able to manage our client stuff. What we're trying to figure out is where to host the backend. If we keep it on the app subdomain, we'll only have to add a new role (admin) to the existing application, but this will allow regular users to log in ti the backend if our credentials are somehow leaked. If we clone the existing application to admin.example.com, we'll always have to worry about the code being in sync, but it will be safer, because the admin subdomain will be closed to the public and the login for admins will require a different set of api and private keys. How should we handle this? If we go with #2, are there better ways to share code between two apps without the extra headaches?
has answer: http://stackoverflow.com/a/24954653
tagged with: durandal
has answer: http://stackoverflow.com/a/24955249
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24957667
possible better answer: http://stackoverflow.com/a/24955249
accepted answer: http://stackoverflow.com/a/24957667
tagged with: durandal-2.0
answer count: 3
upvote count: 1
tagged with: single-page-application
has title: SPA: Separating backend administration from client side
favorite count: 0

http://stackoverflow.com/a/25046448
score: 5
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25046269
answers question: http://stackoverflow.com/q/25046269
upvote count: 5
downvote count: 0
has body: your_object[0].Distance = 4.5; If you don't know the index beforehand: _.findWhere(your_object, {'_id': 68917}).Distance = 4.5;

http://stackoverflow.com/comment/38720842
has text: Remove `return false;`
score: 5
comment on: http://stackoverflow.com/q/24920274
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24988675
answer count: 1
tagged with: whmcs
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: php
tagged with: smarty
has title: Customizing the slider form shopping cart in viewcart.tpl
score: 0
has answer: http://stackoverflow.com/a/24989366
has body: I hope some of you are familiar with WHMCS and smarty template language so you can help me. The problem I am having is with viewcart.tpl page of the slider order form template. I want to hide the shopping cart and the complete order button on this page when you first enter this page. I want to add a continue button that loops back to the same page. When the page loops back to itself you be able to then see the cart and complete order button and the continue button will be hidden. I want the continue button to only work if the order form fields are filled out. Here is the code of that page: &lt;link rel="stylesheet" type="text/css" href="templates/orderforms/{$carttpl}/style.css" /&gt; &lt;script language="javascript"&gt;var statesTab=10;&lt;/script&gt; &lt;script type="text/javascript" src="templates/orderforms/{$carttpl}/js/main.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="includes/jscript/statesdropdown.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="includes/jscript/pwstrength.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="includes/jscript/creditcard.js"&gt;&lt;/script&gt; {literal}&lt;script language="javascript"&gt; function removeItem(type,num) { var response = confirm("{/literal}{$LANG.cartremoveitemconfirm}{literal}"); if (response) { window.location = 'cart.php?a=remove&amp;r='+type+'&amp;i='+num; } } function emptyCart(type,num) { var response = confirm("{/literal}{$LANG.cartemptyconfirm}{literal}"); if (response) { window.location = 'cart.php?a=empty'; } } &lt;/script&gt;{/literal} &lt;script&gt; var langPasswordStrength = "{$LANG.passwordstrength}"; var langPasswordWeak = "{$LANG.weak}"; var langPasswordModerate = "{$LANG.moderate}"; var langPasswordStrong = "{$LANG.strong}"; &lt;/script&gt; &lt;div id="order-slider"&gt; &lt;h1&gt;{$LANG.cartreviewcheckout}&lt;/h1&gt; {if $errormessage}&lt;div class="errorbox" style="display:block;"&gt;{$errormessage|replace:'&lt;li&gt;':' &amp;nbsp;#&amp;nbsp; '} &amp;nbsp;#…

http://stackoverflow.com/a/25034316
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38935984
has comment: http://stackoverflow.com/comment/38937500
has comment: http://stackoverflow.com/comment/38935089
type: Answer
has body: In order to satisfy the "click outside it should be closed" requirement, you will need some JS to keep track of when the window is opened and closed. When you open the window from the parent page, it will open a popup, and if you click on the parent page again, while the window is still open, the popup will close. ... Please fill out my form. Working demo: http://jsfiddle.net/spryno724/b857X/2/
has comment: http://stackoverflow.com/comment/38935856
has comment: http://stackoverflow.com/comment/38934915
has comment: http://stackoverflow.com/comment/38935335
has comment: http://stackoverflow.com/comment/38935209
has comment: http://stackoverflow.com/comment/38937909
has comment: http://stackoverflow.com/comment/38935809
accepted answer of: http://stackoverflow.com/q/25032974
has comment: http://stackoverflow.com/comment/38934890
has comment: http://stackoverflow.com/comment/38935736
has comment: http://stackoverflow.com/comment/38935122
answers question: http://stackoverflow.com/q/25032974
has comment: http://stackoverflow.com/comment/38935685
has comment: http://stackoverflow.com/comment/38935740
has comment: http://stackoverflow.com/comment/38935019
has comment: http://stackoverflow.com/comment/38938074
score: 0

http://stackoverflow.com/comment/38737269
score: 1
type: QuestionComment
has text: -1 You managed to achieve it in the demo you posted on the question yesterday http://stackoverflow.com/questions/24909498/3d-high-charts-multiple-series-inside-of-drilldown
type: Comment
comment on: http://stackoverflow.com/q/24926241

http://stackoverflow.com/q/25061186
has body: I'm making a basic d3 charge that pulls in data using d3.csv and then forwards it in an anonymous function like this d3.csv("https://example.com/report.csv", function(error, data) { console.log(data); data.forEach(function(d) { d.zeit = parseDate(d.zeit); d.total = +d.total; d.count = d.count; }); ...//code ommitted }); However, since there's not a lot of data, I thought would embed the csv data using the technique described in this answer, which removes the anonymous function above. The log statement reveals an array of objects exactly the same as above, however when I do it this way, the chart doesn't display and I get an error that seems to arise from an array Uncaught TypeError: Cannot read property 'length' of undefined var raw = d3.select("#csvdata").text(); var data = d3.csv.parse(raw); console.log(data) data.forEach(function(d) { d.zeit = parseDate(d.zeit); d.total = +d.total; d.count = d.count; }); ... Here is a fiddle for the first method https://jsfiddle.net/mjmitche/5Y6kf/3/ and here is a fiddle for the second one not working fiddle
accepted answer: http://stackoverflow.com/a/25061412
score: 0
type: Question
possible better answer: http://stackoverflow.com/a/25061419
answer count: 2
has answer: http://stackoverflow.com/a/25061419
tagged with: javascript
has title: replacing the anonymous function after embedding csv data
linked to: http://stackoverflow.com/q/16231266
has answer: http://stackoverflow.com/a/25061412
tagged with: d3.js
type: AnsweredQuestion

http://stackoverflow.com/a/63357374
score: 0
has body: Way to get it to do it on the axis labels only: var element = document.getElementById('&lt;?= $chartId; ?&gt;'); var chart = new google.visualization.BarChart(element); var $element = jQuery(element); chart.draw(data, options); $element.on('mouseover', 'g', function () { if (this.logicalname &amp;&amp; this.logicalname.match(/vAxis/)) $element.css('cursor', 'pointer'); }).on('mouseout', 'g', function () { $element.css('cursor', 'default'); }); Change vAxis to hAxis to make it working for the horizontal axis.
type: Answer
answers question: http://stackoverflow.com/q/24988412

http://stackoverflow.com/q/25021728
has comment: http://stackoverflow.com/comment/38911786
answer count: 2
tagged with: stringify
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25021773
has title: Different portions of JSON.stringify(new Date());
favorite count: 0
has comment: http://stackoverflow.com/comment/38911770
has comment: http://stackoverflow.com/comment/38911943
has body: 2014-07-29T16:55:46.657Z I believe it to be: YEAR-MONTH-DAYTHOURS:MINUTES:SECONDS.MILLISECONDSZ What is the purpose and full name of T and Z? Do they just serve as escape characters?
upvote count: 1
has comment: http://stackoverflow.com/comment/38911545
has answer: http://stackoverflow.com/a/25021773
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
possible better answer: http://stackoverflow.com/a/25021803
has answer: http://stackoverflow.com/a/25021803
type: Question
has comment: http://stackoverflow.com/comment/38911657

http://stackoverflow.com/comment/38851430
comment on: http://stackoverflow.com/a/24955870
score: 0
type: Comment
type: AnswerComment
has text: Thanks for your help Roshan... what I really wanted to do was give the rows in the table alterbate colors using nth child in css... how do i give the rows a class / target rows in the oTable for specific CSS...

http://stackoverflow.com/q/25048815
upvote count: 0
type: Question
tagged with: browser
has answer: http://stackoverflow.com/a/25049000
tagged with: c#
answer count: 2
score: -2
tagged with: javascript
has body: any way to make a double click at div by id? &lt;div id="item99900_3077996_51355704"&gt;&lt;/div&gt; There are a event at page for dblclick, so if i click by mouse all work's fine, but how can i click with webbrowser. I even tryed to inject javascript codes and nothing happens. browser.Document.GetElementById("item99900_3077996_51355712").InvokeMember("click"); browser.Document.GetElementById("item99900_3077996_51355712").InvokeMember("click"); This don't work 2. Thanks for any reply.
linked to: http://stackoverflow.com/q/906486
downvote count: 2
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25049162
accepted answer: http://stackoverflow.com/a/25049162
has title: C# webbrowser make a double click at div by id
favorite count: 0
possible better answer: http://stackoverflow.com/a/25049000
type: AnsweredQuestion

http://stackoverflow.com/q/24963696
answer count: 1
tagged with: python
has title: control java instance by (java script) interfaces from shell script?
type: UnansweredQuestion
tagged with: java
has body: I am absolutely new to java and am referring to a program energy2d. Its source code is here. It is run as an embeded applet(see at the website link in github, as I am not allowed to post more then one url) (functions with default locale for the browser) or on the command line: java -jar /home/ntu/Downloads/energy2d.jar And there are some commands for it, -I call them control interfaces further on, I guess they are some public methods but do not know the exact term for them - that control the program at runtime. see website manual scripts.html One can use them from inside the program in a embedded shell or you can see how they are called in the source of the website from java script at the embedded applet. I do not understand that well, it should just demonstrate that for example the string "reload" as a occurrence of the control interfaces is used in the page*s source. To my current knowledge I can not make out where they are defined; it is at github Scripter2D.java#L55 where I loose track within the java-code. (do not know if this helps) Now, what I want is to call these control interfaces from within an outside script. Let's say a bash script; well in the end I want it run python. something like command line pseudo code: snippet start java -jar /home/ntu/Downloads/energy2d.jar #to start the application java -do_to_running_program energy2d.jar -public_control_function load path/new_config.xml#to load another configuration file java -_do_to_running_program -public_control_function run #to restart snippet end Questions: -how is that achievable? -If it is not possible: what would be a good practice to change the java code in order to have this working? Any hints will be thanked.
tagged with: javascript
type: Question
score: 0
tagged with: bash
has answer: http://stackoverflow.com/a/24964284

http://stackoverflow.com/comment/38910230
type: AnswerComment
score: 1
type: Comment
has text: I've already tried that in both my app.js and main.js but it still states the same error. However, in both files I don't see a "var myApp =" where is that syntax usually?
comment on: http://stackoverflow.com/a/25021058

http://stackoverflow.com/a/24932296
has body: i think this can help you : var id1="td1";//the id of the TD you want to get the word from var id2="td2";//the id of the TD you want to put it into var tmp =$('#'+id1).html(); tmp = tmp.trim(); var word =tmp.substring(0,tmp.indexOf(' ')); $('#'+id2).html(word+' '+$('#'+id2).html());
has comment: http://stackoverflow.com/comment/38777043
score: 0
answers question: http://stackoverflow.com/q/24932163
type: Answer
has comment: http://stackoverflow.com/comment/38757275

http://stackoverflow.com/comment/38866649
has text: I guess you'll have to hack the jQuery Dialog source code then.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24998107
score: 0

http://stackoverflow.com/a/24979196
accepted answer of: http://stackoverflow.com/q/24979019
type: Answer
has body: If you want to call your functions from the html as you are doing, you need them to be in the global scope. Take the definitions for the functions go() and clear() out of the onreadystatechange function. You can still use that function to call the other two, but they must be defined globally. Also, you cannot simply change the value of the variable x and have that update the element with id=x on the page. Instead, you can use ELEMENT.setAttribute('value', '') to clear the value. function go() { alert("done"); } function clear() { var x = document.getElementById("x"); x.setAttribute('value', ''); } document.onreadystatechange = function () { if (document.readyState == "complete") { go(); clear(); } }
score: 0
answers question: http://stackoverflow.com/q/24979019
type: AcceptedAnswer

http://stackoverflow.com/q/24968075
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
type: UnansweredQuestion
has title: JavaScript button link on one page to show hidden div on another page
has answer: http://stackoverflow.com/a/24968154
has answer: http://stackoverflow.com/a/24968159
type: Question
answer count: 2
has body: I have a home.html and faq.html. The faq page has many questions and their answers listed consecutively down the page. I want the answers hidden until a question is clicked that opens that answer. When another question is clicked, it will close the previous answer and open the new one. I'd like to use slideUp/slideDown or fadeIn/fadeOut for that, but not essential. The home page has a link that when clicked, I want taken to the faq page and also have 'open' a specific answer, both from the one click; slideDown or fadeIn again not essential. Is there a JavaScript that can be used to perform the task? I have seen some posts with setvisibility type code somewhat acceptable for the faq page, but not that I can activate from my home page. I am a novice, so I ask for the html code too that I can insert on both pages. A bigger chore than usual I know! Many thanks. NOTE I now see a problem with my idea because of the following. I didn't mention it before but it would be neccessary. Let me try to explain it. I now find that to have a link on one page open another page at a particular position down that page will correctly position the page to that point IF previous content on that page is not hidden. If previous content is visibility: hidden;, that point where the page will open at is innacurate. In other words, it opens at a point below intended, a point at which is correct if previous content is not hidden. I hope that makes some sense. I will soon look at whether display:none; is better suited for this before I look at my original questions. Thanks to those who have helped me to date, you have spent a lot of time for me.
has comment: http://stackoverflow.com/comment/38811798
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38810316
has comment: http://stackoverflow.com/comment/38811197

http://stackoverflow.com/comment/38721293
type: QuestionComment
comment on: http://stackoverflow.com/q/24920408
score: 0
type: Comment
has text: After you disable them, maybe re-call the plugin on the element.

http://stackoverflow.com/comment/38899871
type: Comment
comment on: http://stackoverflow.com/a/25013505
has text: I don't know firebase/angularfire but looking at their website, and assuming that you are working with it, seems to be explained in https://www.firebase.com/docs/web/guide/structuring-data.html
score: 0
type: AnswerComment

http://stackoverflow.com/q/25025629
tagged with: javascript
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25025693
tagged with: multidimensional-array
answer count: 1
has comment: http://stackoverflow.com/comment/38919117
has body: I've got a json object with multiple levels, let's call it ZOO. var ZOO = { info: { cages: { amount: 5, size: { x: 1, y: 0.2 }, additionals: 'a broken bucket', }, }, }, myZoos = []; Now i want to clone &amp; alter this object then add it to an array called myZoos. window.JSON.clone = function (json) { return $.extend({}, json); }; for (var a = 1; a &lt;= 3; a++) { var newZoo = JSON.clone(ZOO); newZoo.info.cages.size = { x: (a * 5), y: (a * 2) }; myZoos.push(newZoo); } Let's read our filled array and check the random size values! for (var b = 0; b &lt; myZoos.length; b++) { var myZoo = myZoos[b]; console.log(myZoo.info.cages.size); } Result: Object { x: 15, y: 6 } Object { x: 15, y: 6 } Object { x: 15, y: 6 } Looks like i'm only getting the last value that was pushed to the array! Why is only the last item in the array returned?
upvote count: 1
tagged with: object
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38919089
score: 1
has answer: http://stackoverflow.com/a/25025693
has comment: http://stackoverflow.com/comment/38919111
has comment: http://stackoverflow.com/comment/38919133
tagged with: literals
has title: Values messed up when pushing Multi level Object Literal to array
type: Question
downvote count: 0

http://stackoverflow.com/a/24997545
has comment: http://stackoverflow.com/comment/38890884
has comment: http://stackoverflow.com/comment/38868952
downvote count: 0
has body: Well, let's try an analogy: function fetchIfNotCached(){ if(!cached){ doSomething(); } // nothing here } This is exactly like your case, only asynchronous. Because it utilizes promises you hook on the return value so: what am I supposed to return here? false? Anything you want, I'd personally probably just omit it and refactor it to if(!cached) return doSomething() in the .then. Promises chain and compose and you do not need to create them from callback interfaces unless there is a really good reason to do so. As for readTempFile you're doing a lot of excess work as it looks like getFileAsync already returns a promise. This is a variation of the deferred anti pattern and can be rewritten as: function(readTempFile){ return tempFolder.getFileAsync("tempFile.txt").then(function (file) { return file.openReadAsync(); }).then(function (stream) { // do stuff with the file, note the return as we wait for it }); }
has comment: http://stackoverflow.com/comment/38868792
type: Answer
answers question: http://stackoverflow.com/q/24997377
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38868832
has comment: http://stackoverflow.com/comment/38898132

http://stackoverflow.com/a/25031661
has comment: http://stackoverflow.com/comment/38933408
upvote count: 1
has body: The problem appears to be pretty simple. Since you invoke compiler from outside of angular digest cycle you have to invoke it manually to boost the process, for example by wrapping compiledHTMLFunc into $timeout service call: function compileHTML (htmlStr, scope, compiledHTMLFunc) { var $injector = angular.injector(["ng", "angularApp"]); $injector.invoke(function($rootScope, $compile, $timeout) { $rootScope = angular.extend($rootScope, scope); var obj = $compile(htmlStr)($rootScope); if (compiledHTMLFunc != null) { $timeout(function() { compiledHTMLFunc(obj); }); } }); } compileHTML('&lt;button class="btn btn-primary"&gt;{{value}}&lt;/button&gt;', {value: 'Ok'}, function(element) { angular.element(document.body).append(element); }); I also improved your code a little. Note how now compileHTML accepts an object instead of single value. It adds more flexibility, so now you can use multiple values in template. Demo: http://plnkr.co/edit/IAPhQ9i9aVVBwV9MuAIE?p=preview And here is your updated demo: http://jsbin.com/vuxazuzu/2/edit
accepted answer of: http://stackoverflow.com/q/25030024
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25030024
score: 1
has comment: http://stackoverflow.com/comment/38933967
has comment: http://stackoverflow.com/comment/38971202
type: Answer

http://stackoverflow.com/comment/38847965
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24987934
has text: Did you take into account all event handlers are gone when the elements are removed / re-added from DOM? You have to register the event in the elements higher in the tree
score: 0

http://stackoverflow.com/comment/38965030
has text: When you say on your computer: how do you run AngularJS? It needs a web server, just putting the files in the root of an Apache or node.js server will do
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25049953
type: QuestionComment

http://stackoverflow.com/q/24914868
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24915054
has comment: http://stackoverflow.com/comment/38714431
has title: One URL to round robin access variable login.html
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38710565
has comment: http://stackoverflow.com/comment/38710356
score: -1
type: Question
has comment: http://stackoverflow.com/comment/38710955
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38710455
has answer: http://stackoverflow.com/a/24915679
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38710478
has body: I need users to be able to access our program with one of ten user names/passwords without the user needing to know any of those. To fix this I have created multiple *.html and corresponding Javascript files to auto-populate user names/passwords. (xxxx.login.html, xxxx.login1.html, xxxx.login2.html, etc. - these point to login.js, login1.js, login2.js respectively) Can these be accessed “round robin” style from a link on another website? My goal is for the customer to go to a registration page, and click the access link, at which point one of the ten auto-logins will be accessed. The customer shouldn’t notice anything, other than a different user name at the top of the screen. (Each loginx.html is already verified and working to log the user in.)

http://stackoverflow.com/comment/38989113
comment on: http://stackoverflow.com/q/25061899
type: Comment
has text: You can probably just save the handler function and reset that (call `.on("mousedown.zoom")` to get the function).
type: QuestionComment
score: 2

http://stackoverflow.com/q/24924656
has comment: http://stackoverflow.com/comment/38728690
answer count: 4
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24924778
has title: Javascript Code does nothing when executed
accepted answer: http://stackoverflow.com/a/24924778
possible better answer: http://stackoverflow.com/a/24924738
type: Question
has answer: http://stackoverflow.com/a/24924738
has body: I'm attempting to build an incremental game, but NONe of my javascript code is working, whether I access it locally or upload it to a webhost. The HTML is as follows: Incremental! CLICK ME Clicks: 0 Auto Clicks Per Second: 0 BUY AN AUTOCLICKER TWO CLICKS PER CLICK TWO CLICKS PER AUTOCLICKER And the Javascript file(game.js) is as follows: var totalClicks = 0; $('#click').click(function(){ totalClicks++; document.getElementById("total_clicks").innerHTML = totalClicks; }); I cannot figure out why it isn't working...it's literally a copy and paste from a tutorial.
tagged with: javascript
has answer: http://stackoverflow.com/a/24925014
score: 0
has answer: http://stackoverflow.com/a/24924739
has comment: http://stackoverflow.com/comment/38728719
has comment: http://stackoverflow.com/comment/38728711
has comment: http://stackoverflow.com/comment/38728766
has comment: http://stackoverflow.com/comment/38728873

http://stackoverflow.com/a/24962625
answers question: http://stackoverflow.com/q/24961216
upvote count: 0
has body: Found the solution... The problem was that jQuery was treating the checkbox element as [object Object] instead of [object HTMLInputElement]. Therefore, to avoid the hassle, I just used plain old JavaScript to assign the functions and listeners and everything works now.
type: Answer
score: -1
downvote count: 1

http://stackoverflow.com/a/25021541
answers question: http://stackoverflow.com/q/25021383
has comment: http://stackoverflow.com/comment/38911284
score: 6
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/38911448
has comment: http://stackoverflow.com/comment/79416941
downvote count: 0
has body: There is no single event that would be authoritative, but you can bind to multiple events - $(':input').on('change keyup input', function() { console.log('changed'); }); P.S. I wanted to give you a +1 for using 'boom shakalaka' in an example, but I digress.

http://stackoverflow.com/comment/38730645
score: 0
has text: Are you sure you want `var` in there? It seems like you should just have `export default foo` **or** `export var foo`. I can't find any examples where they use `export default var ...`
comment on: http://stackoverflow.com/q/24925628
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24916287
tagged with: xss
score: 0
answer count: 2
upvote count: 1
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38714568
downvote count: 1
has title: Further XSS character escapement explanation
favorite count: 0
has answer: http://stackoverflow.com/a/24928620
has answer: http://stackoverflow.com/a/24916444
accepted answer: http://stackoverflow.com/a/24916444
tagged with: regex
tagged with: escaping
type: AnsweredQuestion
has body: So, I've noticed that XSS primarily relies on unescaped angle braces to insert html markup. I have this code here: XSS Blocker Insert into page Disable XSS Which in essence simply escapes the < and > characters before inserting text into the webpage. In an related question (Escaping < Good Enough to Prevent XSS Attacks), I read that one also has to declare the charset (which people should be doing anyway) to prevent UTF-7 XSS, and should also escape the ampersand, backslash and both the single and double quote characters for safety. To gain a better understanding of how and why the 'extra' characters (&, ', ") could possibly be harmful (and because it will also be fun to learn), I would like to see code that hijacks my above program using those characters. I know that this isn't quite a question, more of a quest for knowledge, but I hope it is fine.
type: Question
possible better answer: http://stackoverflow.com/a/24928620
linked to: http://stackoverflow.com/q/22799576
has comment: http://stackoverflow.com/comment/38713297
tagged with: javascript

http://stackoverflow.com/q/24940540
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38837737
has comment: http://stackoverflow.com/comment/38820349
answer count: 0
downvote count: 0
has body: I've done my obligatory Googling and I can't seem to find a suitable answer to this... Is there a way to determine the upload and download rate/speed over a web socket connection using JavaScript? For instance, if I want to pull canvas data from a very large canvas (or use any other large chunk of data) and pass it to the server over a web socket connection in a single message, is there a way to determine how long it takes that message to actually send, though not necessarily have been received by the server? Maybe breaking the data into smaller pieces and sending over a series of messages would work also, but still, I don't know of a way to determine when the message was actually sent. I'm aware that AJAX gives upload and download progress, but I'd prefer to use web sockets if possible.
tagged with: websocket
favorite count: 0
type: Question
tagged with: sockets
score: 5
tagged with: http://stackoverflow.com/tag/html
has title: Determining transfer speed over websocket
upvote count: 5

http://stackoverflow.com/comment/38735709
type: Comment
comment on: http://stackoverflow.com/a/24924163
type: AnswerComment
has text: do you want it to go to automaticall copy to your clipboard?
score: 0

http://stackoverflow.com/comment/38782097
score: 0
type: Comment
type: QuestionComment
has text: To be clear, I tried with element spawner buttons, different order, dragging them etc etc, and it still worked. So it may be either problem with your browser or I did not understand you correctly.
comment on: http://stackoverflow.com/q/24951328

http://stackoverflow.com/a/64994332
answers question: http://stackoverflow.com/q/24967735
has body: $(document).ready(function () { $(window.location.hash).modal('show'); $('a.open-modal-hash').click(function () { window.location.hash = $(this).attr('href'); }); $(".modal").on("hidden.bs.modal", function () { // any time a modal is hidden var urlReplace = window.location.toString().split('#', 1)[0]; history.pushState(null, null, urlReplace); // push url without the hash as new history item }); }); /* Modal Full Screen */ .modal-full-screen { padding: 0 !important; } .modal-full-screen .modal-dialog { width: 100%; max-width: none; height: 100%; margin: 0; } .modal-full-screen .modal-content { height: 100%; border: 0; border-radius: 0; } .modal-full-screen .modal-body { overflow-y: auto; } &lt;a href="#modal-hash" class="open-modal-hash" data-toggle="modal"&gt;Open Modal&lt;/a&gt; &lt;div class="modal fade modal-full-screen" id="modal-hash"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;h6&gt;Title&lt;/h6&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt; &lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt; &lt;/button&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;
score: 0
type: Answer

http://stackoverflow.com/q/25021482
has comment: http://stackoverflow.com/comment/38913215
tagged with: javascript
has comment: http://stackoverflow.com/comment/51271606
has answer: http://stackoverflow.com/a/41359346
tagged with: ajax
upvote count: 7
linked to: http://stackoverflow.com/q/5674130
tagged with: salesforce
favorite count: 0
tagged with: oauth
tagged with: rest
has body: I have an app in my salesforce developer account that I want to allow my users to access from a remote app that I am building. I see that I must use OAuth2.0 to first authorize my users before they are allowed to access the salesforce data. At the moment I am trying to use the username-password OAuth flow described on salesforce. Step 1) I request access token using username and password via the below code snippet var password = 'userPassword' + 'securityToken' $.ajax({ type: 'GET', url: 'https://login.salesforce.com/services/oauth2/token', contentType: 'application/json', dataType: 'json', beforeSend: function(xhr) { xhr.setRequestHeader('grant_type','password'), xhr.setRequestHeader('client_id', '&lt;client_id_here&gt;'), xhr.setRequestHeader('client_secret', '&lt;client_secret_here'), xhr.setRequestHeader('username', 'username@location.com'), xhr.setRequestHeader('password', "password") }, success: function(response) { console.log('Successfully retrieved ' + response); //Other logic here }, error: function(response) { console.log('Failed ' + response.status + ' ' + response.statusText); //Other logic here } }); My request, however, is failing with the following message: 1) OPTIONS https://login.salesforce.com/services/oauth2/token 400 (Bad Request) 2) XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. No 'Access- Control-Allow-Origin' header is present on the requested resource. Origin http://localhost is therefore not allowed access. I have seen some sources (here here here) mention that CORS is not supported in salesforce, and that another solution should be used. Some solutions I have seen are Salesforce APEX code, AJAX toolkit, or ForceTK. In summary, I am looking to see if (1) there is a simple mistake that I am making with my above request to get the OAuth access_token (2) or if I need to do something different to get the access (3) is there a better way to login users and access their salesforce data from my connected app? All a…
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38911100
has title: Salesforce OAuth with REST API using Javascript
answer count: 4
downvote count: 0
has answer: http://stackoverflow.com/a/25028273
score: 7
has answer: http://stackoverflow.com/a/25040297
type: Question
has answer: http://stackoverflow.com/a/60861906
has comment: http://stackoverflow.com/comment/38911113

http://stackoverflow.com/comment/38833193
comment on: http://stackoverflow.com/a/24969091
score: 0
has text: By "fine" I mean that calling them serializable in broad terms is ok. Most of the times serializing an object doesn't include methods and/or references (at least in Javascript and PHP).
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24927892
has comment: http://stackoverflow.com/comment/38736250
accepted answer of: http://stackoverflow.com/q/24927677
answers question: http://stackoverflow.com/q/24927677
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38735718
score: 3
has body: The Short Answer is: Don't use a loop. Use a javascript variable to keep track of the quiz step where the user currently is. The Long Answer: 1) Create a new variable to keep track of quiz step $(document).ready(function () { var quizstep = 0; var questionArray = [ { question: "The Netherlands", choices: ["Amsterdam", "Monaco", "Chisinau"], correctAnswer: 0 }, { question: "Austria", choices: ["Bern", "Vienna", "Copenhagen"], correctAnswer: 1 }, { question: "Bulgaria", choices: ["Budapest", "Sofia", "Minsk"], correctAnswer: 1 }, { question: "Sweden", choices: ["Stockholm", "Malmo", "Gothenburg"], correctAnswer: 0 }, { question: "Latvia", choices: ["Vilnius", "Skopje", "Riga"], correctAnswer: 2 }, { question: "Lithuania", choices: ["Riga", "Skopje", "Vilnius"], correctAnswer: 2 }]; ... 2) Replace askQuestions function with the one below. ... function askQuestions() { if(quizstep &lt; questionArray.length) { questionField.empty(); presentQuestion(questionArray[quizstep]); quizstep++; } } ...
upvote count: 3

http://stackoverflow.com/q/25003944
linked to: http://stackoverflow.com/q/13903016
favorite count: 0
score: 0
duplicate of: http://stackoverflow.com/q/13903016
has comment: http://stackoverflow.com/comment/38877776
answer count: 4
accepted answer: http://stackoverflow.com/a/25004188
has answer: http://stackoverflow.com/a/25004145
has answer: http://stackoverflow.com/a/25004074
upvote count: 1
has body: So I know this question was, very similarly asked before, however I did not find the answer in that feed as the answer did not work with my other JavaScript. Here's my problem. I am trying to add in a menu to change the background on a form I am working on. I cannot figure out how to make the background change to an image when an is selected from the field. I would like to accomplish this with just JavaScript, but I will use JQuery if need be. Select a New Background pic1 pic2 pic3 pic4 pic5 pic6
downvote count: 1
has answer: http://stackoverflow.com/a/25004114
type: Question
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25004074
has title: Changing the background to a picture based on an value selection
has answer: http://stackoverflow.com/a/25004188
has comment: http://stackoverflow.com/comment/38879294
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24981401
type: AnsweredQuestion
has body: the below is a part of code in my project. I want the java script to display another php page after submitting the form to the database. for testing purpose i tried a simple alert box to be displayed on click of submit button of form. but the script shows no response` &lt;table width="100%" height="100%" border="0"&gt; &lt;tr&gt; &lt;td height="31"&gt; &lt;form onsubmit="open()" action="addguestbook.php" method="post"&gt; &lt;font face="Verdana" size="2" &gt; Name: &lt;/font&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" name="name"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;font face="Verdana"size="2"&gt;E-mail:&lt;/font&gt; &lt;/td&gt; &lt;td&gt; &lt;input type="text" name="email"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="31"&gt; &lt;font face="Verdana" size="2"&gt;Comment:&lt;/font&gt; &lt;/td&gt; &lt;td&gt; &lt;textarea rows="4" name="comment" cols="23" wrap="hard"&gt;&lt;/textarea&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="31"&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt; &lt;input type="submit" value="Submit"&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;input type="Reset" value="Reset"&gt; &lt;/form&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;strong&gt; &lt;a href="viewguestbook.php"&gt;View Guestbook&lt;/a&gt; &lt;/strong&gt; &lt;script&gt; function open() { alert("Welcome"); } &lt;/script&gt;
has title: unresponsive javascript, on clicking submit
has answer: http://stackoverflow.com/a/24981624
type: Question
has comment: http://stackoverflow.com/comment/38835113
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24981624
score: 0
has comment: http://stackoverflow.com/comment/38835049
answer count: 1
has comment: http://stackoverflow.com/comment/38835168
has comment: http://stackoverflow.com/comment/38835203
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38835025
has comment: http://stackoverflow.com/comment/38835107

http://stackoverflow.com/q/25063868
has comment: http://stackoverflow.com/comment/39731254
accepted answer: http://stackoverflow.com/a/25462846
downvote count: 0
tagged with: undefined
possible better answer: http://stackoverflow.com/a/25068604
favorite count: 0
has answer: http://stackoverflow.com/a/25068604
has comment: http://stackoverflow.com/comment/39029549
has comment: http://stackoverflow.com/comment/103996690
tagged with: node.js
has title: Node require returns undefined
has body: I have an ErrorHandler class in my node code that handles all occuring errors. Every Error has its own class. All classes are placed in seperate files so the folder structure is: ErrorHandler.js Error110.js Error131.js ... ErrorHandler requires each of these files (along with some others) var serverErrorCodes = require('../../config/ErrorCodesConfig').server, clientErrorCodes = require('../../config/ErrorCodesConfig').client, Error110 = require('./errors/Error110').Error110, Error131 = require('./errors/Error131').Error131, Error132 = require('./errors/Error132').Error132, Error133 = require('./errors/Error133').Error133, Error150 = require('./errors/Error150').Error150; When checking in node-debugger during runtime, the require result ist: Closure: Error110: function Error110(params) Error131: function Error131(params) Error132: undefined Error133: undefined Error150: function Error150(messageObject, callback) Error132 and Error133 are not available after the require, while the others are perfectly. I've read that this happens if you have a require cycle and thus a required module (A) is requiring a module (B) which again requires module A. Node then ends this cycle by returning undefined after the first require. This is not the case. So my last guess is that, at the time of execution, due to the asynchronous nature of node, the files are "not yet" required and thus only "some" files get included. But require is a synchronous function. I am not certain if this scenario is possible and how I would check for it. I am clueless here, help is much appreciated. Best regards, Worp Edit 1: As Travis Webb pointed out: This is wrong! It also happens if your require a module that is already included somewhere earlier in the code. I thought about this but I am not requiring a module. And over all this doesn't seem to be true, since, for example, the util module needs to be included in every file that it is used, instead of just once.
has comment: http://stackoverflow.com/comment/38990693
upvote count: 7
has answer: http://stackoverflow.com/a/79435704
has answer: http://stackoverflow.com/a/25462846
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/104012365
score: 7
tagged with: javascript
tagged with: require
answer count: 3

http://stackoverflow.com/a/24978311
has comment: http://stackoverflow.com/comment/38829499
has body: If you are a web developer and want to send data from a JavaScript file (client side) to a C# file (server side), you can use jQuery Ajax. You can pass variables to a function in a C# file. Remember that you must add the [WebMethod] attribute to your C# function, and the function must be static. $.ajax({ type: "post", url: "Default.aspx/YourMethodName", contentType: "application/json; charset=utf-8", dataType: "json", data: JSON.stringify({ varOne: one , varTwo:two }), success: function (v) { alert("Success"); }, error: function (error) { alert("Error"); }, complete: function () { alert("Complete"); } });
answers question: http://stackoverflow.com/q/24978198
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/a/24932042
has comment: http://stackoverflow.com/comment/38742583
has comment: http://stackoverflow.com/comment/38744134
score: 0
has comment: http://stackoverflow.com/comment/38744632
answers question: http://stackoverflow.com/q/24931919
type: Answer
has body: A canvas can be created, but it must be added to the DOM as well. Try something like this: var canvas = document.createElement( 'canvas' ); canvas.id = 'canvasID'; document.body.appendChild( canvas ); document.getElementById( 'canvasContainer' ).appendChild( canvasID ); Once, the canvas is appended to the DOM, you can start your animation.

http://stackoverflow.com/comment/38715371
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24912600
has text: Ooops blogger doesn't support php !!
type: AnswerComment

http://stackoverflow.com/a/25008034
accepted answer of: http://stackoverflow.com/q/25006066
has comment: http://stackoverflow.com/comment/38921583
answers question: http://stackoverflow.com/q/25006066
score: 0
has comment: http://stackoverflow.com/comment/38923299
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38923144
has body: Totally. This is where Angular shines. Just add an object into an array and let ng-repeat do the work. Try this out. HTML Enter Name: &lt;input type ="text" ng-model="name"&gt; &lt;br /&gt; &lt;div id="data"&gt; Id Number: {{num}}&lt;br /&gt; Name: {{name}} &lt;/div&gt; &lt;form ng-submit=addUser()&gt; &lt;input class="btn btn-primary" type="submit" value="New User"&gt; &lt;/form&gt; &lt;div ng-repeat="user in users"&gt;{{user.name}}: {{user.id}}&lt;/div&gt; Javascript $scope.num = 1000; $scope.users = []; $scope.addUser = function () { $scope.num++; $scope.users.push({ name: $scope.name, id: $scope.num }); }
type: Answer
has comment: http://stackoverflow.com/comment/38922060

http://stackoverflow.com/a/25074192
answers question: http://stackoverflow.com/q/25039471
type: Answer
has body: You can use Snap svg to load svg files and then manipulate them after loading: http://svg.dabbles.info/snaptut-load-animate.html And here in their web site they a getting started page and click on number 15 and you can see how an image is loaded and then part of the image selected and manipulated : http://snapsvg.io/start/ I hope it helps!
score: 0

http://stackoverflow.com/comment/38942392
type: QuestionComment
comment on: http://stackoverflow.com/q/25038264
score: 0
type: Comment
has text: **YES/NO** Functions are just like any other variables in JS. You can store them to variables, pass them to functions and return them from other functions. However, there are no C++ style references in JavaScript. See my answer (and James's)

http://stackoverflow.com/q/24996841
has comment: http://stackoverflow.com/comment/38864492
tagged with: iframe
type: AnsweredQuestion
has title: Call controller from click within an iframe with angular
upvote count: 1
has comment: http://stackoverflow.com/comment/38865051
type: Question
downvote count: 0
has answer: http://stackoverflow.com/a/24997979
tagged with: javascript
tagged with: jquery
has body: I am trying to bind an event to an iframe so that no matter where in the iframe is clicked, the event fires a function in the angular controller. I am trying to do this with just the jquery lite that ships with angular, or with pure javascript, whichever solution I happen across first. I have been trying variations on this but not having any luck: angular.element('iframe').contents().find('html').bind('click', function () { alert("hello"); });
answer count: 1
score: 1
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24997979

http://stackoverflow.com/a/25023406
has comment: http://stackoverflow.com/comment/38915508
type: Answer
has comment: http://stackoverflow.com/comment/38915493
has body: Set position of your main container as relative and of each image containers as absolute. http://jsfiddle.net/ehu5j/
answers question: http://stackoverflow.com/q/25023272
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38915760
has comment: http://stackoverflow.com/comment/38915571
accepted answer of: http://stackoverflow.com/q/25023272
score: 0
has comment: http://stackoverflow.com/comment/38915022
has comment: http://stackoverflow.com/comment/38915277

http://stackoverflow.com/q/25063264
tagged with: opera
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/25063425
has comment: http://stackoverflow.com/comment/38989538
has comment: http://stackoverflow.com/comment/38989454
tagged with: styles
type: Question
type: AnsweredQuestion
has body: I have this html code for my button: Click and this javascript code for set display style the button: function setstyleint() { var divArray = document.getElementById('processLink'); divArray.style.display = 'initial'; } it work in ff and chrome very good. but in opera and ie(my version is 9) do not work, is there any help? best regards.
accepted answer: http://stackoverflow.com/a/25063425
has title: how set style display in opera?
has comment: http://stackoverflow.com/comment/38989419
has comment: http://stackoverflow.com/comment/38990039
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38989893
score: 0

google-oauth
type: Tag
tags question: http://stackoverflow.com/q/25065194
tag name: google-oauth

http://stackoverflow.com/q/24918476
possible better answer: http://stackoverflow.com/a/24918667
has answer: http://stackoverflow.com/a/24918536
answer count: 3
has answer: http://stackoverflow.com/a/24918667
score: 1
favorite count: 0
has title: Retrievving eventTarget after addEventListener in javascript
accepted answer: http://stackoverflow.com/a/24918536
type: AnsweredQuestion
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
has body: I have 2 input fields in an html document. Username : &lt;input type="text" name="username" id="username"&gt;&lt;div id='use'&gt;&lt;/div&gt; Email : &lt;input type="text" name="email" id="email"&gt;&lt;div id='ema'&gt;&lt;/div&gt; And a javascript file. window.onload = initialise; function initialise() { username = document.getElementById('username'); username.addEventListener('keyup', respond, false); email = document.getElementById('email'); email.addEventListener('keyup', respond, false); } function respond() { //code } Is there any way in which I can know inside the respond() function whether it was the username field or the email field for which the respond() method is called? Both procedural code and OOP is welcome thought procedural code is preferred.
has answer: http://stackoverflow.com/a/24918777

http://stackoverflow.com/comment/69893890
comment on: http://stackoverflow.com/a/32828983
type: AnswerComment
score: 0
type: Comment
has text: @Atav32 gulp (using libraries like FUSE) will concatenate all js files into one, following the tree sctructure and probably alphabetical order of files and folders. So module A would be declared first than module B, which could be the wanted default.

http://stackoverflow.com/comment/38837941
type: Comment
has text: Yes, a semi-transparent overlay of "frost" would not be as satisfying without the blur effect on the content. Perhaps add some "noise" to the frost? It's important to control the content so that you can get access to the content's pixels. The blur effect is created by altering pixels, so without access to the pixels the blur effect is not possible. Currently, it's not possible to get a reliable snapshot of a web page unless you satisfy the cross-domain security requirements. And this security cannot be satisfied unless you control the content.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24978760

http://stackoverflow.com/comment/39040512
comment on: http://stackoverflow.com/a/25069279
has text: Ah ha! This does seem to be exactly the type of solution I was looking for! I haven't had a chance to try it out yet but I am accepting it as it does clearly seem to be the intended method of accomplishing this.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38969850
has text: The function you wrote didn't work, but `setTimeout` did. Thanks.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25035468

http://stackoverflow.com/q/25054411
score: 0
possible better answer: http://stackoverflow.com/a/25054529
linked to: http://stackoverflow.com/q/25060510
has answer: http://stackoverflow.com/a/25054594
tagged with: angularjs
has title: How can I wait until the previous method returns OK before running the next method in AngularJS / JavaScript
answer count: 4
has answer: http://stackoverflow.com/a/25055646
has body: In my signUp method, I fetch a API token for the user, then I redirect him to a different page. How can I postpone the redirection until I have received the token? The URL that I want to redirect to is in data.url. $scope.signIn = () -&gt; $http( # Perform a regular Devise login method: "POST" url: "/users/sign_in" data: authData ).success (data) -&gt; getUserToken($scope.email, $scope.password) $scope.current_user = data.user # Redirect to URL # The redirection needs to wait for the getUserToken. $window.location = data.url getUserToken = (username, password) -&gt; $http( method: "POST" url: "/oauth/token" params: params ).success((data, status, headers, config) -&gt; $scope.$storage.token = data.access_token Refactored code getUserToken = (username, password) -&gt; console.log "I'm first" $http( method: "POST" url: "/oauth/token" params: params ).success((data, status, headers, config) -&gt; $scope.$storage.token = data.access_token $http.defaults.headers.common.Authorization = \ "Bearer #{data.access_token}" ) defer = $q.defer() $scope.signIn = (data) -&gt; defer.promise .then( getUserToken($scope.email, $scope.password) ) .then( deviseLogin() ) .then( redirect(url) ) # redirect() is never executed. redirect = (url) -&gt; console.log "I'm last" console.log "will redirect to #{url}" $window.location = data.url deviseLogin = () -&gt; console.log "I'm second" authData = { user: { email: $scope.email, password: $scope.password }} $http( # Perform a regular Devise login method: "POST" url: "/users/sign_in" data: authData ) .success (data) -&gt; console.log "logged in with Devise" console.log "data.url: #{data.url}" return data.url
type: AnsweredQuestion
tagged with: oauth-2.0
has answer: http://stackoverflow.com/a/25054529
type: Question
tagged with: devise
tagged with: javascript
has answer: http://stackoverflow.com/a/25054481
accepted answer: http://stackoverflow.com/a/25054481

http://stackoverflow.com/q/25018297
has answer: http://stackoverflow.com/a/25018372
tagged with: regex
has comment: http://stackoverflow.com/comment/38904898
has body: var str= 'String with replace string is bookingForm[0][0][seat_type]'; var $k=5; for(var $i=0; $i&lt;5; $i++){ var t = str.replace(/[0][0]/g,'['+$k+']['+$i+']'); //use t below } But [0][0] doesnt get replaced. What should the regex be.
type: AnsweredQuestion
has title: How do I replace the contents of [0][0] in a js string
has answer: http://stackoverflow.com/a/25018342
has comment: http://stackoverflow.com/comment/38904943
accepted answer: http://stackoverflow.com/a/25018336
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25018336
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/25018342

http://stackoverflow.com/comment/38995018
comment on: http://stackoverflow.com/q/25066120
type: Comment
type: QuestionComment
has text: Try `parents` or `closest`
score: 3

http://stackoverflow.com/q/25021080
type: Question
tagged with: javascript
has title: Dependency Management Javascript + AngularJS
has comment: http://stackoverflow.com/comment/38910369
score: 0
tagged with: dependencies
tagged with: angularjs
has body: In my current AngularJS project I am trying to improve my structure a bit. I know, there are better approaches but I want my project to look like this: controllers/FirstCtrl.js controllers/SecondCtrl.js controllers/ThirdCtrl.js app.js In this case, everytime I add a new Controller I would have to insert it with a script tag in the index.html file. I want to avoid this. What are good approaches to solve this problem? Thanks in advance!
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/38912879

http://stackoverflow.com/comment/38705354
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24911062
has text: Thank you for so many replies! Fabrizio, ideally, yes. I want basically create a stats table of how many of different SAME characters occur in a string. A=a would do too, i.e. not case sensitive. Commas, spaces and dots would be good to know too.
type: Comment

http://stackoverflow.com/comment/38850200
comment on: http://stackoverflow.com/q/24984603
has text: @ZachSaucier: The link that you have given, it always rotates circle by 30 deg i.e, fixed angle. But in my case calculated angle is random which is creating a little confusion.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24999308
tagged with: mysql
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38869660
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38869288
upvote count: 0
has body: I want to output my database record which is UserName Placement Position Jimmy left JLO Jimmy left Shinobi JLO left trialuser4 JLO right donald_duck trialuser4 left minnie_mouse donald_duck left mickeymouse donald_duck right dr_octopus mickeymouse left dr_cucumber dr_octopus left mr_brown111 dr_octopus right If my tree start with JLO, I wanna output it like JLO Shinobi trialuser4 donald_duck minnie_mouse mickeymouse dr_octopus dr_cucumber mr_brown111 But using mysql and php, how do I draw the record and output it just like my jsFiddle html code. Thanks for helping &amp; enlightening !
tagged with: jquery
has answer: http://stackoverflow.com/a/25002975
favorite count: 0
has comment: http://stackoverflow.com/comment/38869612
type: Question
has comment: http://stackoverflow.com/comment/38874911
tagged with: php
has title: PHP mysql to output org chart/tree hierarchy
score: -1

http://stackoverflow.com/q/24909434
type: Question
has body: Here's the scenario: I login to my site, at which point the browser asks me if I would like to save my details, I click yes. Later on I wish to change my password, so I go to the change password page. The browser automatically assumes the 'old password' input box is a login box and puts in the current password. This means all I have to do is type in a new password twice and the password will be changed. It is easy to see how this is a potential security risk... I have tried a couple methods to override this which were: Explicitly setting the input value to blank in HTML. Setting autocomplete to off in HTML. Using Javascript to set the value to blank (on page load, click, setTimeout). None of my attempts thus far have worked. So my question is: Is there a cross browser solution that allows a developer to override/specifically declare where passwords should and shouldn't be filled in by the browser?
has comment: http://stackoverflow.com/comment/38699426
tagged with: javascript
answer count: 3
has answer: http://stackoverflow.com/a/24919872
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has comment: http://stackoverflow.com/comment/38705588
linked to: http://stackoverflow.com/q/2530
has answer: http://stackoverflow.com/a/24919714
favorite count: 0
has title: How to stop the browser filling inputs with data
has comment: http://stackoverflow.com/comment/38699870
upvote count: 2
has comment: http://stackoverflow.com/comment/38699522
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/15074985
tagged with: input
has answer: http://stackoverflow.com/a/24919631
has comment: http://stackoverflow.com/comment/38699596
tagged with: css
has comment: http://stackoverflow.com/comment/38706330
score: 2
has comment: http://stackoverflow.com/comment/38699793
has comment: http://stackoverflow.com/comment/38699724
has comment: http://stackoverflow.com/comment/38700322

http://stackoverflow.com/comment/38806717
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24965232
has text: I changed it to this and my error from Ajax simply states internal server error. Yet everything is still executing as it should.

http://stackoverflow.com/comment/38841270
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24984299
has text: I would do research into the [Queue](https://github.com/caolan/async#queue) method, it looks like it may do what you want.
score: 0

twitter-bootstrap
tags question: http://stackoverflow.com/q/25060897
tags question: http://stackoverflow.com/q/24954804
tags question: http://stackoverflow.com/q/25036351
tags question: http://stackoverflow.com/q/24971906
tags question: http://stackoverflow.com/q/24982280
tag name: twitter-bootstrap
tags question: http://stackoverflow.com/q/24927868
tags question: http://stackoverflow.com/q/25017960
tags question: http://stackoverflow.com/q/24969621
tags question: http://stackoverflow.com/q/24914783
tags question: http://stackoverflow.com/q/25046308
tags question: http://stackoverflow.com/q/24940692
tags question: http://stackoverflow.com/q/25019131
tags question: http://stackoverflow.com/q/24926228
tags question: http://stackoverflow.com/q/24909819
tags question: http://stackoverflow.com/q/24947501
tags question: http://stackoverflow.com/q/25048420
tags question: http://stackoverflow.com/q/24929890
tags question: http://stackoverflow.com/q/25055682
tags question: http://stackoverflow.com/q/24987934
tags question: http://stackoverflow.com/q/24935069
tags question: http://stackoverflow.com/q/25060425
tags question: http://stackoverflow.com/q/24994315
tags question: http://stackoverflow.com/q/24949980
tags question: http://stackoverflow.com/q/24975116
tags question: http://stackoverflow.com/q/24942499
tags question: http://stackoverflow.com/q/24909766
tags question: http://stackoverflow.com/q/24923210
tags question: http://stackoverflow.com/q/25034503
tags question: http://stackoverflow.com/q/24928384
tags question: http://stackoverflow.com/q/24951453
tags question: http://stackoverflow.com/q/25015051
tags question: http://stackoverflow.com/q/24915511
tags question: http://stackoverflow.com/q/25050148
tags question: http://stackoverflow.com/q/25012851
tags question: http://stackoverflow.com/q/24941735
tags question: http://stackoverflow.com/q/25007300
tags question: http://stackoverflow.com/q/24911773
tags question: http://stackoverflow.com/q/24946423
tags question: http://stackoverflow.com/q/24933797
tags question: http://stackoverflow.com/q/25023436
tags question: http://stackoverflow.com/q/25008083
tags question: http://stackoverflow.com/q/24946747
tags question: http://stackoverflow.com/q/24978101
tags question: http://stackoverflow.com/q/24928466
tags question: http://stackoverflow.com/q/25060552
tags question: http://stackoverflow.com/q/24921101
tags question: http://stackoverflow.com/q/25066651
tags question: http://stackoverflow.com/q/24932643
tags question: http://stackoverflow.com/q/24966276
tags question: http://stackoverflow.com/q/24984237
tags question: http://stackoverflow.com/q/25001610
tags question: http://stackoverflow.com/q/25058396
tags question: http://stackoverflow.com/q/24967735
tags question: http://stackoverflow.com/q/25013137
tags question: http://stackoverflow.com/q/25037454
tags question: http://stackoverflow.com/q/24918630
tags question: http://stackoverflow.com/q/24987000
tags question: http://stackoverflow.com/q/25058598
tags question: http://stackoverflow.com/q/25060173
tags question: http://stackoverflow.com/q/24996297
tags question: http://stackoverflow.com/q/25028268
tags question: http://stackoverflow.com/q/25046163
tags question: http://stackoverflow.com/q/24992355
tags question: http://stackoverflow.com/q/24981072
tags question: http://stackoverflow.com/q/24961294
tags question: http://stackoverflow.com/q/25042697
tags question: http://stackoverflow.com/q/24967119
type: Tag
tags question: http://stackoverflow.com/q/24928385
tags question: http://stackoverflow.com/q/25026099
tags question: http://stackoverflow.com/q/25054905
tags question: http://stackoverflow.com/q/25013801
tags question: http://stackoverflow.com/q/24942636
tags question: http://stackoverflow.com/q/24942308
tags question: http://stackoverflow.com/q/25002072
tags question: http://stackoverflow.com/q/25060920
tags question: http://stackoverflow.com/q/24946127
tags question: http://stackoverflow.com/q/25036059
tags question: http://stackoverflow.com/q/24955122

http://stackoverflow.com/comment/38800030
comment on: http://stackoverflow.com/q/24962333
type: Comment
type: QuestionComment
has text: You might as well show us the other methods you're calling in index.php. Also, did you add these methods to the prototype of Div? How can you call them from the object?
score: 1

http://stackoverflow.com/q/24948577
answer count: 1
downvote count: 0
tagged with: jasmine
favorite count: 0
has body: I would like to Jasmine test that Welcome.go has been called. Welcome is an angular service. angular.module('welcome',[]) .run(function(Welcome) { Welcome.go(); }); This is my test so far: describe('module: welcome', function () { beforeEach(module('welcome')); var Welcome; beforeEach(inject(function(_Welcome_) { Welcome = _Welcome_; spyOn(Welcome, 'go'); })); it('should call Welcome.go', function() { expect(Welcome.go).toHaveBeenCalled(); }); }); Note: welcome (lowercase w) is the module Welcome (uppercase W) is the service
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24949238
tagged with: angular-mock
has comment: http://stackoverflow.com/comment/38775353
has comment: http://stackoverflow.com/comment/38774567
has title: How to Jasmine test code within angular module run block
type: AnsweredQuestion
tagged with: unit-testing
type: Question
has answer: http://stackoverflow.com/a/24949238
tagged with: javascript
score: 12
upvote count: 12

http://stackoverflow.com/a/24931212
has comment: http://stackoverflow.com/comment/38740785
score: 2
type: AcceptedAnswer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24930110
type: Answer
answers question: http://stackoverflow.com/q/24930110
has comment: http://stackoverflow.com/comment/38740948
has body: You probably don’t need the “actual URL”, but only the page id, I assume …? That you can get by decoding the signed_request parameter that gets POSTed to your app on initial load into the iframe. How to “decode” it is described here, https://developers.facebook.com/docs/facebook-login/using-login-with-games#parsingsr If you’re using the PHP SDK, that has a method already that does this for you.
has comment: http://stackoverflow.com/comment/38741019
has comment: http://stackoverflow.com/comment/38740874
downvote count: 0
has comment: http://stackoverflow.com/comment/38740839

http://stackoverflow.com/q/25016401
type: Question
answer count: 2
has body: I have this Function function ReFresh() { // myScript setTimeout('ReFresh()', 60000); } This executes myScript after 60 seconds but I do not want that. What I want is to execute myScript immediately and then repeat myScript every 60 seconds.
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25016456
favorite count: 0
possible better answer: http://stackoverflow.com/a/25016462
has title: Execute javascript then refresch script every 60 seconds
has answer: http://stackoverflow.com/a/25016462
accepted answer: http://stackoverflow.com/a/25016456
upvote count: 1
type: AnsweredQuestion
score: 1

angular-promise
tags question: http://stackoverflow.com/q/25014626
tags question: http://stackoverflow.com/q/24958628
tags question: http://stackoverflow.com/q/24947909
tags question: http://stackoverflow.com/q/25055691
tags question: http://stackoverflow.com/q/24909797
tags question: http://stackoverflow.com/q/25032282
tags question: http://stackoverflow.com/q/24919848
tag name: angular-promise
tags question: http://stackoverflow.com/q/24986974
tags question: http://stackoverflow.com/q/25066005
tags question: http://stackoverflow.com/q/25018293
type: Tag

http://stackoverflow.com/a/24993431
has body: try this... You need to add all labels under one div. ANSWER ONE ANSWER TWO ANSWER THREE Add following code in new shuffle.js file (function($){ $.fn.shuffle = function() { var allElems = this.get(), getRandom = function(max) { return Math.floor(Math.random() * max); }, shuffled = $.map(allElems, function(){ var random = getRandom(allElems.length), randEl = $(allElems[random]).clone(true)[0]; allElems.splice(random, 1); return randEl; }); this.each(function(i){ $(this).replaceWith($(shuffled[i])); }); return $(shuffled); }; })(jQuery); call to shuffle.js file Add following line of code in script tag to shuffle
accepted answer of: http://stackoverflow.com/q/24990878
answers question: http://stackoverflow.com/q/24990878
score: 5
type: AcceptedAnswer
type: Answer
upvote count: 5
downvote count: 0

http://stackoverflow.com/a/25068958
upvote count: 1
answers question: http://stackoverflow.com/q/25066417
type: AcceptedAnswer
has body: You must add this line to css of .btn: white-space: normal; .bootstrap-select .btn { white-space: normal; } Then you must set the correct initial width, padding and stuff. Hope this works.
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25066417
type: Answer

http://stackoverflow.com/comment/38969801
has text: Have you changed the permissions with "sudo chown -R $USER /usr/local" ?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25052705
type: QuestionComment

python
tags question: http://stackoverflow.com/q/24946479
tags question: http://stackoverflow.com/q/25062365
tags question: http://stackoverflow.com/q/24987791
tags question: http://stackoverflow.com/q/24914455
tags question: http://stackoverflow.com/q/24981756
tags question: http://stackoverflow.com/q/25020379
tags question: http://stackoverflow.com/q/24913699
tag name: python
tags question: http://stackoverflow.com/q/24932704
tags question: http://stackoverflow.com/q/24979984
tags question: http://stackoverflow.com/q/24941140
tags question: http://stackoverflow.com/q/25022693
tags question: http://stackoverflow.com/q/25011632
tags question: http://stackoverflow.com/q/25037296
tags question: http://stackoverflow.com/q/24980698
tags question: http://stackoverflow.com/q/24990497
tags question: http://stackoverflow.com/q/24923134
tags question: http://stackoverflow.com/q/25001610
tags question: http://stackoverflow.com/q/25036852
tags question: http://stackoverflow.com/q/25009241
type: Tag
tags question: http://stackoverflow.com/q/24963696
tags question: http://stackoverflow.com/q/25024416
tags question: http://stackoverflow.com/q/25000584
tags question: http://stackoverflow.com/q/25006572
tags question: http://stackoverflow.com/q/25036054
tags question: http://stackoverflow.com/q/25064876
tags question: http://stackoverflow.com/q/24993048
tags question: http://stackoverflow.com/q/24941642
tags question: http://stackoverflow.com/q/24971729
tags question: http://stackoverflow.com/q/24944148
tags question: http://stackoverflow.com/q/25049391

http://stackoverflow.com/comment/38913083
type: QuestionComment
has text: sorry abmitchell, i posted it prematurely, i've added the html and css
comment on: http://stackoverflow.com/q/25022168
score: 0
type: Comment

http://stackoverflow.com/comment/38791789
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24925090
has text: This is fantastic but the same issue from the other solution occurs where the background (let's say a gradient) set to the body does not dynamically cover: http://i.imgur.com/GyBMBY1.png

http://stackoverflow.com/a/24949238
accepted answer of: http://stackoverflow.com/q/24948577
answers question: http://stackoverflow.com/q/24948577
downvote count: 0
has body: Managed to figure it out. Here is what I came up with: 'use strict'; describe('module: welcome', function () { var Welcome; beforeEach(function() { module('welcome', function($provide) { $provide.value('Welcome', { go: jasmine.createSpy('go') }); }); inject(function (_Welcome_) { Welcome = _Welcome_; }) }); it('should call Welcome.go on module run', function() { expect(Welcome.go).toHaveBeenCalled(); }); });
has comment: http://stackoverflow.com/comment/49297655
score: 20
type: AcceptedAnswer
upvote count: 20
type: Answer

http://stackoverflow.com/q/24972699
has title: If Date is empty format_date() returns NaN/NaN/NaN insted of no value
has comment: http://stackoverflow.com/comment/38819188
has answer: http://stackoverflow.com/a/24972721
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24972721
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/24972865
has body: I am using jquery autocomplete onselect it is showing data in different text field. I am showing formatted date in #dob and #anniversery by using format_date() function select: function(event, ui) { $("#customerId").val(ui.item.id); $("#customerName").val(ui.item.value); var datefield = new Date(ui.item.dob); $("#dob").val(format_date(datefield)); var datefield1 = new Date(ui.item.anni); $("#anniversery").val(format_date(datefield1)); $("#address").val(ui.item.address); $("#mobNo").val(ui.item.mobno); }, }); function format_date(dt) { alert(dt); var dd = dt.getDate(); var mm = dt.getMonth() + 1; //January is 0! var yyyy = dt.getFullYear(); if (dd &lt; 10) { dd = '0' + dd; } if (mm &lt; 10) { mm = '0' + mm; } dt = mm + '/' + dd + '/' + yyyy; return dt; } }); Above code is working properly if ui.item.dob and ui.item.anni is not null. In case of null it is showing NaN/NaN/NaN If date value is empty it should not show anything in textbox. alert(dt) prints Invalide date. How to resolve this.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38819130
possible better answer: http://stackoverflow.com/a/24972865
type: Question
answer count: 2

http://stackoverflow.com/q/24937746
tagged with: javascript
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38755128
has title: Obtaining input values in table with loop using Jquery
has answer: http://stackoverflow.com/a/24937910
has body: I have a table that adds and removes rows with buttons and within each cell I have an input which I'm trying to pull out and form a JSON string. I'm pretty sure I'm nearly there however i've been going slightly crazy with getting values out of the input fields and into the variables to print the JSON. See the note in the comments by my problem string. Anyhelp with what selector I need to be using to pull data out the input. A table row looks like this: Remove This is how far I've got: var table = document.getElementById('myTable'); var rowLength = table.rows.length; console.log("rows"+rowLength); for(var i=2; i<rowLength; i+=1){ //check if row exists if (table.rows[i]) { var row = table.rows[i]; console.log("outer"+i); var cellLength = row.cells.length; for(var y=0; y<cellLength-1; y+=1){ var subtask = row.cells[y]; console.log("inner" + y); subtask.fields = {}; // THIS SELECTOR TO GET THE VALUE IN THE INPUTS IN THE ROW BELOW IS I BELIEVE THE PROBLEM. IT IS RETURNING BLANK IN THE ALERT WHICH I HAVE PUT INTO TEST. subtask.fields = {}; subtask.fields.parent = $('#dynatable > tbody > tr > td').val(); subtask.fields.assignee = $('#dynatable > tbody > tr > td').val(); subtask.fields.assignee = {}; subtask.fields.assignee.col4 = $('#dynatable > tbody > tr > td').val(); alert(subtask.fields.parent); } alert(JSON.stringify(subtask)); } } Thanks in advance for any help!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38753270
tagged with: http://stackoverflow.com/tag/json
tagged with: loops
type: Question
has comment: http://stackoverflow.com/comment/38754896

http://stackoverflow.com/comment/38856081
score: 0
has text: On Selection of tab i am adding few properties to "tabsController" scope, using those properties, i need to get the data in "someController" and its children.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24992460

http://stackoverflow.com/q/24946464
has comment: http://stackoverflow.com/comment/38770186
type: Question
score: 3
has answer: http://stackoverflow.com/a/24946565
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: Here is my Html code,index.html Home Men Women Cosmetics Accessories Services About Us Lorem Ipsum... Here is my Jquery code,to change external div and Here is my External Html.AboutUs.html About us Welcome From Ivory's Collection We export Clothes,Accessories and Branded cosmetics from Japan Directly. We are fully guranteed for quality and designs.We export Clothes,Accessories and Branded cosmetics from Japan Directly. We are fully guranteed for quality and designs.We export Clothes,Accessories and Branded cosmetics from Japan Directly. We are fully guranteed for quality and designs.We export Clothes,Accessories and Branded cosmetics from Japan Directly. We are fully guranteed for quality and designs.We export Clothes,Accessories and Branded cosmetics from Japan Directly. We are fully guranteed for quality and designs.We export Clothes,Accessories and Branded cosmetics from Japan Directly. We are fully guranteed for quality and designs. I tried with simple code for that, it worked. But in this files, it is not working. I don't know why... pls help me
accepted answer: http://stackoverflow.com/a/24946565
favorite count: 0
has title: How to insert External html code to Div with jquery
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38770189
upvote count: 3
has comment: http://stackoverflow.com/comment/38770299

http://stackoverflow.com/comment/38728366
type: Comment
has text: No, by my code garanted. So this is not solve my question, but thanks
score: 0
comment on: http://stackoverflow.com/a/24924417
type: AnswerComment

http://stackoverflow.com/q/24997341
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has title: Is there a way to replace all click events to mouse down
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38865145
answer count: 0
type: UnansweredQuestion
has body: I am creating an interface only for a touch screen and need to be sure that all events are triggered on mousedown since the screen may not register mouseup or click events. Is there a way to replace all events with mouse down events or some similar plugin that can be sued to ensure proper functionality? Thanks
has comment: http://stackoverflow.com/comment/38865220
tagged with: touch-event
has comment: http://stackoverflow.com/comment/38866665
tagged with: mouseevent

http://stackoverflow.com/comment/81050708
score: 1
comment on: http://stackoverflow.com/a/25031024
has text: Showing SectionalElement is not a constructor error.
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25010337
score: 3
downvote count: 0
upvote count: 3
answers question: http://stackoverflow.com/q/25010306
has body: You have no elements that have id="main" Try something like... &lt;main id="main"&gt; ... Or if you're trying to populate your text box... var el = document.getElementById('txtfile');
type: Answer
has comment: http://stackoverflow.com/comment/38889727

http://stackoverflow.com/q/24984448
score: 0
has body: I'm using the Shapeshift jQuery plugin http://mcpants.github.io/jquery.shapeshift/ which was pretty easy to set up and use. But now I want to be able to save the div order in local storage so that the next time browser is started the div order does not change. I'm absolutely new to localstorage (like I started reading about it a few hours ago) and I can't seem to figure it out. Please help me.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38841093
has answer: http://stackoverflow.com/a/24984540
linked to: http://stackoverflow.com/q/24969006
tagged with: local-storage
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38841143
has title: Save div order in local storage
tagged with: jquery-plugins
type: Question
has comment: http://stackoverflow.com/comment/38841111
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24984540
tagged with: jquery

relative-path
type: Tag
tags question: http://stackoverflow.com/q/24921950
tag name: relative-path

http://stackoverflow.com/comment/38815629
has text: Thank you! This is really helpful. Can you explain just a bit more about what you mean in your second section of code, about changing the 'code' {radius: Math.random() * 33 + 4} line? I've made the modifications you mentioned below but I'm not quite clear how I change from the randomly generated figures to the specified radii.
type: Comment
comment on: http://stackoverflow.com/a/24970584
type: AnswerComment
score: 0

http://stackoverflow.com/a/24984651
has body: try this: for (var i=0; i&lt;store.products.length;i++) { if (!isValid(store.products[i])) { delete store.products[i]; } } function isValid(product) { return (product.type &amp;&amp; product.description &amp;&amp; product.price); }
downvote count: 0
answers question: http://stackoverflow.com/q/24984608
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/38823439
score: 0
comment on: http://stackoverflow.com/q/24975036
type: Comment
type: QuestionComment
has text: The first step toward finding out would be to actually *examine the code*. Specifically look at the *client-side* code which produces the error, as well as identify specifically *on which line* the error occurs. You haven't done any of that.

http://stackoverflow.com/a/25015801
answers question: http://stackoverflow.com/q/25015399
type: Answer
has body: I think the way you use the attribute and property aren't 100% accurate, properties (.prop()) in the jQuery context are basically the value of the attribute in memory, where as .attr() reflects the value in the markup. This is only the case for HTML attributes that are "built-in". So in your example, you're dealing with attributes all the way, just some don't happen to have any value. The best way of detecting the presence of an attribute, cross browser using jQuery: $('#myElement').is('[attrName]') === true So, in your case: $('#abc').is('[isDate]') === true See this JS-Fiddle
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25015399

http://stackoverflow.com/comment/38988891
type: Comment
comment on: http://stackoverflow.com/a/25043602
has text: Hey, forgive me for my impertinent stupidity, but while this answer tells me how to accomplish my goal, I'm still lost as to why `$scope` cannot have one of these types of objects directly put on it. @akskap, do either of you know the answer to that?
score: 0
type: AnswerComment

http://stackoverflow.com/a/25050673
upvote count: 3
has comment: http://stackoverflow.com/comment/38966015
downvote count: 1
has comment: http://stackoverflow.com/comment/39015954
has body: Your parameter is obj and returning o that's typo: getheightWidth(o, className) //replaced obj to o { var span = document.createElement("P"); span.className = className; span.style.visibility = "hidden"; o.width = $(span).width(); o.height = $(span).outerHeight(false); return o; }
has comment: http://stackoverflow.com/comment/38967566
has comment: http://stackoverflow.com/comment/38967332
has comment: http://stackoverflow.com/comment/38966036
has comment: http://stackoverflow.com/comment/38966618
has comment: http://stackoverflow.com/comment/38966645
type: Answer
has comment: http://stackoverflow.com/comment/38967638
has comment: http://stackoverflow.com/comment/38967887
score: 2
answers question: http://stackoverflow.com/q/25050652

http://stackoverflow.com/comment/38786033
score: 3
comment on: http://stackoverflow.com/q/24955333
type: Comment
has text: Images can't run Javascript. Where is this script running?
type: QuestionComment

http://stackoverflow.com/comment/38967332
has text: span.style.width="350px"
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25050673

http://stackoverflow.com/q/25059028
has body: Excuse me for very dumb question, I am very new to Ruby On Rails. Am trying to Create a mockup of a page, the page has two Views, Product View One and Product View Two. There is a small Content Variation in two views, Trying to achieve it through setting a variable product_view_one = true or false. Now my question is How to append a variable in ROR using Javascript or Ajax? Below is the code.. <% product_view_one = [true].sample %> <th colspan="<%= product_view_one ? "5" : "4" %>"> <%= rand(1..20) %> Published <%= rand(1..8) %> Dtafts <%= rand(1..8) %> Expired <!— View Change —> Product View One <!— Product View Two <%= product_view_one ? "Users" : "" %> <%= product_view_one ? "Group" : "Audience" %> Updates <% if !product_view_one %> Expiration <% end %> Published <% 10.times do |i| %> <%= Faker::Lorem.words(rand(2..5)).join(' ').capitalize %> <% if product_view_one %> <% [1, 2, 3, 4].sample.times do %> <%= ["Service", "UX", "Wireframes", "Misc"].sample %> <% end %> <% end %> <% if !product_view_one %> <% [1, 2, 3, 4].sample.times do %> <%= ["Service", "UX", "Wireframes", "Misc"].sample %> <% end %> <% else %> <% rand(1..9).times do %> <%= Faker::Name.first_name %>, <% end %> <% end %> <% if product_view_one %> <% rand(1..9).times do %> <%= Faker::Name.first_name %>, <% end %> <% end %> <% if !product_view_one %> <% if [true, false, false].sample %> <%= rand(1..999) %> <% else %> <%= rand(1..9) %> <% end %> <% end %> <% if [true, false, false].sample %> <%= rand(1..28) %> <%= ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul"].sample %> by <%= Faker::Name.first_name %> <% else %> <%= "-" %> <% end %> <% if !product_view_one %> <%= rand(1..150) %> days <% end %> Oct 28 <% end %> <!— jQuery Code to set the variable —>
tagged with: ruby
answer count: 0
tagged with: ruby-on-rails
has comment: http://stackoverflow.com/comment/38982026
type: Question
has comment: http://stackoverflow.com/comment/38982061
has comment: http://stackoverflow.com/comment/38982336
score: 0
has comment: http://stackoverflow.com/comment/38981643
has comment: http://stackoverflow.com/comment/38982778
tagged with: javascript
has title: Append a variable in ROR using Javascript or Ajax
has comment: http://stackoverflow.com/comment/39010000
type: UnansweredQuestion

http://stackoverflow.com/a/24961742
has comment: http://stackoverflow.com/comment/38799072
has body: The [ indicates an array, so you need to treat it as an array (data.users[0], not just data.users): if($.inArray('userName', data.users[0]) == -1) { alert('not in array'); } if(data.users[0].hasOwnProperty('userName')){ alert('do something'); }
score: 2
has comment: http://stackoverflow.com/comment/38799256
upvote count: 2
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24961697
accepted answer of: http://stackoverflow.com/q/24961697
type: Answer

http://stackoverflow.com/a/24946121
has comment: http://stackoverflow.com/comment/89055837
has comment: http://stackoverflow.com/comment/73398022
answers question: http://stackoverflow.com/q/24945284
accepted answer of: http://stackoverflow.com/q/24945284
score: 6
type: AcceptedAnswer
downvote count: 0
has body: You should be able to place a static JSON file in the public directory and load it directly. Assuming a file called static.json in the public directory, all you need to load it is: $.getJSON('/static.json', function(data) { console.debug(data); });
has comment: http://stackoverflow.com/comment/89055527
type: Answer
has comment: http://stackoverflow.com/comment/89016762
upvote count: 6

http://stackoverflow.com/q/25051843
has answer: http://stackoverflow.com/a/25052122
has comment: http://stackoverflow.com/comment/38968089
has comment: http://stackoverflow.com/comment/38968183
favorite count: 0
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
answer count: 2
has body: I need a functionality, where on click of the button, i need to slide up a menu and at the same time on move out of the button or of the popup menu, the menu has to be closed(slideDown). I have multiple buttons in the page, which contains the menu, so on moving to another button on clicking menu will be opend or moving out to some other elements in DOM also i need to close the Menu. Please suggest.
has answer: http://stackoverflow.com/a/25051961
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Pop up menu on click of the button

http://stackoverflow.com/comment/38784442
comment on: http://stackoverflow.com/q/24952118
type: Comment
type: QuestionComment
has text: tried on python..........its working fine der....
score: 0

http://stackoverflow.com/q/25024255
tagged with: http://stackoverflow.com/tag/html
answer count: 1
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38916611
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25024794
has comment: http://stackoverflow.com/comment/38916774
has title: How to Define Element By Two Attributes C#?
upvote count: 1
downvote count: 1
type: Question
tagged with: c#
has body: Is it possible to define an element of a web page by two attributes? For instance, I can find the element by its innertext Element imagePage = ActiveBrowser.Find.ByContent(pageNumbers[p],FindContentType.InnerText); Or I can define an element by part of its element id Element imagePage = ActiveBrowser.Find.ById("p:p") But can I define it by using both? The elements themselves are recreated every time the program is run so the only constant is the inner text but that is not enough to differentiate it from other elements on the web page, the only way I can think to differentiate the element is by adding another identification method which will use the first part of the element id, in this case p, that also remains constant and is unique to that specific element. Any help will be greatly appreciated.
tagged with: javascript
score: 0

http://stackoverflow.com/q/24930926
upvote count: 1
downvote count: 1
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24931065
answer count: 1
tagged with: javascript
score: 0
has body: some beginner question here but i can't seem to find a working answer for my problem. I want to write a self executing, global javascript class 'foo' whose methods can be called from window context (like window.foo.bar() or just foo.bar() in javascript console), without having to instantiate the class. At the same time, i want to be able to extend said class with custom functions, e.g. foo.fn.baz = function() {} This is how far i have gotten this far: (function (window) { var foo = function() { return this; }; foo.fn = foo.prototype = { bar: function (string) { console.log(string); } }; window.foo = foo; })(window); When i execute this javascript, the js console now knows the class foo, and i can extend its functions via foo.fn.baz = function(){} but i can't call those functions: foo.bar is undefined. If i change the code from window.foo = foo; to window.foo = new foo();, then i can call the functions, but i can't extend the class anymore. How do i do this rigt? Is my code anywhere near the right way to do such a thing? Is it even possible to get both things at the same time? Anyone with an idea or a hint? Anything would be great. thanks
favorite count: 0
accepted answer: http://stackoverflow.com/a/24931065
has title: Javascript: Generating a self executing class that is callable and extendable in window context

http://stackoverflow.com/comment/38930937
type: QuestionComment
has text: y do u have two jquery files?.One should do the job. conflict might be for some other reason..I dont see any conflict in my system-Chrome browser V28.0.1
score: 1
comment on: http://stackoverflow.com/q/25018053
type: Comment

http://stackoverflow.com/a/25289582
has comment: http://stackoverflow.com/comment/78896300
has comment: http://stackoverflow.com/comment/53796410
type: Answer
upvote count: 6
has body: If I understand your question well, it seems you want to deploy your app. Since pm2 0.9 deployment can be done with pm2 deploy see README. In the case of grunt/gulp, I see two options: You've your node_modules comitted. Using pm2 deploy run your gulp process from the post-deploy section: "post-deploy" : "node ./node_modules/gulp/bin/gulp.js ./GulpFile.js &amp;&amp; pm2 startOrRestart ecosystem.json --env production" Using a basic script that will launch npm install for you, you could use the package.json to grunt/gulp: "scripts": { "test": "echo \"Error: no test specified\" &amp;&amp; exit 1", "start": "node server.js", "postinstall": "./node_modules/bower/bin/bower -q -s -f install &amp;&amp; ./node_modules/gulp/bin/gulp.js" }, My gulp generally needs bower to minify scripts so I left it only for example purpose. You may combine the two options to let pm2 deploy install your npm scripts and have a postinstall script in the package.json. Note that I'm using the relative path to the gulp module binary! It's just to avoid an issue if the global module is not installed. Now, in my opinion to deploy an application in production it's better to simply have a git branch where everything is pre-gulped so that you only clone that branch and you're good to go. It also improves the deploy time, especially if you're running tests with gulp or grunt... Hope that's clear enough!
score: 6
accepted answer of: http://stackoverflow.com/q/25007130
answers question: http://stackoverflow.com/q/25007130
has comment: http://stackoverflow.com/comment/78898459
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38713491
has text: possible duplicate of [File input 'accept' attribute - is it useful?](http://stackoverflow.com/questions/181214/file-input-accept-attribute-is-it-useful)
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24916441

http://stackoverflow.com/a/24929034
type: Answer
downvote count: 0
score: 1
upvote count: 1
has body: LEAVE jQuery Part . This is not possible by setting HTML static markup WITH select Containing DIV . SO IT IS NOT POSSIBLE . u may use markup but , still It wil hide in browser even though u can see in Firebug , div is attached to dropdown. But if u r asking for : add Text as option in dropdown , then , Working FIDDLE $('#categoryInputAddBtn').click(function () { var myDiv = $('#categoryInput').val(); //this.append(myDiv); var option = $('&lt;option/&gt;'); option.attr({ 'value': 'myValue' }).text(myDiv); $('#platypusDropDown').append(option); });
has comment: http://stackoverflow.com/comment/38736980
answers question: http://stackoverflow.com/q/24928716
has comment: http://stackoverflow.com/comment/38736920

http://stackoverflow.com/comment/38880193
type: Comment
has text: Not sure if this is supported. We haven't tested this. Do you have an example of where you have tried this?
type: QuestionComment
comment on: http://stackoverflow.com/q/25003557
score: 0

http://stackoverflow.com/comment/38870038
score: 1
has text: @SterlingArcher - Oh, not really, the number of answers I write, that I never get to post, just because someone beats me with two liners, is stunning. I'm actually not a very fast typer, nor a native english speaker, but I get lucky sometimes.
type: AnswerComment
comment on: http://stackoverflow.com/a/24999925
type: Comment

http://stackoverflow.com/q/24932704
tagged with: http://stackoverflow.com/tag/html
tagged with: python
type: AnsweredQuestion
downvote count: 2
type: Question
accepted answer: http://stackoverflow.com/a/24932840
has comment: http://stackoverflow.com/comment/38743611
has comment: http://stackoverflow.com/comment/38743543
upvote count: 0
score: -2
has title: How do I send parameters from html code to ajax?
tagged with: javascript
tagged with: jquery
has body: I'm using Flask, html and Ajax. html code: + = ? calculate server side Python Code: @app.route('/_add_numbers') def add_numbers(): a = request.args.get('a', 0, type=int) b = request.args.get('b', 0, type=int) return jsonify(result=a + b) I want to "Text Input" to remove, How do I send parameters by the following code (html code) to function ? calculate server side For Example : calculate server side
answer count: 1
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/24932840

http://stackoverflow.com/comment/38881022
type: QuestionComment
comment on: http://stackoverflow.com/q/25005634
has text: Fixed that - still rotating the image.
score: 0
type: Comment

http://stackoverflow.com/q/24967006
has title: Hiding elements having specific attributes
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38808401
possible better answer: http://stackoverflow.com/a/24967114
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24967114
accepted answer: http://stackoverflow.com/a/24967073
tagged with: javascript
has body: I have a script which lists several thousand images, each in a separate div. Something like this: What I'm looking to do, is to somehow tag the divs with filesizes and dimensions, so it would be easy for me to hide duplicate image-divs, just by clicking on them. See below what im thinking: Can you understand what I'm trying to do? I have no idea for valid ways to "tag" the divs for finding them based on these criteria. Maybe there's other ways to do it?
has comment: http://stackoverflow.com/comment/38808448
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/24967073

http://stackoverflow.com/comment/38997143
type: AnswerComment
comment on: http://stackoverflow.com/a/25066985
type: Comment
has text: Yep. Seems to be the case.
score: 0

http://stackoverflow.com/comment/38806184
type: AnswerComment
comment on: http://stackoverflow.com/a/24965117
score: 0
type: Comment
has text: @emiidee Thanks again, but I'm dealing with a textarea element (http://www.w3schools.com/tags/tag_textarea.asp). Also, I must support older browsers so the new HTML5 maxlength attribute for textarea doesn't get me where I need to go.

http://stackoverflow.com/comment/38711671
comment on: http://stackoverflow.com/a/24915564
has text: I think OP doesn't ask for a page refresh, just a comment reload.
type: Comment
score: 2
type: AnswerComment

http://stackoverflow.com/comment/38865861
has text: Check this http://stackoverflow.com/questions/332422/how-do-i-get-the-name-of-an-objects-type-in-javascript
score: 0
comment on: http://stackoverflow.com/q/24997724
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38900413
has text: add oninvalid="setCustomValidity('your message')"
score: 1
comment on: http://stackoverflow.com/q/25015912
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24915010
has title: Google Maps Routing W/ AngularJS
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24916706
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/54103416
tagged with: angularjs
answer count: 2
has answer: http://stackoverflow.com/a/24916706
has answer: http://stackoverflow.com/a/54103416
tagged with: url-routing
score: 0
tagged with: google-maps
tagged with: javascript
has body: I have created an app that uses Google Maps, the map showed up before I did my routing. But after routing it wont display. Here is my code for the app. JS: search-controller.js (function() { searchController.$inject = ['$scope']; function searchController($scope) { $scope.ASiteLocs = [There Is Code In here that is too long and irrelevant to the map]; $scope.SSiteLocs = [""]; $scope.SiteLocs = $scope.SSiteLocs.concat($scope.ASiteLocs); angular.forEach($scope.SiteLocs, function(location) { var clength = location.Point.coordinates.length; if (location.Point.coordinates.substring(clength - 2, clength) === ",0") { location.Point.coordinates = location.Point.coordinates.substring(0, clength - 2).split(","); Lat = location.Point.coordinates[0]; Lon = location.Point.coordinates[1]; Com = ","; location.Point.coordinates = Lon.concat(Com, Lat); } angular.forEach($scope.SSiteLocs, function(object) { object.carrier = 'Sprint'; }); angular.forEach($scope.ASiteLocs, function(object) { object.carrier = 'AT&T'; }); }); } angular.module("siteLookUpApplication").controller('searchController', searchController); }()); map-controller.js (function() { mapController.$inject = ['$scope', '$routeParams']; function mapController($scope, $routeParams) { function initialize() { var mapOptions = { center: site.Point.coordinates, zoom: 5 }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); // Save the locationName in the url to the scope $scope.locationName = $routeParams.locationName; } angular.module("siteLookUpApplication").controller("mapController", mapController); }()); app.js (function() { angular.module("siteLookUpApplication", ["ngRoute"]); angular.module("siteLookUpApplication").config(function($routeProvider) { $routeProvider .when("/search", { templateUrl: "search.html", controller: "searchController" }) .when("/map/:locationName", { templateUrl: "map.html", controller: "mapController" })…
type: Question

http://stackoverflow.com/comment/38913872
type: QuestionComment
comment on: http://stackoverflow.com/q/25022774
has text: Well, the error message `'arguments.slice' is not a function` that you get is not hard to understand?
score: 0
type: Comment

http://stackoverflow.com/comment/38894016
type: Comment
has text: Can you replicate with a [JSFiddle](http://jsfiddle.net/)? It [works fine for me](http://jsfiddle.net/s23rd/)
type: QuestionComment
comment on: http://stackoverflow.com/q/25012535
score: 1

http://stackoverflow.com/a/25024116
score: 0
has body: rather than switch_to.alert, how about drv.switch_to_alert() where drv is your driver instance. I can't see anything in the python source that's immediately obvious by grepping that looks like the switch_to. syntax is supported. I would have posted a comment, but I don't have the reputation to do so.
answers question: http://stackoverflow.com/q/25022693
type: Answer
has comment: http://stackoverflow.com/comment/38916765

http://stackoverflow.com/comment/38883013
type: AnswerComment
comment on: http://stackoverflow.com/a/25006725
type: Comment
has text: Hrmm.. I think I have a server running? I'm using a mac and I've got apache running. For example, if I try to open localhost index.php that contains the simple "<?php phpinfo(); ?>", this works fine. Does that mean I have a server running?
score: 0

http://stackoverflow.com/a/25047658
type: Answer
downvote count: 7
has comment: http://stackoverflow.com/comment/106744062
has comment: http://stackoverflow.com/comment/70731667
has body: You can do this without Underscore: var result = data.reduce(function(acc, x) { var id = acc[x.platformId] if (id) { id.payout += x.payout id.numOfPeople += x.numOfPeople } else { acc[x.platformId] = x delete x.platformId } return acc },{}) But why would you want an object with numeric keys? You could convert it back to a collection: var toCollection = function(obj) { return Object.keys(obj) .sort(function(x, y){return +x - +y}) .map(function(k){return obj[k]}) } toCollection(result) Note that objects are mutated, so you may to clone them first if you want to maintain the original data.
score: 5
upvote count: 12
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25047463
has comment: http://stackoverflow.com/comment/76190823
accepted answer of: http://stackoverflow.com/q/25047463

http://stackoverflow.com/q/24917454
tagged with: firefox
tagged with: javascript
type: UnansweredQuestion
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: firefox-addon-sdk
tagged with: css
answer count: 1
has answer: http://stackoverflow.com/a/24939155
has title: Remove close button for Firefox SDK-toolbar
score: 0
has body: I would like to know how to style a Firefox addon toolbar using the SDK. For example, a toolbar will have a 3d-border around it with a close button on the right. How can I remove/modify this? here's an image

http://stackoverflow.com/q/25066930
tagged with: http://stackoverflow.com/tag/html
has body: On my website, I want do render a on top of a with some other 's in it. This is all working okay, however, drawing in the canvas is not possible, because it's positioned under the main . You can test it in the codepen below. You can only draw on a small strip near the bottom. Codepen: http://codepen.io/anon/pen/hfmBG Code: Console.log
tagged with: css
accepted answer: http://stackoverflow.com/a/25067166
type: AnsweredQuestion
type: Question
tagged with: canvas
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Canvas rendered under div instead of over the div
has answer: http://stackoverflow.com/a/25067166
score: 0

http://stackoverflow.com/comment/38804266
type: Comment
type: QuestionComment
has text: @SomeGuy, I am having the problem on the most recent firefox.http://jsfiddle.net/JLMw5/
comment on: http://stackoverflow.com/q/24964647
score: 0

http://stackoverflow.com/q/24944714
downvote count: 1
favorite count: 0
tagged with: time
tagged with: datetime
tagged with: ember.js
possible better answer: http://stackoverflow.com/a/24944867
has body: I'm working with a Python backend API that gives me date/time in a string represented as such: 2014-07-21T16:50:34.144Z What is this format, and how might I use javascript in my Ember app to put that string into a human readable format?
type: AnsweredQuestion
upvote count: 0
has title: How do I convert API supplied date/time string into readable format?
has answer: http://stackoverflow.com/a/24960616
accepted answer: http://stackoverflow.com/a/24960616
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/24944867
score: -1

http://stackoverflow.com/comment/38857938
comment on: http://stackoverflow.com/q/24993051
score: 0
type: QuestionComment
type: Comment
has text: And what about 'option' ? If I want to set height or padding, thn ?

http://stackoverflow.com/a/35994827
type: Answer
has body: Look for all or part of imperativements words : element.select2({ matcher: function(term, text){ if (term.length &lt; 3) { return true } var terms = term.split(" "); var count = 0; var nbterm = terms.length; for(i in terms) { if (text.toUpperCase().match(new RegExp(terms[i], "i"))) { count++ } if(nbterm == count){ return true; } } return false; } });
answers question: http://stackoverflow.com/q/24980403
score: 0

http://stackoverflow.com/comment/38956561
type: AnswerComment
score: 0
type: Comment
has text: Thanks. Exactly as I wanted buddy. I am not a PRO. So, had to. :D
comment on: http://stackoverflow.com/a/25045581

http://stackoverflow.com/a/24935429
answers question: http://stackoverflow.com/q/24932493
has comment: http://stackoverflow.com/comment/38764851
has body: If you round your scroll value numbers to integers then this problem goes away : http://jsfiddle.net/2Cj4S/15/ I just used a rounding function : function toInt(n){ return Math.round(Number(n)); }; and this seems to have fixed it. Double values really confused GUI widgets like scrollbars, and 2D drawing.
score: 5
has comment: http://stackoverflow.com/comment/38777464
type: Answer
upvote count: 5
downvote count: 0

http://stackoverflow.com/comment/38881209
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25004069
has text: Randomly generating a `filename.png?randomstuff` is the only way I know of
type: QuestionComment

http://stackoverflow.com/q/24934331
answer count: 2
has answer: http://stackoverflow.com/a/24935032
has title: CSS Values in a D3 Transition box shadow
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24935539
upvote count: 2
tagged with: d3.js
type: UnansweredQuestion
score: 2
type: Question
has body: I'm wanting to do a d3 transition based on style based in the css. However I am not able to do it for the box-shadow. Have I made a mistake or is it not supported? var first = d3.select('.first'), second = d3.select('body').append('div').attr('class', 'second').style('display', 'none'), color = second.style('box-shadow'); first.transition().duration(3000).style('box-shadow', color); .first { width: 100px; height: 100px; box-shadow: 0px 0px 4px 1px gray inset; } .second { width: 100px; height: 100px; box-shadow: 0px 0px 4px 1px blue inset; } Here is the example in fiddle: http://jsfiddle.net/zasDK/4/ Here is a working example that works with background-color (I based my code on this one): http://jsfiddle.net/linssen/zasDK/

http://stackoverflow.com/comment/38955170
type: Comment
type: QuestionComment
has text: With a real error it might help, in this case it doesn't seem to. weird. I would have expected to see status 404
comment on: http://stackoverflow.com/q/25043909
score: 0

http://stackoverflow.com/q/25020237
tagged with: jquery
has title: How to make this button?
score: 0
has answer: http://stackoverflow.com/a/25020355
tagged with: submit
has comment: http://stackoverflow.com/comment/38908774
tagged with: datatable
has comment: http://stackoverflow.com/comment/38908736
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25020317
accepted answer: http://stackoverflow.com/a/25020355
has comment: http://stackoverflow.com/comment/38908799
has answer: http://stackoverflow.com/a/25020317
has body: How to submit form elements with jQuery datatables I have the following code (for datatable). Now i need to make the button to activate this code. I tried but don't now how to make this button. Can someone help? var oTable; $(document).ready(function() { $('#form').submit( function() { var sData = oTable.$('input').serialize(); alert( "The following data submitted to the server: \n\n"+sData ); return false; } ); oTable = $('#example').dataTable(); } );
has comment: http://stackoverflow.com/comment/38908752
type: Question
answer count: 3
has answer: http://stackoverflow.com/a/25020338
tagged with: javascript

http://stackoverflow.com/q/24948383
answer count: 2
has comment: http://stackoverflow.com/comment/38773861
has comment: http://stackoverflow.com/comment/38774106
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24948687
tagged with: accordion
has title: Reverse Accordion Direction
score: 0
tagged with: zurb-foundation
has body: Here is the Zurb Accordion Foundation Documentation How do I reverse the direction my Zurb Accordion opens? Here is the demo link - and access code is 000 I wish for the accordion to slideup / vertically up / upwards - not down. Pure CSS would be wicked, but if J$ works, that's great too! :) Thanks for your attention
has answer: http://stackoverflow.com/a/24948654
has comment: http://stackoverflow.com/comment/38774203
has comment: http://stackoverflow.com/comment/38774094
tagged with: css
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38774021
accepted answer: http://stackoverflow.com/a/24948687
possible better answer: http://stackoverflow.com/a/24948654
type: Question

http://stackoverflow.com/q/25068004
tagged with: javascript
tagged with: jquery
score: 0
has body: I'm having problems having the waypoints.js plugin work correctly with bootstrap3. Here is a page with the absolute default barebone bootstrap boilerplate and the navbar code pasted into it. I just applied some very basic styling to the "stuck" class to see when it kicks in, making it red and stuck to the top of the viewport. Waypoints applies the "stuck" class to the .test element on page load instead of when scrolling. http://garbage.altervista.org/bower_components/withbootstrapnav.html I know my snippet of javascript code is correct, because it works on other elements than the bootstrap divs. Below is the exact same file as above, only difference is that the bootstrap navbar is replaced by a generic div. It works just as expected. http://garbage.altervista.org/bower_components/withoutbootstrapnav.html I can't figure out why waypoints doesn't work properly in my first example, but the solution might be right in front on me, anyone? Thanks!
has answer: http://stackoverflow.com/a/25068649
answer count: 1
accepted answer: http://stackoverflow.com/a/25068649
has title: Waypoints not working with with Bootstrap3 classes?
has comment: http://stackoverflow.com/comment/38998996
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
tagged with: jquery-waypoints
type: Question
has comment: http://stackoverflow.com/comment/38998776

http://stackoverflow.com/comment/38844707
has text: But there's nothing external about the fragments. Maybe i have a different definition of external.
comment on: http://stackoverflow.com/q/24976793
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24961131
has comment: http://stackoverflow.com/comment/38797181
has comment: http://stackoverflow.com/comment/38797409
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38797164
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24961451
linked to: http://stackoverflow.com/q/14207496
has title: Extract value from array recursively in javascript
upvote count: 2
has answer: http://stackoverflow.com/a/24961459
downvote count: 1
type: Question
tagged with: recursion
has body: I want to extract the files in this structure recursively. I have done it for the first level, but can't proceed further. var DirectoryTree = { dir: 'project1', files: [ 'proj.config', { dir: 'src', files: [ 'name.htm', 'dept.htm', 'salary.htm', { dir: 'scripts', files: [ 'name.js', 'dept.js', 'salary.js' ] } ] }, { dir: 'project2', files: [ 'proj.config', { dir: 'src', files: [ 'name.htm', 'dept.htm', 'salary.htm', { dir: 'scripts', files: [ 'name.js', 'dept.js', 'salary.js' ] } ] } ] } ] }; Below is the code I have till now. I am kind of stuck here. Can you help me to get the data from the next levels. function listFiles(dirTree, subFolder){ var fList=[]; if(dirTree.files){ for (var i=0;i&lt;dirTree.files.length;i++){ if(typeof dirTree.files[i] === 'string'){ fList.push(dirTree.files[i]); } } } if(dirTree.dir){ return(listFiles(dirTree.dir, subFolder)); } return fList; }
tagged with: javascript
has comment: http://stackoverflow.com/comment/38797135
has comment: http://stackoverflow.com/comment/38797266
has comment: http://stackoverflow.com/comment/38797160
answer count: 2

http://stackoverflow.com/comment/38908677
comment on: http://stackoverflow.com/a/25004028
has text: Thanks Nathan, I tried using commander. I was not successful. How do I add the parsing logic to accept the forward slash?
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38929127
type: Comment
has text: "It may also worth adding that there's no practical performance benefit of declaring the variables before use (uninitialized), just don't worry about it." That's what I was looking for. Thanks!
comment on: http://stackoverflow.com/a/25030629
score: 0
type: AnswerComment

http://stackoverflow.com/q/25049773
has body: I am creating a project and I want the user to change his/her profile picture so actually what I did is when I hover on the profile picture a change picture button will appear but when I click at it and select the file it doesn't get uploaded. This is my JQuery code: $(document).ready(function(){ $('#file').change(function(){ var name = $('#file').attr('name'); $.ajax({ url: 'demo.php', type: 'POST', data: ({'filename':name}), processData: false, contentType: false, beforeSend: function(){ $('#show').html('Loading...'); }, success: function(data){ $('#show').html(data); } }); return false; }); }); HTML code: &lt;div id='show'&gt;&lt;/div&gt; &lt;form action='demo.php' id='form' method='POST' enctype='multipart/form-data'&gt; &lt;input type='file' id='file' name='file'&gt; &lt;/form&gt; PHP code: include "connect.php"; if(isset($_FILES['file'])){ $file = $_FILES['file']; // File properties $file_name = $file['name']; $file_tmp = $file['tmp_name']; $file_size = $file['size']; $file_error = $file['error']; //Extension $file_ext = explode('.', $file_name); $file_ext = strtolower(end($file_ext)); $allowed = array('jpg', 'png'); if(in_array($file_ext, $allowed)){ if($file_error === 0){ if($file_size &lt;= 2097152){ $new_file = uniqid('', true) . '.' . $file_ext; $file_destination = 'profile_pictures/' . $new_file; if(move_uploaded_file($file_tmp, $file_destination)){ echo $file_destination; } } } } }
tagged with: http://stackoverflow.com/tag/html
tagged with: php
linked to: http://stackoverflow.com/q/5392344
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25049950
score: 0
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38965513
has comment: http://stackoverflow.com/comment/38965437
has title: Upload picture using php and jquery without a submit button
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38965717

http://stackoverflow.com/comment/38715977
has text: [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] is not required since this is the default. My web.config has been changed to work with HTTP POST requests sent from JQUERY (look at my code). My JQUERY code is identical to what you posted. as I wrote the same code I posted is working in one project but does not work in another project so I assumed there must be something else which influance it.
comment on: http://stackoverflow.com/a/24916964
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/75523255
has text: Doesn't seem to work in the latest version (Neon). I'm unable to see a conversion option, nor is there a builder called "JavaScript Validator" (tried this for both "JavaScript Project" and "Static Web Project')
type: AnswerComment
comment on: http://stackoverflow.com/a/25120655
type: Comment
score: 1

http://stackoverflow.com/comment/38804316
type: QuestionComment
comment on: http://stackoverflow.com/q/24964807
type: Comment
has text: That's a bunch of code, and no HTML to run it against. In general it's best to isolate the issue, reproduce on something like jsfiddle, and post only the complete specifics.
score: 3

http://stackoverflow.com/q/24933898
has answer: http://stackoverflow.com/a/24934027
accepted answer: http://stackoverflow.com/a/24934027
type: AnsweredQuestion
tagged with: duration
type: Question
score: 0
answer count: 2
tagged with: validation
has body: I have PHP form validation rules working but I also don't want valid but nonsense real human-being spams. Currently, the JavaScript code below gets the timestamp of the page loaded time and the timestamp of the form submission. If the difference is below 18 seconds it asks 'are you superman?' in an alert box and doesn't allow the user to submit until time arrives. Q1 ) Date.now() is supported by ie9+. Which alternative function achieves the same work in ie7+ ? (reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now#Browser_compatibility) Q2 ) Does this function itself has security gap? I ask because I suspect of document.getElementById('PageLoadTime').innerHTML = pageloaded code if variable pageloaded could be edited from outside! trial user page loading timestamp: form submission timestamp: time difference:
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24934384
has answer: http://stackoverflow.com/a/24934384
tagged with: submit
has title: Cross-browser alternative of Date.now() and innerHTML security?

dhtml
tags question: http://stackoverflow.com/q/24941131
type: Tag
tag name: dhtml

http://stackoverflow.com/comment/38972572
score: 1
has text: I have tried searching for it and no good I cant seem to find a solution...
type: QuestionComment
comment on: http://stackoverflow.com/q/25054285
type: Comment

http://stackoverflow.com/comment/38788892
type: Comment
type: QuestionComment
has text: @Stefan what server side backend are you using? There are several ways. As I already mentioned in my answer you can append stuff in backend to your get params and then treat tabs clientside. Or for example in Django you can export specific data via context and then render the template using template tags, but then again this is backend technology specific. Some backends perform session access, such as PHP or Django, I think NodeJS also has that stuff. You might look into handling tabs based on session variables.
comment on: http://stackoverflow.com/q/24956704
score: 0

http://stackoverflow.com/comment/38820334
comment on: http://stackoverflow.com/q/24965325
has text: @Bergi I've edited my question to better explain how I am tracking performance.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25043281
has body: I have had a look at your code. I saw that from the PHP side you are sending a JSON object. but you didn't specified the return dataType for the response. Try to add the dataType in the ajax call. Maybe that will solve the problem function sendTheInfo(formData) { $.ajax({ type: "POST", url: "../classes/ajax/postNewStudent.php", data: formData, dataType : 'json', statusCode: { 404: function() { alert( "page not found" ); } }, success: function(formData) { console.log("New student submitted:\n" + formData); //clearForms(); }, error: function(result, sts, err) { console.warn("Connection error:\n" + err + " : " + sts); console.log(result); shakeForm(); }, complete: function() { console.log("Everything complete"); } }); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25042958
has comment: http://stackoverflow.com/comment/38951938

http://stackoverflow.com/q/24924857
favorite count: 0
upvote count: 3
tagged with: css
type: AnsweredQuestion
downvote count: 0
type: Question
score: 3
has answer: http://stackoverflow.com/a/24925860
accepted answer: http://stackoverflow.com/a/24925860
has title: jquery rotate rectangle around x y axis
has body: I have a rectangle div placed left top 200px wide and 100% high. I want to put an image inside this div, however the image is in landscape (w:1024 h: 200) I thought no prob just rotate it, which I can do but I cant position it. So need some help here positioning top left! $('.header_rotate').css({ transform: 'rotate('+ -90 +'deg)', backgroundColor: 'green', height: '100%', width: '200' }) &lt;div class="header"&gt; &lt;div class="header_rotate"&gt; &lt;img id="logo" src="img/Logo_Design_2048x410.png" /&gt; &lt;/div&gt; &lt;/div&gt; JsFiddel
tagged with: transform
tagged with: rotation
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38836989
score: 0
type: Comment
has text: Yes, I've tryed it, but I have an error on it: undefined is not a function
type: AnswerComment
comment on: http://stackoverflow.com/a/24982407

http://stackoverflow.com/comment/38999103
has text: @JRulle, the function is called when clicking a button, not on page load. However, it does not work the first time I click it after the page loads for the first time. It works on every subsequent click, and also works after refreshing the page.
score: 0
comment on: http://stackoverflow.com/q/25067914
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38835632
score: 0
has text: @user27133 Check this jsFiddle http://jsfiddle.net/hTPY7/1437/ and check my post to see the update
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24981324

http://stackoverflow.com/a/26692015
answers question: http://stackoverflow.com/q/24988626
has body: We never did figure out what was wrong with our Heroku upload, but the resolution was to simply host it on our own website. The application runs beautifully and we don't have to deal with all of Heroku's weird errors, dynamos, and other aspects that we don't fully understand.
type: Answer
accepted answer of: http://stackoverflow.com/q/24988626
type: AcceptedAnswer
score: 0

http://stackoverflow.com/q/25030355
tagged with: javascript
tagged with: jquery
has title: Javascript Cannot Close Current Tab After Chrome 36.0.1985.125 Update
tagged with: browser-tab
answer count: 4
accepted answer: http://stackoverflow.com/a/26245775
favorite count: 0
has answer: http://stackoverflow.com/a/60003841
has body: Currently I have an application where a user hits a clicks on a URL and goes to my form. The user then enters his information into the form field, which is then sent through jquery ajax to a PHP script which enters it into the database. Upon success callback, it would alert the user that they had been registered and closes the current browser tab. (Let's just say I need the closing the browser tab behaviour to persist). $.ajax({ type: "POST", url: 'goToPHP', data: data, success: function(data){ alert('You Have Been Registered Successfully'); open(location, '_self').close(); }, error: function(data){ } }); I understand that most modern browsers (Chrome included) are limiting the ability for javascript to only close tabs/windows it created for security reasons. Temporarily I had used open(location, '_self').close(); to get around the issue, but alas, it seems chrome's most recent update prevents you from doing this as well (Prompts you with a warning: 'Scripts may close only the windows that were opened by it'.) Is there a way around this? I'm not talking about something along the lines of: open(location, '_self').close(); But something that will work all the time on Chrome (e.g. changing a Chrome setting to allow scripts to close tabs/windows (similar to how this could be done through about:config in Firefox) or a way of restructuring how the user hits the form, so that the window object is available in javascript so i can call windowObject.close(); ) . Thanks in Advance!
upvote count: 1
tagged with: google-chrome
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25031334
score: 1
has answer: http://stackoverflow.com/a/29578390
possible better answer: http://stackoverflow.com/a/25031334
type: Question
has answer: http://stackoverflow.com/a/26245775
downvote count: 0

http://stackoverflow.com/comment/38857885
comment on: http://stackoverflow.com/a/24993473
has text: i removed the **div**#stepbystep ul li a
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/a/24920661
upvote count: 2
type: AcceptedAnswer
type: Answer
has body: It's not really well spelled out in the PHP docs, but this is how it's supposed to work. For instance, the page on request variables has this to say about array-like cookies: If you wish to assign multiple values to a single cookie variable, you may assign it as an array. For example: &lt;?php setcookie("MyCookie[foo]", 'Testing 1', time()+3600); setcookie("MyCookie[bar]", 'Testing 2', time()+3600); ?&gt; That will create two separate cookies although MyCookie will now be a single array in your script. If you want to set just one cookie with multiple values, consider using serialize() or explode() on the value first. In other words, when you send in: FormData[0][Field]: username FormData[0][Value]: test3 PHP interprets this as an array of arrays, which looks like this: array(1) { [0]=&gt; array(2) { ['Field'] =&gt; String(8) "username", ['Value'] =&gt; String(5) "test3" } } And you can parse it like so: foreach ($_POST["Data"] as $field) { if ($field['Field'] == "username") { ... } } Bear in mind that a PHP array is actually an ordered map. In other words, its perfectly suited for storing the key => value data you're passing in with your POST. You seem to be expecting $_POST to contain simple objects (aka stdClass) and it simply doesn't. Most SOAP helpers in PHP will give you simple object responses (which is a typical blending of behaviors from PHP). See this question for some ideas if you really want to translate every $_POST["Data"] field into an object. But that would be expensive and unnecessary.
score: 2
accepted answer of: http://stackoverflow.com/q/24918076
downvote count: 0
answers question: http://stackoverflow.com/q/24918076

http://stackoverflow.com/a/25011982
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25011916
has body: You can move the container to whatever the position you want to and offfset the image contained to the position you want.The can be done by adding the image that you want to mask to the container. See this one for more info.I think this is what you wanted
has comment: http://stackoverflow.com/comment/38893271

http://stackoverflow.com/a/25055861
has comment: http://stackoverflow.com/comment/38975761
has comment: http://stackoverflow.com/comment/38975640
upvote count: 1
answers question: http://stackoverflow.com/q/25055333
downvote count: 0
score: 1
has body: please see here : http://jsbin.com/kovegi/1/edit?html,js,output CodingNinja was close just use ng-model="searchObj.node.name" instead ng-model="searchObj.name" Search-title: {{fin.name}} {{fin.snippet}}
type: Answer

http://stackoverflow.com/q/24920905
has title: create associative array from simple array, auto increment key for each array item
tagged with: arrays
tagged with: javascript
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38722111
has answer: http://stackoverflow.com/a/24921006
has body: I have a simple array in the format $arr = array(a,b,c,d); that is dynamically populated. How would I convert this into an associative array like $newarr = array( 'embedCode0' =&gt; a, 'embedCode1' =&gt; b, 'embedCode2' =&gt; c, 'embedCode3' =&gt; d ); I know I can already access b in $arr with $arr[1] but I am passing $newarr from PHP to Javascript and accessing the array items in JS using phpVars.embedCode0, phpVars.embedCode1 etc I have tried to access the items from $arr in JS using phpVars[0] and phpVars.[0] but neither method works so I think I need to create the associative array with the key values in PHP first.
favorite count: 0
has comment: http://stackoverflow.com/comment/38722163
possible better answer: http://stackoverflow.com/a/24921006
accepted answer: http://stackoverflow.com/a/24920943
tagged with: php
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24920943
type: Question

http://stackoverflow.com/q/24917058
has title: Using variables within css javascript method
score: -1
has comment: http://stackoverflow.com/comment/38715234
accepted answer: http://stackoverflow.com/a/24917203
has answer: http://stackoverflow.com/a/24917272
possible better answer: http://stackoverflow.com/a/24917762
downvote count: 1
has answer: http://stackoverflow.com/a/24917762
has body: Anyone see what I'm doing wrong here? Creating circles using jQuery and then filling them with a variable from an input field. The issue: The variable firstletter is is not being displayed when 1. there's input in the input box and 2. when the result pane is clicked to generate a circle. The variable should be in the middle of the circle. jQuery: // making of the circles $('&lt;div/&gt;').attr({ 'id': i }).addClass('circle').css({ 'top': e.pageY - 75, 'left': e.pageX - 75, 'content': firstletter }).appendTo('#area'); firstletter being a variable here which I am using with the content css property. Here's the fiddle: http://jsfiddle.net/hslincoln/ZM7dC/
has comment: http://stackoverflow.com/comment/38714567
has answer: http://stackoverflow.com/a/24917283
has comment: http://stackoverflow.com/comment/38714622
tagged with: javascript
answer count: 4
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/38714646
has answer: http://stackoverflow.com/a/24917203
tagged with: jquery
linked to: http://stackoverflow.com/q/1762047
favorite count: 0
type: Question
tagged with: css

http://stackoverflow.com/q/25059301
has title: Can't display log anywhere in railo
type: Question
tagged with: railo
tagged with: arrays
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25067923
has body: I want to display log in standard browser console in Railo. This is my code : log.info("Event Handler Called"); or WriteLog (text="Event Handler Is Called", type="error", application=true, file="", log=""); The text "Event Handler Is Called" is not logged anywhere.
score: 0
tagged with: cfml
type: UnansweredQuestion
tagged with: java

http://stackoverflow.com/q/24935627
duplicate of: http://stackoverflow.com/q/4255472
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38750477
type: Question
linked to: http://stackoverflow.com/q/4255472
answer count: 1
has comment: http://stackoverflow.com/comment/38750127
tagged with: javascript
tagged with: jquery
has title: Access items within an JS object, append to each DOM element in order
has body: I have the following object which has been passed from PHP var phpVars = {"embedCode0":"&lt;iframe id="player_0"&gt;&lt;/iframe&gt;", "embedCode1":"&lt;iframe id="player_1"&gt;&lt;/iframe&gt;", "embedCode2":"&lt;iframe id="player_2"&gt;&lt;/iframe&gt;", }; My HTML contains a matching number of &lt;div class="video-container"&gt;&lt;/div&gt; elements. I want to append each of the array items to each div in order. So that "embedCode0" is appended to the first div, "embedCode1" is appended to the second div and so on. My jQuery function looks like this: function vids(){ var $video = $('div.video-container'); $video.each(function(index) { var $iframe = phpVars.embedCode + index; $(this).append($iframe); }); } The function returns NaN. I have attempted to convert the index to a string but have not been able to succeed. How can I increment the "embedCode" string?
score: 0
has answer: http://stackoverflow.com/a/24935728
accepted answer: http://stackoverflow.com/a/24935728

http://stackoverflow.com/a/59053655
has body: The "sheet" property is missing in SVGStyleElements in IE11 Based on AmeliaBR's answer i made a polyfill: if (!('sheet' in SVGStyleElement.prototype)) { Object.defineProperty(SVGStyleElement.prototype, 'sheet', { get:function(){ var all = document.styleSheets; for (var i=0, sheet; sheet=all[i++];) { if (sheet.ownerNode === this) return sheet; } } }); }
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24920186

http://stackoverflow.com/comment/38741019
has text: Hmmm...Seems like I am close to solving it..Thank you. +1 for you already.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24931212

http://stackoverflow.com/q/25031083
linked to: http://stackoverflow.com/q/9756120
has answer: http://stackoverflow.com/a/25031358
type: Question
downvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38929032
tagged with: javascript
favorite count: 0
has body: I have some interesting problem and can't find the solution. Look at this: var d1 = new Date("07 31 2014"); document.write(d1); document.write('&lt;br /&gt;'); var d2 = new Date(1406746800 * 1000); document.write(d2); when I run this script I get this result: Thu Jul 31 2014 00:00:00 GMT+0500 (UZT) Thu Jul 31 2014 00:00:00 GMT+0500 (UZT) then after I changed my time zone I get this result: Thu Jul 31 2014 00:00:00 GMT-0800 (AKDT) Wed Jul 30 2014 11:00:00 GMT-0800 (AKDT) as you can see the second result is Jul 30, but first result is Jul 31. I think they must both be equal to 31 Jul. I know this problem depends on the timezone but is there a solution?
tagged with: datepicker
has comment: http://stackoverflow.com/comment/38928979
score: 1
type: UnansweredQuestion
upvote count: 1
has title: Javascript vs Date

osx-mavericks
type: Tag
tag name: osx-mavericks
tags question: http://stackoverflow.com/q/24918767

http://stackoverflow.com/comment/38904519
comment on: http://stackoverflow.com/q/25018080
has text: I would imagine that you change it by passing in an object of options to the plugin. That's how it normally works.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24951294
type: Answer
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24951222
upvote count: 2
has body: No, you can't automatically print the page without the browser's print dialog showing first, not without a browser extension. Think of the ramifications of a web page being able to print without you confirming it... :-) Since this is for your own shop, if you're willing to spend a bit of time on it, you can probably build your own modified version of Chromium or Firefox (or Konqueror or...) and have it by-pass the print dialog. That sounds like a big deal, but I expect the code change is fairly simple once you get the build toolchain working.

http://stackoverflow.com/comment/38847124
has text: Question solved by Sebas.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24962333

http://stackoverflow.com/comment/38882661
type: Comment
comment on: http://stackoverflow.com/q/25006310
type: QuestionComment
has text: In case you can't figure it out, [here's](http://jsfiddle.net/3Wns7/) an implementation that will give the desired output. It's not a solution to your problem, though.
score: 0

http://stackoverflow.com/comment/38920634
has text: works for me http://jsfiddle.net/
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25026509
type: QuestionComment

http://stackoverflow.com/a/25043481
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25043362
score: 1
has comment: http://stackoverflow.com/comment/38952352
answers question: http://stackoverflow.com/q/25043362
upvote count: 1
type: AcceptedAnswer
has body: Assign an active class to the first menu item, and add two lines before your code as follows $('#toggle &gt; span').click(function () { var ix = $(this).index(); $('#toggle &gt; span').removeClass('active'); //Remove active clas from all span elements $(this).addClass('active'); //Adds active class to the one which was clicked $('#first').toggle(ix == 0); $('#second').toggle(ix == 1); $('#third').toggle(ix == 2); }); Demo Demo 2 (Inactive ones will be blue, as commented) It would be better if you use data- attributes to toggle between the elements instead of using ids if you are having dynamic tabs.
type: Answer
has comment: http://stackoverflow.com/comment/38952292

http://stackoverflow.com/q/25004182
has comment: http://stackoverflow.com/comment/38878275
tagged with: angularjs
has body: I have a controller that looks like this: angular.module('my_app') .controller('QueryCtrl', ['$scope', 'Query', function ($scope, Query) { $scope.onSubmit = function() { var json = $.post('http://162.243.232.223:3000/api/query', { 'input': 'my_input' }); console.log(json); $scope.queries = json; }; } ]) And a view that looks like this: Submit {{ queries }} {{query}} The problem is that, when I click the submit button, the javascript console successfully logs the correct json object, which has a property responseJSON You can take a closer look at the object I want by looking typing $.post('http://162.243.232.223:3000/api/query', { 'input': 'my_input' }); into the javascript console yourself and checking out the object. However, in the view, when I print out the "queries" object, it appears to not have a responseJSON attribute, but only a readyState attribute. Where is the rest of my json object?
answer count: 4
accepted answer: http://stackoverflow.com/a/25004307
type: AnsweredQuestion
has title: How to get a variable from the Angular controller to a view
type: Question
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38878254
score: 0
has answer: http://stackoverflow.com/a/25004307
possible better answer: http://stackoverflow.com/a/25004286
has answer: http://stackoverflow.com/a/25004286
tagged with: javascript
has answer: http://stackoverflow.com/a/25004336
has answer: http://stackoverflow.com/a/25004246

http://stackoverflow.com/q/24989327
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38850659
type: UnansweredQuestion
tagged with: ng-show
tagged with: css
has comment: http://stackoverflow.com/comment/38850423
linked to: http://stackoverflow.com/q/152975
tagged with: angularjs-scope
type: Question
tagged with: javascript
score: -1
has title: Call a function when i click outside to the element like boot strap modal get closed
answer count: 2
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/28535218
has body: I have created a popup box of div. Which get shown when i click on an icon and get hide when i click on close button. But i want to get it closed if click out side of the popup. What i can do for that. I am using angular in my project and ng-show and ng-hide to show and hide the div. Any help is appreciable. Thanks in advance. html code openPopUp helo Close Java script $scope.openPopUP = function(){ $scope.popup = true; } $scope.closePopUp= function(){ $scope.popup = false; } I just want to close if some one click out side the div
has answer: http://stackoverflow.com/a/24989371
favorite count: 0

http://stackoverflow.com/q/25034223
linked to: http://stackoverflow.com/q/8077964
has comment: http://stackoverflow.com/comment/38934388
type: Question
answer count: 1
has body: Is there a way to Move a Div/Header of my Page along with page. i.e., the header follows page up/down. Here is a website example that i am trying to do. As from the website we can notice that the top header moves up/down along with page scroll. http://www.topix.com/forum/med/dermatology/T2966QF431OFQNCQG https://in.answers.yahoo.com/;_ylt=Au8NphoCl4T3K3_yv8lHbr_lHwx.
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38934334
has title: Move Div/Header Along With Page Scroll
score: 0
duplicate of: http://stackoverflow.com/q/8077964
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25034246

http://stackoverflow.com/a/25020668
has comment: http://stackoverflow.com/comment/38910409
upvote count: 3
has comment: http://stackoverflow.com/comment/38937760
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38933534
has comment: http://stackoverflow.com/comment/38928800
has body: Normally, one would use FormData to compose the postData of a request, but unfortunately we cannot do so here, as there is currently no way to get the stream (and other information) from a FormData instance (nsIXHRSendable is not scriptable, unfortunately), so we'll have to create a multipart/form-data stream ourselves. Since it is likely you'll want to post some file data as well, I added file uploads as well. ;) function encodeFormData(data, charset) { let encoder = Cc["@mozilla.org/intl/saveascharset;1"]. createInstance(Ci.nsISaveAsCharset); encoder.Init(charset || "utf-8", Ci.nsISaveAsCharset.attr_EntityAfterCharsetConv + Ci.nsISaveAsCharset.attr_FallbackDecimalNCR, 0); let encode = function(val, header) { val = encoder.Convert(val); if (header) { val = val.replace(/\r\n/g, " ").replace(/"/g, "\\\""); } return val; } let boundary = "----boundary--" + Date.now(); let mpis = Cc['@mozilla.org/io/multiplex-input-stream;1']. createInstance(Ci.nsIMultiplexInputStream); let item = ""; for (let k of Object.keys(data)) { item += "--" + boundary + "\r\n"; let v = data[k]; if (v instanceof Ci.nsIFile) { let fstream = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); fstream.init(v, -1, -1, Ci.nsIFileInputStream.DEFER_OPEN); item += "Content-Disposition: form-data; name=\"" + encode(k, true) + "\";" + " filename=\"" + encode(v.leafName, true) + "\"\r\n"; let ctype = "application/octet-stream"; try { let mime = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService); ctype = mime.getTypeFromFile(v) || ctype; } catch (ex) { console.warn("failed to get type", ex); } item += "Content-Type: " + ctype + "\r\n\r\n"; let ss = Cc["@mozilla.org/io/string-input-stream;1"]. createInstance(Ci.nsIStringInputStream); ss.data = item; mpis.appendStream(ss); mpis.appendStream(fstream); item = ""; } else { item += "Content-Disposition: form-data; name=\"" + encode(k, true) + "\"\r\n\r\n"; item += encode(v); } item += "\r\n"; } item += "--" + boundary + "--…
answers question: http://stackoverflow.com/q/25009431
type: Answer
has comment: http://stackoverflow.com/comment/38932007
accepted answer of: http://stackoverflow.com/q/25009431
has comment: http://stackoverflow.com/comment/56664760
has comment: http://stackoverflow.com/comment/38941252
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/38941607

http://stackoverflow.com/comment/38820482
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24972556
has text: The last one you provided "Using plain javascript" worked on the console, but not if i add the script just before the end of or in the header. This is driving me nuts already.
type: AnswerComment

http://stackoverflow.com/comment/38878533
type: QuestionComment
comment on: http://stackoverflow.com/q/25004122
has text: also, try using angular's built in for loop... angular.forEach(series, function(value, index){ ... your logic here ... });
score: 0
type: Comment

http://stackoverflow.com/q/24937693
tagged with: asynchronous
has answer: http://stackoverflow.com/a/24937767
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24937767
accepted answer: http://stackoverflow.com/a/24937884
type: Question
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have following HTMl in index.php Load And CSS like this #internal { padding: 50px; background: green; display: inline-block; } #external-element { width: 50px; height: 50px; background: yellow; } And I have one external php page external.php like this I have used the following script in index.php $(document).ready(function() { $('a').click(function(event){ $attrib = $(this).attr('href'); $('#internal').load($attrib,function(){ alert($('#internal').attr('class')); alert($('.external-element').attr('class')); }); event.preventDefault(); }); }); In the above code the jQuery script successfully loads the #external-element from external.php in the div #internal. And after loading I wanted to alert classes of both #internal as well as #external-element. $('#internal').load($attrib,function(){ alert($('#internal').attr('class')); alert($('.external-element').attr('class')); }); above code successfully alerts the name of class of #internal & #external-element. But when I write $('#internal').load($attrib); alert($('#internal').attr('class')); alert($('#external-element').attr('class')); then above code is not alerting the class of #external-element. It is saying undefined. I think, it is unable to manipulate DOM of external.php after AJAX load(). Please help me. Thanks.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24937884
has title: unable to manipulate DOM elements of external HTML loaded by AJAX load()

http://stackoverflow.com/a/25017366
score: 0
has body: I have a suspicion that the complete event is not firing when you expect, primarily because you're loading in these scripts dynamically, so independently to the resources after which complete fires. It seems to me you actually need to listen for the load event for each resource, count them and only when those are complete invoke DoCPInit function resourceLoaded() { var ev = new Event('resourceLoaded', {bubbles: true}); this.removeEventListener('load', resourceLoaded); // cleanup this.dispatchEvent(ev); } function loadResource(parent, tag, args) { var node = document.createElement(tag), arg; // add listeners on this line if needed node.addEventListener('load', resourceLoaded); for (arg in args) node.setAttribute(arg, args[arg]); parent.appendChild(node); return node; } function addJavaScript(src) { loadResource( document.head, { 'type': 'text/javascript', 'src': src } ); } var waitfor = 1; // one script document.addEventListener('resourceLoaded', function () { if (--waitfor &gt; 0) return; // invoke whatever DoCPInit(); }); Partially tested it in Chrome, you may need to check compatibility over browsers
type: Answer
accepted answer of: http://stackoverflow.com/q/25016514
has comment: http://stackoverflow.com/comment/38905249
answers question: http://stackoverflow.com/q/25016514
type: AcceptedAnswer

http://stackoverflow.com/a/24917762
answers question: http://stackoverflow.com/q/24917058
upvote count: 2
has comment: http://stackoverflow.com/comment/38716425
type: Answer
score: 2
downvote count: 0
has body: Have updated the fiddle as per your requirement. the problem is, you used text() instead of val(). jQuery $('#'+i).html('&lt;span class="charIn"&gt;'+firstletter+'&lt;/span&gt;'); css .charIn{ position:absolute; top:47%; left:46%; } used the above code to add the letter inside the span to make the letter appear center of the cirlce. here is the working fiddle

http://stackoverflow.com/comment/38936253
score: 0
type: Comment
type: QuestionComment
has text: Maybe the auth object did not exist when you ran console.log. It would still appear in the second call because console.log sort of shows the current state of variable when you expand it. Try putting a timeout on it and see what happens.
comment on: http://stackoverflow.com/q/25035197

http://stackoverflow.com/comment/38808545
type: Comment
has text: @true: How do you know?
comment on: http://stackoverflow.com/a/24967073
score: 0
type: AnswerComment

http://stackoverflow.com/q/25046110
favorite count: 0
has body: By searching a dictionary of words, I am trying find strings made up of substrings. First, finding string made of letters is straight forward: 1. [abcdefgjlmnqrsz]+ Above finds any word or phrase that contains the above letters. What I am trying to figure out how to find strings made up of substrings: So for example dictionary = ["neon","none","dog","bear","bare"] and regex is: [ar|be|o|ne|n]+ I would like to find: neon, bear But, regex ex. 2 is incorrect, because it finds: neon, noen, bear, bare. Any help appreciated
tagged with: regex
has answer: http://stackoverflow.com/a/25046143
accepted answer: http://stackoverflow.com/a/25046143
type: AnsweredQuestion
has title: Match Strings Composed of Substrings in a Given Set
downvote count: 0
score: 1
tagged with: substring
type: Question
answer count: 1
tagged with: javascript
upvote count: 1
tagged with: string

http://stackoverflow.com/q/25007854
has body: I'm experiencing something that seems quite wrong with events and jquery. I have the following simple HTML list Chocolate Butter Milk ugar and the following JavaScript: $(document).on("click", "button", function(evt) { console.debug("got a click in", evt.target); }); When I click in a button I get got a click in and not in the button. Why?
has comment: http://stackoverflow.com/comment/38887635
score: 0
answer count: 2
tagged with: events
has title: Why is an on "click, "button" being handled by a span instead?
possible better answer: http://stackoverflow.com/a/25007866
has answer: http://stackoverflow.com/a/25007866
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38885696
has answer: http://stackoverflow.com/a/25007873
accepted answer: http://stackoverflow.com/a/25007873
type: Question
has comment: http://stackoverflow.com/comment/38886743
tagged with: javascript
tagged with: event-handling
tagged with: jquery

http://stackoverflow.com/a/24911485
accepted answer of: http://stackoverflow.com/q/24911396
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24911396
has comment: http://stackoverflow.com/comment/38706048
has comment: http://stackoverflow.com/comment/38707953
upvote count: 1
type: AcceptedAnswer
has body: This regex should find the Office Location as long as the text 'Office Location' doesn't appear anywhere else in the text. var officeLocation = /Office Location: (.+)/.exec(emailContent)[1]; JsFiddle Link
type: Answer

http://stackoverflow.com/comment/38968090
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25050953
has text: Try this, the discussion is getting long, this will be my last comment. http://jsfiddle.net/WHzKp/14/
type: AnswerComment

http://stackoverflow.com/q/24918351
has title: How to remove textContent in greasemonkey?
has body: Ive been trying to use greasemonkey to change the example text on the outlook login page. Specifically this snip: someone@example.com I'm trying to change it to display 'Username' instead, but after trying many things have had no luck. Thanks.
favorite count: 0
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/24918521
accepted answer: http://stackoverflow.com/a/24918521
type: Question
has comment: http://stackoverflow.com/comment/38721775
score: -2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38721621
downvote count: 2
has comment: http://stackoverflow.com/comment/38729507
tagged with: greasemonkey
answer count: 1

http://stackoverflow.com/a/25041681
answers question: http://stackoverflow.com/q/25021806
has comment: http://stackoverflow.com/comment/38951791
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38955730
type: Answer
has body: Jumping into different parts of a page are accomplished via anchor tags (#). The problem you'll face is that search engines ignore anchor tags (#). If you don't want to create separate pages, you can: Create a single page with a table of contents at the top to jump users down into their relevant sections (the page title won't be affected but this does most of what you requested). Create a single page with 2 different URLs. This can be as easy as adding a query parameter on the end of your URL, eg: www.yourwebsite.com/yourcontent and www.yourwebsite.com/yourcontent?param=1. If your page is created dynamically then you can (on the server side) update your page title and description based on the query parameter as well.
accepted answer of: http://stackoverflow.com/q/25021806
has comment: http://stackoverflow.com/comment/38951507
score: 0
has comment: http://stackoverflow.com/comment/38955825

http://stackoverflow.com/a/25006795
has body: Well if you're viewing the HTML in the source then you know that the HTML string is being printed. So maybe you're doing something with headers? Possibly Chrome doesn't expect to receive HTML content when you print it from PHP, but when you take the same content and put it into a file with .html extension it's a no-brainer, so it renders it automatically. Try opening up the Chrome's dev tools, reload the page and look under 'network' to see what headers you're receiving. If you are in fact printing the html string, as you've verified in the 'source' received by the client (chrome) then you know your php code was evaluated. Given that as true, and without trying to guess at what is going on with the js script, that is the only thing I can think of.
type: Answer
answers question: http://stackoverflow.com/q/25006645
score: 0

http://stackoverflow.com/q/24971088
downvote count: 0
favorite count: 0
tagged with: angularjs
has title: How can I access a scope function in a parent controller from a child controller when using Typescript?
has comment: http://stackoverflow.com/comment/38816011
upvote count: 3
type: AnsweredQuestion
tagged with: typescript
score: 3
has answer: http://stackoverflow.com/a/24971239
tagged with: javascript
has body: I have a parent controller AppController for a DIV on my page and a child controller AdminHomeController that's in an area of the page inside that. Here is what I have defined so far. interface AppControllerScope extends ng.IScope { app: AppController; } app.controller('appController', AppController); class AppController { static $inject = ['$scope',] constructor( public $scope: AppControllerScope ) { $scope.app = this; } doTask() = () =&gt; { var x = 99; } } class AdminHomeController { static $inject = ['$scope'] constructor( public $scope: ?? ) { // &lt;&lt; What should my interface look like? $scope.home = this; app.doTask(); } app = $scope.app; // How can I set up a parameter of this controller // that can be used on my web page or inside this // controller? } Can someone tell me how I can access the parent controller function doTask() from inside the child controller and also on my page? I assume that somehow I have to set an interface here: constructor( public $scope: ?? ) { But I am not sure what it should look like.
type: Question
accepted answer: http://stackoverflow.com/a/24971239
answer count: 1

http://stackoverflow.com/comment/38976407
comment on: http://stackoverflow.com/q/25056306
type: QuestionComment
type: Comment
has text: Edited to add textBox variable @Spokey
score: 0

http://stackoverflow.com/comment/38864638
type: AnswerComment
score: 0
type: Comment
has text: @MarkCorrigan: Probably #3 above. I added that late, when I realized you were using single quotes rather than doubles. (My content type examples in the comment above were also wrong thanks to a typo [been a long day already, it's only 3pm!], hit refresh to make sure you're seeing `application/json` there.)
comment on: http://stackoverflow.com/a/24996871

http://stackoverflow.com/comment/38879094
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25003695
has text: @NathanRomano Yes, it is.
type: Comment

http://stackoverflow.com/q/24954339
tagged with: cordova
linked to: http://stackoverflow.com/q/9744139
downvote count: 1
duplicate of: http://stackoverflow.com/q/9744139
accepted answer: http://stackoverflow.com/a/24954376
type: Question
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24954376
has comment: http://stackoverflow.com/comment/38784272
tagged with: http://stackoverflow.com/tag/html
has body: I created a button tag inside my javascript value = '&lt;button id="structure_' + arrayCodStructure[j] + '" class="ui_btn" &gt;' + arrayCodStructure[j] + ' &lt;/button&gt;&lt;br&gt;&lt;/br&gt;'; and then appended to an existing div this way: $("#listContent").append(value); My purpose is to get button's id when I click on the specific and tried the below code with no luck. $("#listContent.ui_btn").bind("click".function() { var id = $(this).Attr('id'); alert("id: " + id); } Any solution? selector on #listContent works but it is not what I need.
has title: jquery - click on children not working if dynamically created
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38785106

http://stackoverflow.com/comment/38715364
has text: I gave +1, but you shouldn't give an explanation only in response to a down vote. It's a good idea to do it up front so that the OP and others can clearly see what you changed.
type: Comment
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24917339

http://stackoverflow.com/comment/38941163
has text: as dynamically created elements are not available after `document.ready` and hence cannot bind events using `.click`. So jQuery provided `.on('click','selector',function(){...})` for binding events. For more information see [this](http://stackoverflow.com/questions/9122078/difference-between-onclick-vs-click)
type: AnswerComment
comment on: http://stackoverflow.com/a/25037596
score: 0
type: Comment

http://stackoverflow.com/comment/38736327
type: Comment
has text: check my update, because copy to clipboard is different on 1 browser and another, so i prompt it with dialog, you can copy it with ctrl+c or command+c
comment on: http://stackoverflow.com/a/24924163
score: 0
type: AnswerComment

http://stackoverflow.com/q/24966187
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/24966658
tagged with: confirmation
tagged with: http://stackoverflow.com/tag/html
has body: Sorry if this is a silly question (I am still new to web development), but is it possible to have a link in a basic confirmation dialog message? Right now, I have a basic confirmation popup if (confirm("Bunch of text here")) ... But a customer wants me to add a link in that confirmation box which would open in a new window. Adding html tags in the message doesn't work since it's a message string. Any suggestions would be appreciated. Thanks!
has comment: http://stackoverflow.com/comment/38807043
answer count: 2
upvote count: 1
tagged with: dojo
type: UnansweredQuestion
has title: Confirmation Dialog with Link in message?
downvote count: 0
has answer: http://stackoverflow.com/a/24967523
tagged with: javascript
score: 1

http://stackoverflow.com/comment/38746127
type: Comment
comment on: http://stackoverflow.com/q/24932806
has text: No I can't help. Don't use application/octet-stream, use the proper content-type so the browser can do it for you.
type: QuestionComment
score: 0

http://stackoverflow.com/q/25038905
tagged with: polymer
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25039465
answer count: 1
has body: I have a question regarding custom elements in polymer. I have acustom element that has a style nested inside it's template, for a div inside the template like so: Now, I'd like to change the color of navWrapper when I scroll down the page. I want to use jquery for that. Therefore I have a script inside of my custom element like so: Now sadly that does nothing. I have put an alert(test) before the $(this.$.navWrapper) to find out if I even get to that point and I do. Also when I want to change the background color or something else from an element that lives in my normal HTML file it works. For example $("#testDiv").css({...}) changes. So my question is: How do I access the css of my element properly?
favorite count: 0
has answer: http://stackoverflow.com/a/25039465
has title: Polymer change custom element
upvote count: 1
has comment: http://stackoverflow.com/comment/38944579
tagged with: css
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38944632
type: Question

http://stackoverflow.com/q/24997604
tagged with: cross-platform
answer count: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/26646064
has title: CSS - Android keyboard push up elements
tagged with: position
has body: I have a div with position:relative. Within this div there is another divwith position:absolute. I also limited the screen to be 800 * 600px. When I open my web on Android OS (tried Chrome browser there), it seems that whenever the keyboard pops up it pushes the entire view. So my question is, is there any way to control it? from what I know, it seems like there is no control by JavaScript or jQuery, CSS im still 99% sure there isn't. So, am I right?
tagged with: css
upvote count: 3
has answer: http://stackoverflow.com/a/41099572
type: UnansweredQuestion
type: Question
score: 3

http://stackoverflow.com/q/25023708
tagged with: opengl-es
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25025839
tagged with: webgl
accepted answer: http://stackoverflow.com/a/25025839
type: Question
answer count: 1
tagged with: javascript
has body: I have an webgl application with a lot of segments (gl.LINES). Each segment needs to apply a specific 1D texture, or if you prefer, each pixels of a segment needs to have a specific color. This will be use as an alternative to an histogram on the segment. I made a test texture of 4 pixels from red to black. I would have liked to see a gradient from red to black, but instead the output is a red only line. Here is my getTextureFromPixelArray method: Scene.getTextureFromPixelArray = function(data, width, height) { if (_.isArray(data) &amp;&amp; data.length) { var gl = this._context; data = new Uint8Array(data); var texture = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, texture); gl.pixelStorei(gl.UNPACK_ALIGNMENT, 1); gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); gl.bindTexture(gl.TEXTURE_2D, null); return texture; } else { this.log("Unable to create texture"); } return null; }; Here is my code for generating a test texture 1D : var verticles = []; verticles.push(this.vertex1.position[0]); verticles.push(this.vertex1.position[1]); verticles.push(this.vertex2.position[0]); verticles.push(this.vertex2.position[1]); var color = []; var textureWidth = 4; var textureHeight = 1; var textureCoords = []; for (var i=0;i&lt;textureHeight;i++) { for (var j=0;j&lt;textureWidth;j++) { color.push(Math.round(255 - j*255/(textureWidth-1))); // Red color.push(0); // Green color.push(0); // Blue color.push(255); // Alpha } } textureCoords.push(0); textureCoords.push(0.5); textureCoords.push(1); textureCoords.push(0.5); var vertexPositionAttributeLocation = gl.getAttribLocation(shaderProgram, "aVertexPosition"); var textureCoordAttributeLocation = gl.getAttribLocati…
score: 0
has title: Webgl apply 1D texture on a line
tagged with: texture-mapping

http://stackoverflow.com/comment/38976931
has text: Parameters for alertify.log are: alertify.log(message, type, wait). I don't see a callback function but I tried with no luck.
score: 1
comment on: http://stackoverflow.com/a/25056620
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25008740
answers question: http://stackoverflow.com/q/24994905
type: Answer
upvote count: 1
score: 1
has body: Alternative way you can use this plugin for a curved/360 degree slider Reference Here is the coding: Degrees Javascript (function($){ 'use strict'; var set_html = function(value, index, angle, unit){ var html = '' ,val = value; if(unit !== ''){ val += unit; } html += 'Value: ' + val + ' '; html += 'Index: ' + index + ' '; html += 'Angle: ' + angle + ' '; return html; }; $('document').ready(function(){ var self = { degrees: null }; self.degrees = $('#degrees').round_slider({ min: 0, max: 359, unit_sign: '\u00b0', bg: 'img/bg/degrees-theme.png', handle_bg: 'img/handles/wheel-33-33.png', input_bg: 'img/input/round-50.png', points_bg: 'img/points/degress-white.png', angle_changed_callback: function(value, index, angle, unit){ $('#degrees-data').html(set_html(value, index, angle, unit)); } }); }); })(jQuery); Check here for the demo Demo
downvote count: 0

http://stackoverflow.com/comment/38984985
has text: .load() is in the index.php before ist that the way it should work?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25060725

http://stackoverflow.com/a/24976921
has comment: http://stackoverflow.com/comment/38827078
has comment: http://stackoverflow.com/comment/38827358
has comment: http://stackoverflow.com/comment/38827207
has comment: http://stackoverflow.com/comment/38827122
score: 0
has comment: http://stackoverflow.com/comment/38826932
type: Answer
has comment: http://stackoverflow.com/comment/38826973
answers question: http://stackoverflow.com/q/24976748
has body: Try Link jsfiddle http://jsfiddle.net/guest271314/8deea/

http://stackoverflow.com/comment/38897445
type: Comment
comment on: http://stackoverflow.com/a/25014295
score: 0
type: AnswerComment
has text: type some text and press enter in the text box it will have. It will have tag which u entered. And start typing next text it will start from next line I dont need that. I need to it start next after the first tag and continue till the width of the parent div

http://stackoverflow.com/a/25039722
score: 0
has body: Assuming you can edit the api: If you get url with "studentname" (one) and "date" get the desired student data. url.com/studentresults?studentname=xyz&amp;date=dd/mm/yyyy Else if you get url with multiple studentnames then you need to check if "studentname" is an array. url.com/studentresults?studentname=student1,student2&amp;date=dd/mm/yyyy More details how to pass array to url Else if you get only date then try getting all the results of the day. url.com/studentresults?date=dd/mm/yyyy If you can't edit then you must check the API for allowed parameters which can be passed.
has comment: http://stackoverflow.com/comment/38945569
type: Answer
has comment: http://stackoverflow.com/comment/38945218
has comment: http://stackoverflow.com/comment/38945503
has comment: http://stackoverflow.com/comment/38946044
answers question: http://stackoverflow.com/q/25037690

http://stackoverflow.com/comment/38769604
comment on: http://stackoverflow.com/q/24945323
type: QuestionComment
type: Comment
has text: @KrzysztofSafjanowski It will just redirect me to the `/` root folder. Even when I take out the `otherwise()`
score: 0

firefox
tags question: http://stackoverflow.com/q/25068936
tags question: http://stackoverflow.com/q/24920061
tags question: http://stackoverflow.com/q/24994970
tags question: http://stackoverflow.com/q/24966759
tags question: http://stackoverflow.com/q/24919440
tags question: http://stackoverflow.com/q/24924856
tags question: http://stackoverflow.com/q/24930316
tags question: http://stackoverflow.com/q/24954256
tags question: http://stackoverflow.com/q/24992162
tags question: http://stackoverflow.com/q/25059121
tags question: http://stackoverflow.com/q/24944935
tags question: http://stackoverflow.com/q/25066941
tags question: http://stackoverflow.com/q/24926610
tag name: firefox
tags question: http://stackoverflow.com/q/25001739
tags question: http://stackoverflow.com/q/25009508
tags question: http://stackoverflow.com/q/24979131
tags question: http://stackoverflow.com/q/24954664
tags question: http://stackoverflow.com/q/25019687
tags question: http://stackoverflow.com/q/24939906
tags question: http://stackoverflow.com/q/24949433
tags question: http://stackoverflow.com/q/25023365
tags question: http://stackoverflow.com/q/25021690
tags question: http://stackoverflow.com/q/24975388
tags question: http://stackoverflow.com/q/25056395
tags question: http://stackoverflow.com/q/24948898
tags question: http://stackoverflow.com/q/25025561
type: Tag
tags question: http://stackoverflow.com/q/25052396
tags question: http://stackoverflow.com/q/24967685
tags question: http://stackoverflow.com/q/25067974
tags question: http://stackoverflow.com/q/24986991
tags question: http://stackoverflow.com/q/24959275
tags question: http://stackoverflow.com/q/24926160
tags question: http://stackoverflow.com/q/25069040
tags question: http://stackoverflow.com/q/24974554
tags question: http://stackoverflow.com/q/24917454
tags question: http://stackoverflow.com/q/25041186
tags question: http://stackoverflow.com/q/25042679
tags question: http://stackoverflow.com/q/24972416
tags question: http://stackoverflow.com/q/24936658
tags question: http://stackoverflow.com/q/24941175
tags question: http://stackoverflow.com/q/24970405
tags question: http://stackoverflow.com/q/24955790
tags question: http://stackoverflow.com/q/24916437
tags question: http://stackoverflow.com/q/24953746
tags question: http://stackoverflow.com/q/24922317
tags question: http://stackoverflow.com/q/24921501
tags question: http://stackoverflow.com/q/25026646
tags question: http://stackoverflow.com/q/24954313
tags question: http://stackoverflow.com/q/25025502
tags question: http://stackoverflow.com/q/25024197
tags question: http://stackoverflow.com/q/24939363
tags question: http://stackoverflow.com/q/24974146
tags question: http://stackoverflow.com/q/25022569
tags question: http://stackoverflow.com/q/24978566
tags question: http://stackoverflow.com/q/24966176
tags question: http://stackoverflow.com/q/25067266
tags question: http://stackoverflow.com/q/24930054
tags question: http://stackoverflow.com/q/25036821
tags question: http://stackoverflow.com/q/25027110

http://stackoverflow.com/q/24949048
tagged with: css
has answer: http://stackoverflow.com/a/24949168
type: AnsweredQuestion
has body: I use disqus in my news site for comments, i put disqus div as display:none, i want that the user have to do click in a button for show and hide this div. I did a script in jQuery doing toggle in this button, and I can hide and show the div, but when it shows, does not focus on the div, but this is where the button. This is not useful since pressing the button should take the user to the section where comment, but does not. script: $(document).ready(function(){ $('.gn-icon-bubble').attr("href","#foot").click(function(){ $('.disqus_thread').toggle('swing'); }); }); .gn-icon-bubble is the button and as you know, .disqus-thread is the div's class; #foot is my anchor, are in the main page's footer, but still don't works. I've tried using anchors, but gives the same, still focus comments. I really appreciate your help.
accepted answer: http://stackoverflow.com/a/24949168
type: Question
answer count: 2
has title: Jquery don't focus in disqus div
tagged with: javascript
tagged with: jquery
score: 0
possible better answer: http://stackoverflow.com/a/24949228
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24949228
tagged with: disqus

http://stackoverflow.com/comment/63612658
score: 0
type: Comment
comment on: http://stackoverflow.com/a/36457742
has text: Yap, that's great! I've just update your answer as solution since the it comes out that we have ready component instead of customizing.
type: AnswerComment

http://stackoverflow.com/q/24953732
answer count: 3
upvote count: 1
tagged with: dom
has body: I have very annoying problem in my code. When I change a checkbox state, the click event of it parent fires as well. I've tried different methods to solve this problem like: event.stopImmediatePropagation(); event.stopPropagation(); event.preventDefault(); return false Unfortunately no one works for be (probably it's not related to "event propagation" issue). How can I make ('.sortable').click not to be fired on checkbox change? HTML Hello all! Click on me jQuery $(function(){ $('.sortable input[type=checkbox]').change(function(event){ event.stopImmediatePropagation(); event.stopPropagation(); event.preventDefault(); alert('checkbox changed'); }); $('.sortable').click(function(){ alert('sortable clicked'); }); }); You can find the code on: Demo
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has answer: http://stackoverflow.com/a/24953858
has answer: http://stackoverflow.com/a/24953845
has title: Prevent parent event fire on jQuery
tagged with: jquery-events
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38783260
has answer: http://stackoverflow.com/a/24954126
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/38783236

http://stackoverflow.com/comment/38826907
comment on: http://stackoverflow.com/a/24976806
score: 0
type: AnswerComment
has text: You're welcome ! i guess we all (including me) are too afraid to waste performance since javascript can prove slow. But here no way to get things done without changing globalAlpha at least once per sprite. Fastest would be, i just saw, to use a) way to batch draw all sprites, then set alpha to 1. But don't worry too much, on desktop things should be fast enough. Cheers !
type: Comment

http://stackoverflow.com/comment/38782903
score: 0
type: Comment
has text: I'm so confused here, I put the exact code into VisualStudio and it works but it creates two ADickinson's, so I tried putting it in my own jsFiddle and it works fine. What's going on?
comment on: http://stackoverflow.com/a/24935346
type: AnswerComment

http://stackoverflow.com/a/25131074
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25066270
has body: Why isn't Array.fill() working? Array.fill() is a proposed part of the ES6 spec (still experimental as at August, 2014), so is definitely not supported out-of-the-box in the MongoDB 2.4 or 2.6 mongo shell or server-side JavaScript. What are the new ES5 array methods? 2.4 plus should have the ES5 array extensions There are nine new Array methods in ES5: indexOf, lastIndexOf, every, some, forEach, map, filter, reduce, and reduceRight. You can find out more about available Array methods in the ES5 spec. Is there a workaround to use Array.fill()? If you really want to use this function there happens to be a reference implementation of Array.fill() in the Mozilla Developer Network documentation. You could embed this code in your Map-Reduce functions or store a server-side JavaScript function in system.js as appropriate. NOTE: In general, use of server-side JavaScript in MongoDB is discouraged for performance reasons. Server-side functions will add overhead to all server-side JavaScript contexts, so if you only need this for a specific or infrequently used Map-Reduce job you would probably be better embedding the code. Extending the mongo shell It is also possible to extend the mongo shell with custom JavaScript functions using one of several methods: Paste JavaScript code into an active mongo shell session. Use load() to load and evaluate the contents of a JavaScript file. Save JavaScript code into ~/.mongorc.js to have this loaded when you start the mongo shell. Use db.loadServerScripts() to load all JavaScript functions saved in the server-side system.js collection for the current database.
score: 5
upvote count: 5
answers question: http://stackoverflow.com/q/25066270
type: AcceptedAnswer

http://stackoverflow.com/comment/38724066
score: 0
has text: @eithedog Yeah that looks great. I'll accept it as an answer!
comment on: http://stackoverflow.com/q/24920318
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24992132
has comment: http://stackoverflow.com/comment/38855365
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38855496
has comment: http://stackoverflow.com/comment/38855609
has body: Consider I had 2 html pages, index.html info.html index.html consists of a sign up form to view the info.html, which saves the details on signup to the server and redirect to info.html page. It works well on every browser except Internet explorer. But in IE It doesn't redirect. I'm using the following code, function StartService(param) { var ajaxUrl = "/WebService.asmx/Notify"; $.ajax({ type: "POST", crossDomain: true, contentType: "application/json; charset=utf-8", url: ajaxUrl, data: param, dataType: "json", success: successTest, error: errorTest }); function successTest(data) { var result = data.d; //console.log(result); if (result === 'success') { setTimeout(function () { window.location.href = 'info.html'; }, 3000); } else { alert(result); } } function errorTest(xhr, textStatus, errorThrown) { console.log(xhr.responseText); } } Can someone please help with this.
has title: Trouble in redirecting to another page from IE after ajax post (Description Inside)
has comment: http://stackoverflow.com/comment/38856120
has comment: http://stackoverflow.com/comment/38855763
has comment: http://stackoverflow.com/comment/38855402
upvote count: 2
type: Question
has answer: http://stackoverflow.com/a/25253675
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/38856050
has comment: http://stackoverflow.com/comment/38855791
score: 2
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38855448
favorite count: 0
tagged with: ajax

http://stackoverflow.com/q/24979256
favorite count: 0
has title: TypeError: g is not a function
upvote count: 1
has comment: http://stackoverflow.com/comment/38831338
downvote count: 0
has comment: http://stackoverflow.com/comment/38833767
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/24979326
has comment: http://stackoverflow.com/comment/38831161
type: Question
tagged with: arcgis-js-api
has body: While re-writing one of my applications from scratch (to go from legacy to AMD) I'm encountering an error which I can't figure out. It is driving me crazy. I'm probably just misspelling something or have another minor mistake, but I just can't figure out what. Any help would be highly appreciated! I'm still in development mode, so my code isn't that pretty at this time. You can see it live in action at here: http://tpgrf.nl/testserver/alpha/topotrainer/flevoland The javascript code: //Define area and url's var currentPath = window.location.pathname.split('/'); var AREA = currentPath[currentPath.length - 2]; if (AREA == 'europa' || AREA == 'wereld' || AREA == 'nederland') { var AREAURL = AREA; var AREAisProvince = false; } else { AREAURL = 'nederland'; var AREAisProvince = true; }; //Ondervang provincies var basemapURL = window.location.protocol + "//tiles.arcgis.com/tiles/nSZVuSZjHpEZZbRo/arcgis/rest/services/Topografie_in_de_klas_" + AREAURL + "_ondergrond/MapServer"; var contentFeatureURL = window.location.protocol + "//services.arcgis.com/nSZVuSZjHpEZZbRo/ArcGIS/rest/services/Topografie_in_de_klas_" + AREAURL + "/FeatureServer/0"; var CONTENT = 'cito100'; //Default to 'cito100', user can adjust manually var TYPES = ''; //empty for now, will be defined later by the user var TYPES = 'plaats'; //for testingunction's// // function generateUUID() { var d = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { var r = (d + Math.random() * 16) % 16 | 0; d = Math.floor(d / 16); return (c == 'x' ? r : (r &amp; 0x7 | 0x8)).toString(16); }); return uuid; }; // //Figure something out here to detect if the user as a new or returning visitor // ////////////////////////////////////// //Create a basemap and load features// ////////////////////////////////////// var dojoConfig = { parseOnLoad: true }; var map; require(["esri/geometry/Extent", "esri/SpatialReference", "esri/map", "esri/graphic", "esri/layers/ArcGISTiledMapServiceLa…
has comment: http://stackoverflow.com/comment/38831170
answer count: 1
has answer: http://stackoverflow.com/a/24979326
tagged with: javascript

http://stackoverflow.com/a/25008110
has comment: http://stackoverflow.com/comment/38912997
type: Answer
answers question: http://stackoverflow.com/q/25008063
has comment: http://stackoverflow.com/comment/38885605
has body: Use the noConflict() method to specify a new name for the jQuery variable: Example var test=$.noConflict(); test(document).ready(function() { var test = new Test({ baseUrl: 'http://example.com', interval: 15000, testId: 8, }); }); If you have a block of jQuery code which uses the $ shortcut and you do not want to change it all, you can pass the $ sign in as a parameter to the ready method. This allows you to access jQuery using $, inside this function - outside of it, you will have to use "jQuery": $.noConflict(); jQuery(document).ready(function($) { var test = new Test({ baseUrl: 'http://example.com', interval: 15000, testId: 8, }); });
score: 0

http://stackoverflow.com/q/24944242
score: 0
answer count: 1
linked to: http://stackoverflow.com/q/14529358
tagged with: jquery
has comment: http://stackoverflow.com/comment/38766427
has answer: http://stackoverflow.com/a/24945511
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38766834
linked to: http://stackoverflow.com/q/13761222
has comment: http://stackoverflow.com/comment/38767026
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38766494
has title: Adding an empty cell to the last line of jqgrid dynamically
type: Question
tagged with: jqgrid
tagged with: javascript
linked to: http://stackoverflow.com/q/12200621
has comment: http://stackoverflow.com/comment/38766196
has body: I've been working on JQGid and has a requirement to combine common cells together in one big cell as shown! Now the requirement is the add another cell below the last to that would have a clickable button in new cell in the Address column.Which is for adding a new address for adam whose dob is 11/11/1988. So the help I require is to create a an empty cell dynamically as the datasource for the jqgrid is a json object and I won't be able to modify the json value PLease let me know any custom formatter you know for this specific odd requirement Any help would be appreciated Below given is the cellattr function I've used to combine then Name field cellattr: function (rowId, val, rawObject, cm, rdata) { var result; if (prevCellVal.value == val) { result = ' style="display: none" rowspanid="' + prevCellVal.cellId + '"'; } else { var cellId = this.id + '_row_' + rowId + '_' + cm.name; result = ' rowspan="1" id="' + cellId + '"'+'"+"'; prevCellVal = { cellId: cellId, value: val }; } return result ; } May be I'm not getting what you are trying to say but this is my current scenario and what I would need to is to move the add new Value dropdown to be added as a new row on the right side under the existing file or files (could be multiple based on the returned value from the server). I have used cellattr function as said above. with the answers i'm not able to fix this. Using formatter I'm able to move it to the right side when there are no files are returned. But I'm not able to move it to the side with values returned Further help would be appreciated Thanks in advance

http://stackoverflow.com/q/25036642
has comment: http://stackoverflow.com/comment/40000922
has comment: http://stackoverflow.com/comment/38939539
linked to: http://stackoverflow.com/q/3885817
possible better answer: http://stackoverflow.com/a/25036733
answer count: 2
has answer: http://stackoverflow.com/a/25036733
tagged with: javascript
has body: I am writing some type check functions. I want: isInteger isFloat While writing isInteger, I noticed that isInteger(1.0) returns true. I want this to return false. My function is like this: function isInteger(value) { return typeof value === 'number' &amp;&amp; value % 1 === 0; } I also noticed that it return true for 1.0 because the argument 'value' is immediately converted to 1 (which I don't want). I did this: function isInteger(value) { console.log(value) // It prints 1 if value is 1.0 return typeof value === 'number' &amp;&amp; value % 1 === 0; } Of course, I consider the situation where I might need to use regEx: var regEx = /^-?[0-9]+$/; regEx.test(value) BUT, first I need the function to actually test the value 1.0 instead of 1. How could I do this in order to maintain the 1.0 in the function argument? Thank you
tagged with: typechecking
has answer: http://stackoverflow.com/a/25036670
tagged with: regex
tagged with: integer
type: AnsweredQuestion
has title: How to check if a value is an integer in Javascript (special case 1.0 should be float)
score: 0
has comment: http://stackoverflow.com/comment/38939074
tagged with: floating-point
type: Question
has comment: http://stackoverflow.com/comment/38938957
accepted answer: http://stackoverflow.com/a/25036670

http://stackoverflow.com/q/24958816
score: 0
downvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/38792682
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38798303
has body: Here's a fiddle. http://fiddle.jshell.net/GF9nj/1/ What I'm trying to figure out is why when I .push my object data into the randomAnswerArray it doesn't show up even in the testing . It's about halfway down the JavaScript section. Here is the code in question: // incorrectAnswer1, incorrectAnswer2, incorrectAnswer3 are initialised elsewhere ... randomAnswerArray = []; //resets the array to empty randomAnswerArray.push(randomQuestion.correctAnswer); document.getElementById('test3').innerHTML=randomAnswerArray[0]; //TESTING doesn't work randomAnswerArray.push(randomQuestion.incorrectAnswer1); randomAnswerArray.push(randomQuestion.incorrectanswer2); randomAnswerArray.push(randomQuestion.incorrectanswer3); document.getElementById('test1').innerHTML = randomAnswerArray.valueOf(); the valueOf() call displays only the 0 and 1 items from randomAnswerArray, but I'm pushing 2 & 3 as well. Here is the full code of the fiddle: HTML Click me to start! JavaScript var questionList = []; var randomAnswerArray = []; // this is the question object constructor function quizQuestion(question, correctAnswer, incorrectAnswer1, incorrectAnswer2, incorrectAnswer3) { this.question = question; this.correctAnswer = correctAnswer; this.incorrectAnswer1 = incorrectAnswer1; this.incorrectAnswer2 = incorrectAnswer2; this.incorrectAnswer3 = incorrectAnswer3; } // this constructs a question var hairColor = new quizQuestion("What color is my hair?", "black", "blue", "red", "purple"); // this adds the question to the questionList questionList.push(hairColor); document.getElementById('test2').innerHTML = questionList[0].correctAnswer; //TESTING object constructor works function generate() { // this part picks a random question var randomQuestion = questionList[Math.floor(Math.random() * questionList.length)]; // this part puts the question in the questionString document.getElementById("questionString").innerHTML = randomQuestion.question; // this part puts the answers in the array // THIS IS WHAT WE …
favorite count: 0
has answer: http://stackoverflow.com/a/24959584
accepted answer: http://stackoverflow.com/a/24959584
has title: How do I add object properties into an array in JavaScript?
has comment: http://stackoverflow.com/comment/38792905
has comment: http://stackoverflow.com/comment/38792871
has answer: http://stackoverflow.com/a/24959199
has answer: http://stackoverflow.com/a/24959122
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/38792944
has comment: http://stackoverflow.com/comment/38793395
has comment: http://stackoverflow.com/comment/38792789
type: Question
tagged with: arrays
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24959199
has comment: http://stackoverflow.com/comment/38792711
has comment: http://stackoverflow.com/comment/38793138
upvote count: 2
has comment: http://stackoverflow.com/comment/38792605

http://stackoverflow.com/q/25028853
score: 39
tagged with: addeventlistener
has body: How can I make it so that addEventListener() has two functions inside it?
tagged with: javascript
has answer: http://stackoverflow.com/a/76146895
tagged with: function
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/46116134
has answer: http://stackoverflow.com/a/25028877
upvote count: 39
has answer: http://stackoverflow.com/a/46116134
has title: addEventListener Two Functions
answer count: 4
has answer: http://stackoverflow.com/a/64404396
type: Question
accepted answer: http://stackoverflow.com/a/25028877
type: AnsweredQuestion

http://stackoverflow.com/a/25069647
has comment: http://stackoverflow.com/comment/39014853
has comment: http://stackoverflow.com/comment/39014128
downvote count: 0
has comment: http://stackoverflow.com/comment/39015079
answers question: http://stackoverflow.com/q/25069525
upvote count: 2
has comment: http://stackoverflow.com/comment/39015720
type: Answer
has body: You didn't properly select the .tile__more class. You need to start from the parent of .tile__more div then you will easily find it after: function update_more() { $('.tile').each(function() { var $this = $(this); if ($this.find('.quickmark').length &gt; 4) { $this.find('.tile__more').show(); } else { $this.find('.tile__more').hide(); } } Call this function eveytime you need to update your button after dom changed. So after dropping you should call this function: update_more(); http://jsfiddle.net/Bws3t/8/
score: 2
has comment: http://stackoverflow.com/comment/39012435

http://stackoverflow.com/comment/38737464
has text: To make an extra request instead of including the data that you already have is not efficient. Besides, this should be a comment, it doesn't address the actual question at all.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24929491

http://stackoverflow.com/comment/38713768
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24912600
has text: Thanks @joseph I got the idea ! :)

http://stackoverflow.com/a/25693594
type: AcceptedAnswer
downvote count: 0
has body: There are a couple of things you could do here. In the simplest case, you could just validate the value in the pageChanged handler. If the page doesn't exist, update it: pageChanged: function(){ var foundPage = this.$.pages.querySelector('#' + this.page); if (! foundPage) { this.page = 'error' } ... See: http://jsbin.com/xequvone/14/edit If you don't bind the core-menu directly to the core-animated-pages, you can add whatever logic you want. The following version does exactly the same thing as the previous one, but uses a separate variable for the selected page: http://jsbin.com/xequvone/12/edit I think you'd want a router if your URL scheme was more complex. For example, if the hash includes multiple levels and parameters, such as #people, #/people/search or #/people/edit/12343.
type: Answer
accepted answer of: http://stackoverflow.com/q/24912658
answers question: http://stackoverflow.com/q/24912658
upvote count: 1
score: 1

http://stackoverflow.com/comment/38722517
comment on: http://stackoverflow.com/q/24921122
type: Comment
type: QuestionComment
score: 0
has text: You should have extended View instead of a model.

http://stackoverflow.com/a/25004246
downvote count: 1
score: 0
answers question: http://stackoverflow.com/q/25004182
type: Answer
has body: That's because of the promise system and how the objects are printed in the console, they are printed by reference and not by value. Try doing console.log(JSON.stringify(json)) which is a string and not an object and you will see that you are missing the the responseJSON attribute. you responseJSON attribute is probably attached to the object at a future time but the console.log(Object) will print it's current value, even tho that value was added after you used console.log.
upvote count: 1

http://stackoverflow.com/q/25019131
score: 0
has comment: http://stackoverflow.com/comment/38906675
answer count: 1
has title: Use BootStrap PopOver in Joomla-Backend
has comment: http://stackoverflow.com/comment/38906769
has comment: http://stackoverflow.com/comment/38906930
has answer: http://stackoverflow.com/a/25019628
type: AnsweredQuestion
has body: I would like to use the Bootstrap PopOver (http://getbootstrap.com/2.3.2/javascript.html#popovers) in the backend of my component. Well, the Tooltips already work by using: echo JHTML::_('tooltip','test','','','Test'); But the popovers do not work this way. Could somebody help me out?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38907404
type: Question
has comment: http://stackoverflow.com/comment/38906968
tagged with: joomla
linked to: http://stackoverflow.com/q/11947094
accepted answer: http://stackoverflow.com/a/25019628
tagged with: twitter-bootstrap

http://stackoverflow.com/a/28699378
downvote count: 0
upvote count: 8
type: Answer
score: 8
has body: use this code to destroy CK editor: try { CKEDITOR.instances['textareaid'].destroy(true); } catch (e) { } CKEDITOR.replace('textareaid');
answers question: http://stackoverflow.com/q/25034150

http://stackoverflow.com/a/24919574
has comment: http://stackoverflow.com/comment/38721125
answers question: http://stackoverflow.com/q/24919470
has comment: http://stackoverflow.com/comment/38721418
has comment: http://stackoverflow.com/comment/38721389
type: Answer
accepted answer of: http://stackoverflow.com/q/24919470
has comment: http://stackoverflow.com/comment/38721449
has comment: http://stackoverflow.com/comment/38721273
has comment: http://stackoverflow.com/comment/38721879
upvote count: 3
has comment: http://stackoverflow.com/comment/38721315
score: 3
has body: As @DontVoteMeDown said in the comments, function enterPressed(); is a syntax error and you forgot to close enterPressed. You also forgot to close the keyup with });. I've corrected the errors in this code: EDIT: Changed to event.which rather than event.keyCode (which normalizes keyCode and charCode). $(document).ready(function() { var toSubmit = function() { var text = $("#input").val(); return text; }; var enterPressed = function() { $('#input').keyup(function(event) { if(event.which == 13) { toSubmit(); } }); }; enterPressed(); }); Working jsFiddle example: http://jsfiddle.net/D66Zw/1/ UPDATE: If you can, it would be better if you just listened for a form's submit event. That way you can call toSubmit and it will handle the enter key press and the submit button. Here is how you could do that: JavaScript: $(document).ready(function() { var toSubmit = function(e) { var text = $("#input").val(); // do whatever you want to do with 'text' variable here // stop form from submitting e.preventDefault(); return false; }; var formSubmit = function() { $('#form').submit(toSubmit); }; // call this when you want to bind the submit handler formSubmit(); }); HTML: &lt;form id="form"&gt; &lt;input type ="text" id="input"/&gt;&lt;br /&gt; &lt;input type="submit" id="insert"/&gt; &lt;/form&gt; New jsFiddle example, clicking the submit button and pressing enter works: http://jsfiddle.net/D66Zw/2/ Pushing value to array Before the toSubmit function, create the array: var list = []; In the toSubmit function: // push text to array list.push(text); // output array in console console.log(list); jsFiddle: http://jsfiddle.net/D66Zw/4/ (open up the console to see the array every time enter is pressed)
has comment: http://stackoverflow.com/comment/38721344
has comment: http://stackoverflow.com/comment/38721512
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38721261

http://stackoverflow.com/a/24958339
score: 1
has comment: http://stackoverflow.com/comment/38794235
upvote count: 1
has comment: http://stackoverflow.com/comment/38791937
answers question: http://stackoverflow.com/q/24957644
has body: I see you are trying to add a onclick as you built but if you create some jquery like so you can do it. But you would have to have jQuery loaded. Although if you are building this dynamically you may need to use $('document').find('td'). This may not be the solution you are looking for but will get the job done. $('td').on('click', function(){ var myClass = this.className; }) Tried adding in comment but wouldn't show code view.
downvote count: 0
has comment: http://stackoverflow.com/comment/38791809
type: Answer

jquery-plugins
tags question: http://stackoverflow.com/q/25020672
tags question: http://stackoverflow.com/q/24957729
tags question: http://stackoverflow.com/q/24984448
tags question: http://stackoverflow.com/q/24983015
type: Tag
tags question: http://stackoverflow.com/q/25057025
tags question: http://stackoverflow.com/q/24937378
tags question: http://stackoverflow.com/q/24945377
tags question: http://stackoverflow.com/q/24996297
tags question: http://stackoverflow.com/q/24933015
tags question: http://stackoverflow.com/q/24925435
tag name: jquery-plugins
tags question: http://stackoverflow.com/q/24951569
tags question: http://stackoverflow.com/q/24976755
tags question: http://stackoverflow.com/q/24949458
tags question: http://stackoverflow.com/q/24979027
tags question: http://stackoverflow.com/q/25031738
tags question: http://stackoverflow.com/q/24986777

http://stackoverflow.com/a/24917066
has body: hey try this in your code.. try to get the x and y like this $(document).bind('touchmove mousemove', function (e) { var currentY = e.originalEvent.touches ? e.originalEvent.touches[0].pageY : e.pageY; var currentX = e.originalEvent.touches ? e.originalEvent.touches[0].pageX : e.pageX; //do your stuff }); thanks
upvote count: 8
type: Answer
accepted answer of: http://stackoverflow.com/q/24916577
answers question: http://stackoverflow.com/q/24916577
has comment: http://stackoverflow.com/comment/38716007
type: AcceptedAnswer
downvote count: 0
score: 8

http://stackoverflow.com/a/25064522
downvote count: 0
answers question: http://stackoverflow.com/q/25064443
type: Answer
accepted answer of: http://stackoverflow.com/q/25064443
score: 1
upvote count: 1
has body: There's no element with an ID of Ivrmapping[WelcomeNotes] in your fiddle (that's the name). The ID is Ivrmapping_WelcomeNotes. So try either $("#Ivrmapping_WelcomeNotes").val("20"); or $("[name='Ivrmapping[WelcomeNotes]']").val("20"); http://jsfiddle.net/Whre/Nem26/1
type: AcceptedAnswer

http://stackoverflow.com/comment/38720468
score: 0
type: Comment
type: QuestionComment
has text: @helmet91 Just adding the RegExp constructor couldn't have fixed your problem. If it worked then you must have fixed the improper escaping in your string as well.
comment on: http://stackoverflow.com/q/24919852

http-post
tags question: http://stackoverflow.com/q/25034571
type: Tag
tags question: http://stackoverflow.com/q/24998840
tags question: http://stackoverflow.com/q/25017733
tags question: http://stackoverflow.com/q/24915468
tags question: http://stackoverflow.com/q/24925632
tags question: http://stackoverflow.com/q/24972586
tag name: http-post
tags question: http://stackoverflow.com/q/24914729

http://stackoverflow.com/q/25018929
tagged with: javascript
tagged with: jquery
tagged with: visual-studio-2010
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38907722
has comment: http://stackoverflow.com/comment/38907641
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38907325
linked to: http://stackoverflow.com/q/210643
has comment: http://stackoverflow.com/comment/38907998
has comment: http://stackoverflow.com/comment/38908627
answer count: 0
has body: I am trying to make this input file work but when I try to use it on a div that opens up when called. It wont work. But I have another input file on the page which is working normaly. I have a js that clicks the file I need to be clicked. And the action is done but the file wont open. Any ideas why? Ill leave here the JS and the HTML. The firebug does not catch any error. Im using Firefox. Im doing this in Visual Studio. So this is the view without the header and footer. I have another form with a input which is working. The diference with this one is that the div inside opens up a box, kind of like a modal. HTML " + Name + " Promo Comienza:" + startdate + " Promo Termina: " + enddate + " close Promocion Fecha Inicio: Fecha Fin: " + description + " Mega Puntos Editar Promocion Borrar Promoción Here is the JS where I simulate the click on the file using the image. The image is doing the right click. I also tried clicking directly on the input. But it wont open the file explorer. function changeImg(id) { var num = id.split("fileE"); $("#imageE"+num[1]).click(); } Im calling for a list of rewards. and the post works just fine. As do the printing of each member of the list. Also the HTML is made by a ajax which gives the missing information. I was thinking maybe cause its an ajax, the input somehow does not work fine? thanks for the help in advance.
has comment: http://stackoverflow.com/comment/38908257
type: Question
has title: input type file not working

http://stackoverflow.com/q/24982280
has body: We need to implement the UI slider component for the zooming in/out of the D3.js graph. The slider should look and behave like OpenOffice Writer zoom slider at the bottom of the Writer window. Example: http://upload.wikimedia.org/wikipedia/commons/3/34/LibreOffice_Writer_3.3.png We found http://www.eyecon.ro/bootstrap-slider/ , but the functionality is very limited - the common stops (50%, 100%) are not implementable. Could anyone suggest proper Bootstrap or Jquery or D3.js component to start with?
has comment: http://stackoverflow.com/comment/38836785
type: Question
has comment: http://stackoverflow.com/comment/38904229
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38904179
score: 0
has title: Bootstrap UI slider for d3.js graph zooming ala OpenOffice Writer
has comment: http://stackoverflow.com/comment/38837113
answer count: 0
tagged with: twitter-bootstrap
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38853386

http://stackoverflow.com/q/24946747
has answer: http://stackoverflow.com/a/25580519
tagged with: tinymce-4
type: Question
tagged with: modal-dialog
has title: Image Insert error with Twitter Bootstrap 3 Modal and Tinymce Editor
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25580519
has body: When I am loading tinymce in Bootstrap Modal. All the popup image insert, URL insert, Source code opions doesnot work. Here is JsFiddle :- http://jsfiddle.net/n9e63/ HTML Code :- &lt;!-- Button trigger modal --&gt; &lt;button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal"&gt; Launch demo modal &lt;/button&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;textarea class="form-control" id="message"&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-dialog --&gt; &lt;/div&gt;&lt;!-- /.modal --&gt; Here is Javascript Code :- tinymce.init({ selector: "textarea#message", theme: "modern", plugins: [ "advlist autolink lists link image charmap print preview hr anchor pagebreak", "searchreplace wordcount visualblocks visualchars code fullscreen", "insertdatetime media nonbreaking save table contextmenu directionality", "emoticons template paste textcolor colorpicker textpattern" ], toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", toolbar2: "print preview media | forecolor backcolor emoticons", image_advtab: true, templates: [ {title: 'Test template 1', content: 'Test 1'}, {title: 'Test template 2', content: 'Test 2'} ] }); JsFIDDLE URL :- http://jsfiddle.net/…
tagged with: twitter-bootstrap
type: AnsweredQuestion

http://stackoverflow.com/comment/38858045
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24993080
has text: It is javascript behavior! in javascript, new Date('Sat Jul 26 2014 00:00:00 GMT+0300 (Jerusalem Daylight Time)').getYear() - returns 114. why? why doesn't it return 2014???

http://stackoverflow.com/comment/38827563
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24977103
type: QuestionComment
has text: Did you try *only* adding ``track by $index`` and not changing your other expressions to ``$index``? e.g `` {{$entry.name}} ``

http://stackoverflow.com/q/25066885
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25068281
has title: Is it possible to get the calculated transform:scale value from nested divs?
has body: When DIVs are nested with a css3 scale factor the scale values multiply. What is the best way get the current value from nested DIVs? As far as I understand it's not possible to get the value with a simple javaScript DOM query, right? Here is a simple example. The current scale from the inner DIV is 0.8*0.5, but I would like to get this value with a simple function or something. Any Ideas? &lt;div id="scale08" &gt; Scale 0.8 &lt;div id="scale05" &gt; what global scale do I have?&lt;/div&gt; &lt;/div&gt; #scale08{ background:green; width:100px; height:100px; transform:scale(0.8); } #scale05{ background:blue; width:100px; height:100px; transform:scale(0.5); } http://jsfiddle.net/B4Uxn/ Thanks guys!
type: Question
answer count: 1
tagged with: javascript
score: 0

http://stackoverflow.com/comment/38852346
has text: *and I've copied the vital code from w3schools* Don't refer that site if you want to learn nicely
comment on: http://stackoverflow.com/q/24990485
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/q/25057034
has answer: http://stackoverflow.com/a/25058068
duplicate of: http://stackoverflow.com/q/14220321
type: AnsweredQuestion
tagged with: global-variables
type: Question
accepted answer: http://stackoverflow.com/a/25058068
answer count: 1
tagged with: javascript
has body: I have the following function: var checkExist = function(_id) { var t; car.count({ id: _id }, function(err, c) { if (c != 0) { t = 0; console.log(t); } else { t = 1; console.log(t); } }); console.log(t); return t; } The problem: 't' is undefined at the end of the function, but it changes values inside of the if/else block. Any suggestions how to solve this? merci
tagged with: asynccallback
has title: How to change a global variable from the inside of a anonymous function?
has comment: http://stackoverflow.com/comment/38977619
linked to: http://stackoverflow.com/q/14220321
score: 0

http://stackoverflow.com/q/24977499
has comment: http://stackoverflow.com/comment/38827969
tagged with: javascript
has comment: http://stackoverflow.com/comment/38828033
upvote count: 3
score: 0
downvote count: 3
has comment: http://stackoverflow.com/comment/38828005
has comment: http://stackoverflow.com/comment/38827912
has comment: http://stackoverflow.com/comment/38827965
has title: Save integer as float
has comment: http://stackoverflow.com/comment/38828009
has comment: http://stackoverflow.com/comment/38827933
has comment: http://stackoverflow.com/comment/38828007
has comment: http://stackoverflow.com/comment/38828018
has body: function prec(numb){ var numb_string = numb.toString().split('.') return numb_string[(numb_string.length - 1)].length } function randy(minimum, maximum) { var most_accurate = Math.max ( prec(minimum), prec(maximum) ); return ( ( Math.random() * ( maximum - minimum ) + minimum ).toFixed( most_accurate ) ); } // returns random numbers between these points. 1 decimal place of precision: console.log( randy(2.4,4.4) ); // returns random numbers between these points. 3 decimal places of precision: console.log( randy(2.443,4.445) ); // returns random numbers between these points. Want 3 decimal places of precision. However, get 0: console.log( randy(2.000,4.000) ); // Why do I get 0 decimal places? Because floats are rounded into integers automatically: console.log( 4.0 ); // want 4.0 to be logged. Instead I get '4' You don't need to read how the functions work. Just the console logs. Basically, I need to return a random number between two points to a degree of precision. The precision is automatically derived from the most precise float passed to the randy function. This works fine when the number range is 3.5 3.7 or 34.4322 800.3233 but not 2.0, 3.0 or 4.0000, 5.0000 Then the number is appears to be automatically saved as an integer: console.log( 2.0 ) //=&gt; 2 I want to extend the Number prototype so that 2.0 is saved as 2.0 so that this function can find the precision: function prec(numb){ var numb_string = numb.toString().split('.') return numb_string[(numb_string.length - 1)].length } It currently thinks that 3.000000000 has a precision of 0 decimal places because if 3E8 is passed in as the numb parameter, it's read as 3. I want it read as 3.000000000 While I can do this randy(2.toFixed(3),3.toFixed(3)) it gets unreadable and it would be undeniably nicer to do this for smaller precisions: randy(2.000,3.000). Is this possible? Fiddle
has answer: http://stackoverflow.com/a/24977573
favorite count: 0
has comment: http://stackoverflow.com/comment/38827977
has comment: http://stackoverflow.com/comment/38827901
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38827898
has answer: http://stackoverflow.com/a/24977903
has comment: http://stackoverflow.com/comment/38827903
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38827932

http://stackoverflow.com/comment/38804776
score: 2
comment on: http://stackoverflow.com/q/24965037
has text: alert("turd"); - HAHA
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38942829
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25033119
has text: Touche! I've edited the question. We see the issue in IE11/edge -- and I think I've seen it in IE11 under several of the compatibility modes.
score: 0

http://stackoverflow.com/comment/38719566
score: 1
has text: Radio boxes need a name attribute, and the name needs to be the same among the buttons in the group. Also, your fiddle doesn't match the code in your question.
comment on: http://stackoverflow.com/q/24919618
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25024058
has title: Nav & Cart Menu Issue not expanding not collapsing
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38940064
type: Question
tagged with: debugging
tagged with: magento
tagged with: javascript
has answer: http://stackoverflow.com/a/25045326
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has body: The website I am customizing is http://flamelogs.com. When I resize my window for mobile view the cart menu expands and cannot collapse and the nav menu does not expand. Everything is fine when the window is at normal view. I really don't have great experience with Javascript/Jquery so I don't know how to troubleshoot this. If someone could please inspect the element and give me some help I would greatly appreciate it. I received the error about where Jquery targets the ul.accordion Uncaught TypeError: undefined is not a function jQuery(document).ready(function () { jQuery("ul.accordion li.parent").each(function(){ jQuery(this).append('&lt;em class="open-close"&gt;&amp;nbsp;&lt;/em&gt;'); }); jQuery('ul.accordion').accordionNew(); jQuery("ul.accordion li.active").each(function(){ jQuery(this).children().next("ul").css('display', 'block'); }); });
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38916414

http://stackoverflow.com/comment/38717214
type: AnswerComment
has text: The subtraction will work for reversing but if you ever decide to sort them in a different order, say by title, then it will break again.
type: Comment
comment on: http://stackoverflow.com/a/24918301
score: 0

http://stackoverflow.com/comment/38809907
type: AnswerComment
has text: s i checked the fiddle. When i click the button the toogle(input box) starts with someheight and at the end of the effect there is slight change in height. why it happens?
type: Comment
comment on: http://stackoverflow.com/a/24967792
score: 0

http://stackoverflow.com/a/25052696
accepted answer of: http://stackoverflow.com/q/25052280
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25052280
type: Answer
has comment: http://stackoverflow.com/comment/38974174
has body: if you want to send the values to another page. You will have to use a query string. The following code does the same. Passing Parameters between pages Now a paramVal as "Hello Param" will be passed to another page as Default2.html. And can be retrieved using following code function GetParamValue() { var query = window.location.search.substring(1); var parms = query.split('&'); for (var i=0; i >parms.length; i++) { var pos = parms[i].indexOf('='); if (pos > 0) { var key = parms[i].substring(0,pos); var val = parms[i].substring(pos+1); alert(val); } } } Use above code in script to get the list of all the values sent
score: 0

http://stackoverflow.com/comment/38855105
comment on: http://stackoverflow.com/a/24991751
score: 0
type: Comment
has text: That was a typo when I copied the code to plnkr. If you have a look at the plunk you can see that I've corrected the code and the error remains.
type: AnswerComment

http://stackoverflow.com/a/24952602
has comment: http://stackoverflow.com/comment/38783603
has comment: http://stackoverflow.com/comment/38781795
answers question: http://stackoverflow.com/q/24952294
accepted answer of: http://stackoverflow.com/q/24952294
has body: If I understand you correctly, you have a process, say of 5 steps. After step 5 there is some result prepared, to which you want to point your client, not via HTTP-3xx, but in a cleaner way. I would suggest, that you make use of the link property in your JSON-response: { ... "links": [ ... "result": { "href": "/calculation/1234" } ... ] } Your client could take this answer and transform it to a simple link/button. This is conforming with HATEOAS (Hypermedia As The Engine Of Application State), indicating, that the current state offers the result under a different location which is referenced.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38782037
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/38781827
score: 2

http://stackoverflow.com/q/24964020
has answer: http://stackoverflow.com/a/24964087
has comment: http://stackoverflow.com/comment/38802954
has comment: http://stackoverflow.com/comment/38803250
tagged with: css
accepted answer: http://stackoverflow.com/a/24964087
type: AnsweredQuestion
score: 2
upvote count: 2
has body: Does anyone know, in the grand scope of things, what are the costs of dynamically adding and removing style sheets from a webpage while it is live (real-time script actions as seen below). I understand that over all CSS compiling speeds are much faster than other compilers, but I would like to understand how fast and if/how that effects HTTP Requests while on the page. I would also like to know how JavaScript affects the page if initially there is a script loaded and then it is swapped out. I am looking to ease the strain of having to switch from "Full-Screen" to "Mobile" in a browser and cross-platform webpages. I am using a combination of Media Queries through JavaScript and CSS in order to serve all (as many as I can) in different scripts and style sheets. ... &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;...&lt;/title&gt; &lt;script type="text/javascript"&gt; function loadSecondary(){ //For full screen do nothing. if(window.innerWidth &gt; 652 &amp;&amp; document.getElementsByTagName("link")[0].id == "mobile") { //Remove the current style sheet sheet = document.getElementById("mobile"); sheet.parentNode.removeChild(sheet); //Load the page again. loadPrimary(); } else if(window.innerWidth &lt; 651 &amp;&amp; document.getElementsByTagName("link")[0].id == "full") { //Remove the current style sheet sheet = document.getElementById("full"); sheet.parentNode.removeChild(sheet); //Load the page again. loadPrimary(); } } function loadPrimary() { var fileref = document.createElement("link"); fileref.setAttribute("rel", "stylesheet"); fileref.setAttribute("type", "text/css"); if(window.innerWidth &gt; 652) { fileref.setAttribute("id", "full"); fileref.setAttribute("href", 'css/stylesFull.css'); document.getElementsByTagName("head")[0].appendChild(fileref); console.log("Full"); } else { fileref.setAttribute("id", "mobile"); fileref.setAttribute("href", 'css/stylesMobile.css'); document.getElementsByTagName("head")[0].appendChild(fileref); console.log("Mobile"); } …
tagged with: stylesheet
tagged with: http
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38803576
answer count: 1
downvote count: 0
tagged with: web
has title: Dynamically adding JavaScript and CSS: Speed and Performance (Need-to-Know)
favorite count: 0

http://stackoverflow.com/a/25041221
has comment: http://stackoverflow.com/comment/38948689
has comment: http://stackoverflow.com/comment/38948373
answers question: http://stackoverflow.com/q/25041087
upvote count: 5
has comment: http://stackoverflow.com/comment/38948257
score: 5
has comment: http://stackoverflow.com/comment/38949043
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38948394
has comment: http://stackoverflow.com/comment/38948653
type: Answer
accepted answer of: http://stackoverflow.com/q/25041087
has comment: http://stackoverflow.com/comment/38948007
has comment: http://stackoverflow.com/comment/38949004
has comment: http://stackoverflow.com/comment/38948156
has comment: http://stackoverflow.com/comment/38948060
has body: You could hide the elements via CSS, and then, after the whole page is loaded, display the first one. Regarding the loading message, add an element containing it, which you can hide (or remove) as soon as the page is fully loaded. HTML: Loading, please wait... My Dynamic Content My Dynamic Content My Dynamic Content My Dynamic Content CSS: .divs_nav { display: none; } JavaScript: $(document).ready(function(){ $('#loading').hide(); $('.divs_nav').first().css('display', 'block'); //or whatever display value you want }); DEMO: http://jsfiddle.net/Zzg5M/
has comment: http://stackoverflow.com/comment/38948945

http://stackoverflow.com/comment/38833199
comment on: http://stackoverflow.com/q/24980174
score: 0
type: Comment
type: QuestionComment
has text: @RonRosenfeld I wanted to exclude all the special character apart for . and - before @

http://stackoverflow.com/q/24933900
tagged with: for-loop
has answer: http://stackoverflow.com/a/24934010
tagged with: javascript
has title: Function with for loop - game dice
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38745951
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24933980
has answer: http://stackoverflow.com/a/24934082
has comment: http://stackoverflow.com/comment/38745946
has body: I create this function in order to have a random number for my first dice game. function rollDice() { return Math.floor(Math.random()*6 + 1); } Now I want create a new function dices() with a for loop in order to use how much dices the user need. Usually I used length in a loop as this example: for (var i=1; i &lt; dices.length; i++) { // do something } How you got any suggestions on how to fix this? Thank you!
has comment: http://stackoverflow.com/comment/38746837
tagged with: loops
has comment: http://stackoverflow.com/comment/38745950
type: Question

http://stackoverflow.com/q/25043479
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/25043625
has comment: http://stackoverflow.com/comment/38954486
type: Question
has comment: http://stackoverflow.com/comment/38952363
score: -2
tagged with: javascript
tagged with: jquery
downvote count: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Javascript/jQuery codes doesn't work... - codes on github
accepted answer: http://stackoverflow.com/a/25043625
has body: I'm trying to do simple things like make a text blink (the "Loading... please wait." text) and to do a simple animation... moving the div intro to the outside top of the page along with the body div (yes, there's a div called body) This is the intro.js file: var blinker = function() { $('.loading').fadeOut(500); $('.loading').fadeIn(500); } setInterval(blinker, 1000); var vanish = function(){ $(document).ready( function(){ $('.intro').animate({ top: '-100%' }, 4000); $('.body').animate({ top: '-100%' }, 4000); }); $(document).ready(vanish); What i'm asking is how to fix this error... what's the error? Nothing happens. All the other files are on my git, click here to see. @dragonslovetacos already answered me how to fix the blink text. Now I just need to fix the code to move the page to the outside (top) of the screen. This code is to run after the page load. Fixed - Problem solved Thanks for @dragonslovetacos help but I could solve the slide up code by myself (without read anything just the code). What I did to slide the page up was just erase the first line of the vanish code, like this: $(document).ready( function(){ $('.intro').animate({ top: '-100%' }, 4000); $('.body').animate({ top: '-100%' }, 4000); }); Thanks again, for everyone who answered this question, mostly to @dragonslovetacos. ~relbeits_
has comment: http://stackoverflow.com/comment/38952417
has comment: http://stackoverflow.com/comment/38952355
tagged with: css
tagged with: git

http://stackoverflow.com/comment/38829468
has text: Sorry but I don't know why I bothered to entertain your requests in the first place. this question was never about firebase. I gave an answer to the OP, which was completely right from a technical perspective, and then you come and change the subject matter as if it were question on how to use firebase properly, which it never was. What I told the OP in my answer was to move whatever code he wanted to executed only once to outside of the public function of his service.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24950382

http://stackoverflow.com/q/24987000
has answer: http://stackoverflow.com/a/34725928
upvote count: 35
accepted answer: http://stackoverflow.com/a/24992543
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/30534721
tagged with: angular-ui-bootstrap
has answer: http://stackoverflow.com/a/33929769
favorite count: 0
answer count: 9
score: 35
has answer: http://stackoverflow.com/a/24992543
tagged with: http://stackoverflow.com/tag/html
has body: Am bit new to angularjs and bootstrap. Am trying to add a simple dropdown. But it is not working. Tried out the suggestion @ Bootstrap 3 simple dropdown not working. That is also not working. a a b c d e f g h i j k Complete code @ http://plnkr.co/edit/uFDFOJfHjL5qY9nVEykq?p=preview Hope someone would help me out.
has answer: http://stackoverflow.com/a/24987513
linked to: http://stackoverflow.com/q/18966079
tagged with: angularjs
has answer: http://stackoverflow.com/a/36154685
tagged with: twitter-bootstrap
possible better answer: http://stackoverflow.com/a/34725928
has answer: http://stackoverflow.com/a/33342694
has comment: http://stackoverflow.com/comment/59715594
has answer: http://stackoverflow.com/a/31304439
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/40051436
type: Question
has title: Angularjs bootstrap dropdown not working

http://stackoverflow.com/comment/38885390
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25007679
type: Comment
has text: not working If i add it to JS file, then CalcSumPopup does not display If I add it to , results display ON PAGE, without popup What information can I give you?

http://stackoverflow.com/comment/39131099
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25033832
has text: @php-dev, of course, this is a solution. But it's just an interesting behavior and now it's just a kind of "challenge".
score: 0

http://stackoverflow.com/a/25050492
has comment: http://stackoverflow.com/comment/38968271
score: 0
has comment: http://stackoverflow.com/comment/38965890
type: Answer
has body: There is a problem in select() function function select() { var container = containerHolders[Math.floor(Math.random() * containerHolders.length)]; if(container.holding.length) { var newer = container.holding[0];//here var old = container.live.splice(0, 1); old = old[0]; old.className = 'staging'; newer.className = 'live'; container.live.push(newer); container.holding.push(old); } else { console.log('none'); } } you will get the same image every time.
answers question: http://stackoverflow.com/q/25049781

http://stackoverflow.com/comment/38932835
comment on: http://stackoverflow.com/a/25031846
type: Comment
score: 1
type: AnswerComment
has text: $("#dialog").dialog() is Uncaught TypeError: undefined is not a function. It's clear that jquery UI library has not loaded in the page. Add this line of code in your page

http://stackoverflow.com/comment/38760460
comment on: http://stackoverflow.com/q/24941297
type: QuestionComment
has text: What have you tried? What do you mean by filtering on factor name? If you follow the [phonecat sample](https://docs.angularjs.org/tutorial/step_03) it should work, but the filter is generic. You could write your own filter easy enough.
type: Comment
score: 1

http://stackoverflow.com/q/25019737
type: Question
has comment: http://stackoverflow.com/comment/38908807
accepted answer: http://stackoverflow.com/a/25020648
has comment: http://stackoverflow.com/comment/38908429
tagged with: javascript
has comment: http://stackoverflow.com/comment/38908012
has comment: http://stackoverflow.com/comment/38908378
tagged with: jquery
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38908525
has comment: http://stackoverflow.com/comment/38907775
has body: I am getting data from the server side using AJAX, I am now trying to populate data from from a list of objects into divs, the problem I am having is that I can not create the div while inside of the foreach loop. $(document).ready(function () { var divs = ""; var url = "../Graphs/CreateChart"; $.ajax({ type: 'POST', url: url, success: function (data) { for (var i in data) { var x = data[i]; for (var j in x) { var val; if (x.hasOwnProperty(j)) { val = x[j].SpName; if (x[j].SpName != "undefined") { $('#a').appendTo('#content'); createBarChart("#a", "USP_Charts_BarChart1"); } } } } }, dataType: "json", cache: false }); }); &lt;/script&gt; I am trying to populate where it says "#a" with val and also then I need to populate the div I write with the val for the id, but when I try to put the document.write inside of the loop, I get a blank screen, any ideas why it would do this?
type: AnsweredQuestion
has title: Creating divs in AJAX loop
has answer: http://stackoverflow.com/a/25020648
linked to: http://stackoverflow.com/q/802854
has comment: http://stackoverflow.com/comment/38907935

http://stackoverflow.com/comment/38761180
has text: updated answer with sample retrieval in case I've misunderstood
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24939461

http://stackoverflow.com/comment/38826866
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24976748
has text: @caramba I have no troubles distinguishing my anchor tag from the rest of the `div`.

http://stackoverflow.com/a/24934160
has comment: http://stackoverflow.com/comment/38747241
answers question: http://stackoverflow.com/q/24933963
accepted answer of: http://stackoverflow.com/q/24933963
has comment: http://stackoverflow.com/comment/38749354
type: AcceptedAnswer
score: 0
has body: You can simply use: ng-repeat="(prop, obj) in data" with: prop then containing the property name. (E.g.: appData, invoiceData) and: obj containing the actual object. html: {{ prop }}: demo: http://jsbin.com/ximohage/1/
type: Answer
has comment: http://stackoverflow.com/comment/38746686

http://stackoverflow.com/comment/38852764
score: 0
type: AnswerComment
has text: Thanks buddy... gr8 help.. but how to style the header i.e. column heading...tr and td work fine... th is not working... how do i do that?
type: Comment
comment on: http://stackoverflow.com/a/24955870

http://stackoverflow.com/a/25034888
answers question: http://stackoverflow.com/q/25034756
upvote count: 1
has body: Ciao Gloria, You should add jQuery and then this piece of code in the header: $(function () { $("input[id*='Radio1']").click(function () { $("#&lt;%=UpdateButton.ClientID %&gt;").removeAttr('disabled'); }); }); To have ASP.NET supplanting &lt;%=UpdateButton.ClientID %&gt; with the actual ID of the control, you must enable the head as a server-side control, because ASP.NET will otherwise not check the content of &lt;head&gt; neither nested &lt;script&gt; tags: &lt;head runat="server"&gt; &lt;script&gt; // server-side variant JS with ASP.NET &lt;%= tags %&gt; &lt;/script&gt; &lt;/head&gt; More about this topic here: Understanding the runat server attribute
has comment: http://stackoverflow.com/comment/38936201
has comment: http://stackoverflow.com/comment/38936337
type: Answer
has comment: http://stackoverflow.com/comment/38938126
downvote count: 0
has comment: http://stackoverflow.com/comment/38936613
score: 1
accepted answer of: http://stackoverflow.com/q/25034756
type: AcceptedAnswer

http://stackoverflow.com/comment/38995898
type: AnswerComment
type: Comment
has text: You can use anonymous function like this: `$(labelArray[1]).on('mouseleave', function() {mouseOffOption('BB1' + group)})` I updated the answer accordingly.
comment on: http://stackoverflow.com/a/25064000
score: 0

http://stackoverflow.com/comment/38981012
has text: You can add an update to your answer, at least the OP is aware of his options, you answer is correct but it adds `N` more times the watchers.
type: Comment
comment on: http://stackoverflow.com/a/25041723
score: 0
type: AnswerComment

http://stackoverflow.com/q/25043227
type: Question
answer count: 1
has comment: http://stackoverflow.com/comment/38953592
tagged with: javascript
has title: Quote Form pulls data but does not pass the information once submitted
has answer: http://stackoverflow.com/a/25044507
score: 0
has comment: http://stackoverflow.com/comment/38953945
has body: In my code below, I need the Date, Product Name and Product ID to not only get pulled when the quote button is pressed but also passed when the form is submitted. Currently the three do not get sent in the email when we receive it only the other fields appear. We need all of the information to appear. They show up when you press the Get A Quote button and the form shows up, but when the user submits the form the first three do not get passed. If anyone has any idea or can help me out it would be greatly appreciated. Thank You. -GET A QUOTE- For Help, Please Call IMPORTANT! Please Read Before Continuing Get-A-Quote is for quoting one individual item only. If you would like a quote for more than one item at a time, please click Add to Cart for each individual item. Then when you are ready to submit your quote request, click "Checkout" in your cart window. Date: Product Name: Product ID: Quantity: * Full Name: * Title * Facility Name * Facility Description: Please Select Commercial Real Estate Education Healthcare Club/Entertainment Government GSA Food Service Contractor Industry Reseller Shipping Address: State / Province: Please Select Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming Alberta British Columbia Manitoba New Brunswick Newfoundland Northwest Territories Nova Scotia Nunavut Ontario Prince Edward Island Quebec Saskatchewan Yukon Country: United States of America Canada Zip Code: Phone: * Fax: Email: * Taxable?: Yes No Have You Previously Purchased from Us?: * Yes No Special Instructions: Comments/Questions: $(Verification…
tagged with: http://stackoverflow.com/tag/html
tagged with: submit
type: UnansweredQuestion
tagged with: forms

http://stackoverflow.com/q/25069040
score: -1
has comment: http://stackoverflow.com/comment/39001414
has answer: http://stackoverflow.com/a/25069191
accepted answer: http://stackoverflow.com/a/25069191
answer count: 2
has body: On Chrome, the script page loads. On Firefox it does not. I have an &lt;a href="javascript:func(data);"&gt; &lt;a&gt; on rows of a table. On click, the function insert html. Developing on Chrome, everything works. I tried it on Firefox, it does not load. function func(data) { $("#div").load("../url/some.html") $('html, body').animate({scrollTop: 0}, 200); return false; }
upvote count: 0
tagged with: firefox
tagged with: jquery
has title: Firefox javascript error with page load
has comment: http://stackoverflow.com/comment/39000981
favorite count: 0
possible better answer: http://stackoverflow.com/a/25069209
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/39000922
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39001142
tagged with: google-chrome
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/39000915
has answer: http://stackoverflow.com/a/25069209
tagged with: javascript

http://stackoverflow.com/q/24970324
has comment: http://stackoverflow.com/comment/38814384
has title: when an element clicked another element(object) sends to function
type: Question
has comment: http://stackoverflow.com/comment/38814342
has answer: http://stackoverflow.com/a/24970481
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38814493
has answer: http://stackoverflow.com/a/24970432
has answer: http://stackoverflow.com/a/24970506
has answer: http://stackoverflow.com/a/24970591
has comment: http://stackoverflow.com/comment/38814524
has body: Assume we have these two elements: item1 item2 I want to get object of 'item2' instead of 'item1' in "myFunction()", something like this: function myFunction() { changeObjects('item2Id'); // clearly this is what I want console.log(this.innerHTML); } output:item2 Note! I know this work can do bye something like document.getElementById or document.getElementsByClassName, but I exactly want to get current object. excuse me for my poor english language. thanks alot.
answer count: 5
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24970553

http://stackoverflow.com/q/25065954
type: AnsweredQuestion
has body: I am building an iOS app using the wonderful RubyMotion framework and ProMotion gem stack. I want to display a chart in a PM::WebScreen on my iPhone. I reference an HTML file in the content method, and have (1) the HTML file, (2) my custom JS methods file, (3) my JS chart library (HighCharts), and (4) jQuery in my resources folder. All this renders fine. I am able to create the data array for the chart in my PM::WebScreen file (I get the data from an API call to an external source.) The chart renders fine with static data typed in. The Problem I want to pass my the data array to my custom JS file to get it to draw the chart with dynamic data. How can I do that? I would prefer not to make an ajax call from my JS because I may want to use that array elsewhere in my RubyMotion/ProMotion code. If I can pass the data to the HTML file, I suppose I could extract it to JS from there using jQuery. Please advise. Thanks!
upvote count: 1
type: Question
tagged with: rubymotion-promotion
accepted answer: http://stackoverflow.com/a/25095427
linked to: http://stackoverflow.com/q/7375456
tagged with: highcharts
downvote count: 0
tagged with: javascript
tagged with: rubymotion
has title: Pass data to Javascript from ProMotion WebScreen
answer count: 1
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/39010981
has answer: http://stackoverflow.com/a/25095427

http://stackoverflow.com/comment/38860523
score: 0
type: Comment
type: QuestionComment
has text: did you created object of Screenshot where you using navigator.screenshot.save ?
comment on: http://stackoverflow.com/q/24994824

http://stackoverflow.com/comment/38793337
type: Comment
has text: What is the content of what you are trying to parse? Can you check what it looks like? e.g. add `alert(JSON.stringify(list_to_book_for))`
comment on: http://stackoverflow.com/a/24954236
type: AnswerComment
score: 0

http://stackoverflow.com/a/25025149
downvote count: 0
has comment: http://stackoverflow.com/comment/38927887
score: 12
accepted answer of: http://stackoverflow.com/q/25023211
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25023211
type: Answer
has body: Move the call to audio.play() outside the "canplay" event listener. To play audio/video on mobile devices you need direct, physical and synchronous interaction from the user. You nailed the first two, but when you put that audio.play() inside the event listener you break the synchronous requirement. // BEFORE audio.addEventListener('canplay', function() { audio.play(); }); // AFTER audio.play();
upvote count: 12

http://stackoverflow.com/a/25040465
score: 1
has comment: http://stackoverflow.com/comment/38949144
has comment: http://stackoverflow.com/comment/38947867
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25030985
has body: You can achieve this using jquery.cookie plugin: $('#table th').each(function ($index, $elem) { var $cookie = $.cookie(this.id.toLowerCase() + ".shown"); $index = $index + 1; $('#table th:nth-child(' + $index + '), #table td:nth-child(' + $index + ')').css('display', (typeof ($cookie) === "undefined" || $cookie === "true") ? "" : "none"); }); $('#edit').click(function () { var headers = $('#table th').map(function () { var th = $(this); var $cookie = $.cookie(th[0].id + ".shown"); return { text: th.text(), shown: th.css('display') != "none" }; }); var h = [' Done ']; $.each(headers, function () { var $shown = this.shown; h.push(' ', this.text, ' '); }); h.push(' '); $('body').append(h.join('')); $('#done').click(function () { var showHeaders = $('#tableEditor input').map(function () { return this.checked; }); $.each(showHeaders, function (i, show) { var cssIndex = i + 1; var tags = $('#table th:nth-child(' + cssIndex + '), #table td:nth-child(' + cssIndex + ')'); var $id = $('#table th:nth-child(' + cssIndex + ')')[0].id; if (show) { $.cookie($id + ".shown", "true"); tags.show(); } else { $.cookie($id + ".shown", "false"); tags.hide(); } }); $('#tableEditor').remove(); return false; }); return false; }); Updated fiddle
answers question: http://stackoverflow.com/q/25030985
type: Answer
downvote count: 0

http://stackoverflow.com/q/25038029
has answer: http://stackoverflow.com/a/25038172
tagged with: regex
has body: I am using zurb foundation and I would like avoid to submit answer consist only with empty spaces. how can I write pattern that will allow all letters, numbers, spaces and signs (, ; . !) but will not pass empty string f.r " " this one is ok but works only for one word:
score: 0
answer count: 1
has title: pattern for regular expression that will eliminate empty string
tagged with: javascript
type: UnansweredQuestion
tagged with: zurb-foundation
type: Question

http://stackoverflow.com/comment/38965725
has text: @PatrickEvans Yeah, I tried both the "leave" and "stay" options, and I'm also on Chrome, but I'm only ever warned once
comment on: http://stackoverflow.com/q/25050530
score: 0
type: Comment
type: QuestionComment

d3.js
tags question: http://stackoverflow.com/q/24934331
tags question: http://stackoverflow.com/q/25053532
tags question: http://stackoverflow.com/q/24946789
tags question: http://stackoverflow.com/q/25015262
tags question: http://stackoverflow.com/q/25047562
tags question: http://stackoverflow.com/q/24995577
tags question: http://stackoverflow.com/q/25053905
tags question: http://stackoverflow.com/q/25056493
tags question: http://stackoverflow.com/q/25061186
tags question: http://stackoverflow.com/q/25059078
tags question: http://stackoverflow.com/q/24945696
tags question: http://stackoverflow.com/q/25049168
tags question: http://stackoverflow.com/q/25001354
tags question: http://stackoverflow.com/q/24922238
tags question: http://stackoverflow.com/q/24997800
tags question: http://stackoverflow.com/q/25062902
tags question: http://stackoverflow.com/q/24976114
tags question: http://stackoverflow.com/q/24982551
tags question: http://stackoverflow.com/q/25037780
tags question: http://stackoverflow.com/q/24959867
tags question: http://stackoverflow.com/q/24959093
tags question: http://stackoverflow.com/q/24918221
tags question: http://stackoverflow.com/q/24953914
tags question: http://stackoverflow.com/q/25047791
tags question: http://stackoverflow.com/q/25024015
tags question: http://stackoverflow.com/q/25041829
tags question: http://stackoverflow.com/q/25032053
tags question: http://stackoverflow.com/q/25039941
tags question: http://stackoverflow.com/q/24972066
tags question: http://stackoverflow.com/q/25016021
tags question: http://stackoverflow.com/q/25007461
tags question: http://stackoverflow.com/q/25026010
type: Tag
tags question: http://stackoverflow.com/q/24930335
tags question: http://stackoverflow.com/q/24925461
tags question: http://stackoverflow.com/q/25020601
tags question: http://stackoverflow.com/q/24935058
tags question: http://stackoverflow.com/q/25062223
tags question: http://stackoverflow.com/q/24998682
tags question: http://stackoverflow.com/q/25020829
tags question: http://stackoverflow.com/q/25049389
tags question: http://stackoverflow.com/q/24996731
tags question: http://stackoverflow.com/q/24942908
tags question: http://stackoverflow.com/q/25023221
tags question: http://stackoverflow.com/q/25021715
tags question: http://stackoverflow.com/q/24970479
tags question: http://stackoverflow.com/q/25006917
tags question: http://stackoverflow.com/q/24915507
tags question: http://stackoverflow.com/q/25036054
tags question: http://stackoverflow.com/q/25007543
tags question: http://stackoverflow.com/q/24982898
tags question: http://stackoverflow.com/q/24986332
tags question: http://stackoverflow.com/q/25054565
tags question: http://stackoverflow.com/q/25041079
tags question: http://stackoverflow.com/q/24922912
tags question: http://stackoverflow.com/q/25060741
tags question: http://stackoverflow.com/q/24964746
tags question: http://stackoverflow.com/q/24953359
tag name: d3.js
tags question: http://stackoverflow.com/q/24911834
tags question: http://stackoverflow.com/q/25048798
tags question: http://stackoverflow.com/q/24968418
tags question: http://stackoverflow.com/q/25007466
tags question: http://stackoverflow.com/q/24988541
tags question: http://stackoverflow.com/q/25065896
tags question: http://stackoverflow.com/q/25004690
tags question: http://stackoverflow.com/q/24940885
tags question: http://stackoverflow.com/q/25064639
tags question: http://stackoverflow.com/q/25044997
tags question: http://stackoverflow.com/q/24966821
tags question: http://stackoverflow.com/q/25050011
tags question: http://stackoverflow.com/q/25029006
tags question: http://stackoverflow.com/q/25037528
tags question: http://stackoverflow.com/q/24913599
tags question: http://stackoverflow.com/q/24951042
tags question: http://stackoverflow.com/q/25044145
tags question: http://stackoverflow.com/q/25025008
tags question: http://stackoverflow.com/q/25061899
tags question: http://stackoverflow.com/q/25061579
tags question: http://stackoverflow.com/q/25059979

http://stackoverflow.com/comment/38915454
type: QuestionComment
comment on: http://stackoverflow.com/q/25023507
has text: Would live event handlers work here? Then only one event would need registered with the browser.
score: 0
type: Comment

http://stackoverflow.com/a/25013191
upvote count: 2
answers question: http://stackoverflow.com/q/25012955
has body: If I understand you well and you want to trow an error with custom message, you can use class Error like this: throw new Error("Authentication not found"); But I am not sure if this is what you want to do.
type: AcceptedAnswer
type: Answer
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38895601
accepted answer of: http://stackoverflow.com/q/25012955
has comment: http://stackoverflow.com/comment/38895586

http://stackoverflow.com/comment/38932528
score: 0
comment on: http://stackoverflow.com/q/25032972
has text: @i'mPosSible I think that wont work
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38924556
comment on: http://stackoverflow.com/q/25028643
type: Comment
type: QuestionComment
score: 1
has text: Please include some actual content describing the question. Examples of username input that is failing that you would expect to succeed would be a good start

http://stackoverflow.com/comment/38950794
has text: I'm having no problems.. http://codepen.io/pattmorter/pen/vueAm
comment on: http://stackoverflow.com/q/25042697
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38966832
type: Comment
has text: Thanks buddy, it was just silly of me to understand that thing.. Took me 2 hours trying to find the issue.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25051153

http://stackoverflow.com/comment/38705739
comment on: http://stackoverflow.com/a/24912127
has text: @mles How does it not answer your question? Don't do what you are doing and do this. No problem. If I had to answer "why do I not fall off the end of a flat earth" with something that related to a flat earth rather than an alternative, then the world would never get anywhere. "Answers" are things that actually work.
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/38812452
comment on: http://stackoverflow.com/a/24968855
has text: BelthazorNv thanks for your edit. But as per my understanding, even if there was something wrong with the delete.php page, it would still give alert ("Inside Method") atleaset.. But it isn't giving it.. means itsn't being called in the first place..
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38771523
score: 0
type: AnswerComment
has text: Yes,when I want to rechoose the upper box to "Valj Stad/Ort", I can't find that. So I think that will be problem. Changes from two boxes is really nice. But If u want "Valj Butik", u must create "Valj Stad/Ort" for that and must choose.
type: Comment
comment on: http://stackoverflow.com/a/24947022

http://stackoverflow.com/a/24912457
answers question: http://stackoverflow.com/q/24911447
type: Answer
has comment: http://stackoverflow.com/comment/40981408
score: 14
upvote count: 14
has comment: http://stackoverflow.com/comment/38972912
has body: It was reported apparently on the plugin's github repo - https://github.com/OwlFonk/OwlCarousel/issues/346 Simply using this version of the plugin (pull-request) fixed it.
accepted answer of: http://stackoverflow.com/q/24911447
has comment: http://stackoverflow.com/comment/40982453
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25010771
tagged with: jquery
duplicate of: http://stackoverflow.com/q/23740548
favorite count: 0
has comment: http://stackoverflow.com/comment/38891099
has comment: http://stackoverflow.com/comment/38890650
linked to: http://stackoverflow.com/q/25008625
has comment: http://stackoverflow.com/comment/38891009
has comment: http://stackoverflow.com/comment/38890867
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38890489
tagged with: php
has body: I want to pass value of a variable from PHP file to use it as an argument into JavaScript function. E.g: PHP: $passed = "passed"; $failed = "failed"; $name = $_POST['name']; if($name == "lekz"){ echo $passed; // this variable will pass to js file } else{ echo $failed; // this variable will pass to js file } JS: function trace(){ var con = "passed" if($passed == con){ alert("passed"); } else{ alert("failed"); } } In what way can I pass variables from PHP into JS function?
type: Question
has comment: http://stackoverflow.com/comment/38890629
score: 0
linked to: http://stackoverflow.com/q/23740548
has title: Simple passing of value of a variable from PHP file to JavaScript function
has comment: http://stackoverflow.com/comment/38890651
upvote count: 1
downvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/38909239
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25020413
has text: @RubenSerrate, I like your method. But it's still not work. Thank you.
score: 0

http://stackoverflow.com/comment/38988128
comment on: http://stackoverflow.com/q/25062223
score: 0
has text: What happens if you change `.attr('width', '100%')` to `.attr('width', width)` and do the same for the height? Is the scaling still different?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24960632
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24960336
type: Answer
has body: AngularJS is used for designing single page applications. So once your application is loaded, the page won't get refreshed and all the server communication is done async using angular's feature $http. If you want to submit any form, you can use $http like this HTML: &lt;form ng-submit="sub()"&gt; ... &lt;/form&gt; Then in your controller: function ctrl($scope) { $scope.sub = function() { $http.post(url,data,headers) .success(function(data,status,headers,config) { //do something with data (response) }) } }
upvote count: 1

http://stackoverflow.com/a/25030241
type: Answer
has body: marquee:hover { -moz-binding: none; } Try this. But the purpose of -moz-binding is different. But it works. Refer this for Webkit Reference: SO
has comment: http://stackoverflow.com/comment/38927245
has comment: http://stackoverflow.com/comment/38927727
score: 0
answers question: http://stackoverflow.com/q/25030207

http://stackoverflow.com/comment/44398504
comment on: http://stackoverflow.com/a/25095250
type: AnswerComment
has text: @MarcoBonelli I am talking about a specific case of local files on Chrome where `dataTransfer.files` is available at the client side on drag events. That has nothing to contradict your statement
type: Comment
score: 0

http://stackoverflow.com/q/24992069
has answer: http://stackoverflow.com/a/28204991
has title: ace editor - use extra themes, customize themes
type: Question
score: 9
upvote count: 9
tagged with: javascript
tagged with: themes
answer count: 3
downvote count: 0
has answer: http://stackoverflow.com/a/50349218
favorite count: 0
has body: Is possible to customize ace editor themes in some way or use some extra external themes? I've not found informations about that.. I hope there is a way to do it.. Here a basic demo for tests with a predefined theme
tagged with: ace-editor
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25002872

http://stackoverflow.com/comment/38982833
has text: This maybe call the post function with the `amount` undefined.
comment on: http://stackoverflow.com/a/25059783
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/24984889
answer count: 2
upvote count: 0
tagged with: javascript
tagged with: date
has comment: http://stackoverflow.com/comment/38841869
accepted answer: http://stackoverflow.com/a/24985020
favorite count: 0
downvote count: 2
has body: Is there a simple way to display the name of the day of the week of tomorrow? So far I have been able to do this in PHP (See below) and for today in Javascript but I am having trouble with tomorrow? Javascript for Today var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; var today = new Date(); document.write(days[today.getDay()]); PHP Version echo date("l", strtotime("+1 days")) Is there a simple way to do this? I have seen a lot of stack overflow questions about this but they all seem very unreliable and complicated!
score: -2
tagged with: php
possible better answer: http://stackoverflow.com/a/24984954
type: AnsweredQuestion
has title: Displaying the name of tomorrow (ie. Monday)
has answer: http://stackoverflow.com/a/24984954
has answer: http://stackoverflow.com/a/24985020
has comment: http://stackoverflow.com/comment/38841893
type: Question

http://stackoverflow.com/q/24985467
tagged with: node.js
answer count: 0
has title: express 4 setup static from required module fails
type: Question
has comment: http://stackoverflow.com/comment/38854285
tagged with: javascript
tagged with: express
score: 0
has comment: http://stackoverflow.com/comment/38845335
has body: I have an odd error, I had the app working fine, but then as the app.js was getting pretty bloated so we split out certain logic to other files and for some reason the static file handler now seems to stop routes working. Error: Forbidden at SendStream.error (C:\Code\Web\testing\_packages\node_modules\express\node_modules\send\lib\send.js:228:16) at SendStream.pipe (C:\Code\Web\testing\_packages\node_modules\express\node_modules\send\lib\send.js:413:19) at staticMiddleware (C:\Code\Web\testing\_packages\node_modules\express\node_modules\serve-static\index.js:92:12) at Layer.handle [as handle_request] (C:\Code\Web\testing\_packages\node_modules\express\lib\router\layer.js:76:5) at trim_prefix (C:\Code\Web\testing\_packages\node_modules\express\lib\router\index.js:263:13) at C:\Code\Web\testing\_packages\node_modules\express\lib\router\index.js:230:9 at Function.proto.process_params (C:\Code\Web\testing\_packages\node_modules\express\lib\router\index.js:305:12) at C:\Code\Web\testing\_packages\node_modules\express\lib\router\index.js:221:12 at Function.match_layer (C:\Code\Web\testing\_packages\node_modules\express\lib\router\index.js:288:3) at next (C:\Code\Web\testing\_packages\node_modules\express\lib\router\index.js:182:10) There is the error, the app file used to call: app.use(express.static("{0}/public".format(__dirname))); However now because its loaded from another file we have done app.set("rootdir", __dirname) in the app.js file then in the other module we do: app.use(express.static("{0}/public".format(app.get("rootdir")))); Everything runs fine but when I load up a route it blows up with the error, whereas it used to work. I have done console.log to confirm the rootdir and it is fine, also have done the same thing in app.js and it is EXACTLY the same. So is there any known issues around this?
type: UnansweredQuestion

http://stackoverflow.com/comment/62152589
score: 0
comment on: http://stackoverflow.com/a/25045902
type: AnswerComment
has text: How should this be used in a CasperJS script? When I insert this code in the beginning, the script ends with no error message and does nothing.
type: Comment

http://stackoverflow.com/comment/38896632
type: QuestionComment
comment on: http://stackoverflow.com/q/25013763
score: 0
has text: What date format is that?
type: Comment

http://stackoverflow.com/comment/38744903
type: Comment
comment on: http://stackoverflow.com/a/24933220
type: AnswerComment
has text: It is not possible to use sections in a partial view, I updated my answer.
score: 0

http://stackoverflow.com/a/25042993
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25042890
has body: Right now, you are looping through, and printing out the number you are currently on (0, then 1). You need to get the image from your array instead. Also, as a note, you don't need the second increment at the bottom of your loop; your for-loop is handling it. Here is it rewritten: var images = ["cheese", "lego"]; function reggie() { for (var i=0; i&lt;images.length; i++) { $('.port2').prepend("&lt;img class='cheese hover' src='images/editorial-" + images[i] + ".png'/&gt;"); } }
has comment: http://stackoverflow.com/comment/38951688
has comment: http://stackoverflow.com/comment/38951638
has comment: http://stackoverflow.com/comment/38951352
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25042890

http://stackoverflow.com/q/24928970
tagged with: jquery
has body: Hi i am submitting my Codeignitor form to controller. Submitted data contain inline javascript with html code which i want to save into the database. But when i check the code after submitting then i realize that inline javascript is not there with the html code. e.g Click Me!here is a paragraph again! after submitting it becomes like, Click Me!here is a paragraph again! i am using codeigniter standard method to post a form like <?php $attributes = array('target' => '_blank', 'enctype' => 'multipart/form-data'); echo form_open('controller/method',$attributes); ?> One more thing when i disable X-XS-Protection then it is working fine but i think it is a security issue. Any help would be very appreciative
has title: Codeigniter Form Does Not Post Inline Javascript to Controller
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
tagged with: php
answer count: 0
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/38736742
has comment: http://stackoverflow.com/comment/38736590
type: Question
has comment: http://stackoverflow.com/comment/38736545
has comment: http://stackoverflow.com/comment/38736643
tagged with: javascript

http://stackoverflow.com/q/25015524
type: Question
tagged with: javascript
score: -1
tagged with: date
linked to: http://stackoverflow.com/q/10123953
upvote count: 0
duplicate of: http://stackoverflow.com/q/10123953
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/42099752
has answer: http://stackoverflow.com/a/25015825
has title: how to sort json data by date
has body: i want to sort my json response by date ,here is the javascript function function successCallback(responseObj){ $.each(responseObj.allRecom.recom,function(index){ var data=JSON.stringify(responseObj); //contains json response alert(responseObj.allRecom.recom[index].recomDate);//it contains date value from response. var date=new Date(responseObj.allRecom.recom[index].recomDate); date=date.toLocaleString(); //converted to local date string }); } now what i want is whatever the response will be come ,it should be sorted by date.thanks
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 1

http://stackoverflow.com/q/25053605
tagged with: javascript
tagged with: jquery
score: 6
favorite count: 0
accepted answer: http://stackoverflow.com/a/25053770
has answer: http://stackoverflow.com/a/25053693
tagged with: regex
upvote count: 6
answer count: 4
has answer: http://stackoverflow.com/a/25053929
has comment: http://stackoverflow.com/comment/38971713
has title: Regex to allow only a single dot in a textbox
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38971402
possible better answer: http://stackoverflow.com/a/25053705
has answer: http://stackoverflow.com/a/25053770
has answer: http://stackoverflow.com/a/25053705
has body: I have one text input. I wrote a regex for masking all special characters except . and -. Now if by mistake the user enters two . (dots) in input, then with the current regex var valueTest='225..36' valueTest.match(/[^-.\d]/) I expected that the number will not pass this condition How to handle this case. I just want one . (dot) in input field since it is a number.
type: Question
downvote count: 0

http://stackoverflow.com/comment/38831420
type: Comment
comment on: http://stackoverflow.com/a/24975114
has text: Created a Toogle element (similar to the one you have I presume), tested it and toogling seems to be working fine. I'd suggest to try out HTML code directly instead of using Response.Write (using the onclick code on my initial answer). If that doesn't work either try to move the lines of code which give you trouble in a new file with no excess code. Since it works for me, it should work for you too.
type: AnswerComment
score: 0

http://stackoverflow.com/a/24913280
has comment: http://stackoverflow.com/comment/38707475
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38707257
has comment: http://stackoverflow.com/comment/38708030
answers question: http://stackoverflow.com/q/24912996
type: Answer
has body: You can do more smart with for cicle, see DEMO. var $target = $('#menu span:first span'); for(var i = 0; i != $target.length; ++i) { $target.eq(i).delay(100 * (i + 1)).animate({opacity: '1'},400); } edit After your update, maybe you mean a stuff like this. more clean code, in my opinion.

http://stackoverflow.com/comment/38846833
type: Comment
comment on: http://stackoverflow.com/q/24987383
type: QuestionComment
has text: different controllers?
score: 0

http://stackoverflow.com/a/24995928
has comment: http://stackoverflow.com/comment/38895064
has body: Try using the onclick event for the submit button
score: 0
has comment: http://stackoverflow.com/comment/38870033
has comment: http://stackoverflow.com/comment/38864436
type: Answer
answers question: http://stackoverflow.com/q/24995054

http://stackoverflow.com/a/24934738
has comment: http://stackoverflow.com/comment/57801840
answers question: http://stackoverflow.com/q/24934523
upvote count: 18
downvote count: 0
has body: Try $.ajaxSetup({xhrFields: { withCredentials: true } }); in your $(document).ready(function() {...});
score: 18
has comment: http://stackoverflow.com/comment/38748365
has comment: http://stackoverflow.com/comment/38748268
type: Answer

http://stackoverflow.com/q/24916796
tagged with: ractivejs
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24965479
answer count: 1
has body: I have list of menu options, and each menu item has it's own Ractive instance with different template but same shared data. When each selection is changed I am calling teardown() on rendered view instance and render(domElement) on current selection's Ractive instance. An example Instance is like below, and all follow the same structure. var View = new Ractive({ template: '#contacts', data: { name: 'Contacts', contacts : dummyData // array data } }); And I render them like below var isRendered = false; channel.subscribe("menu", function(msg) { if(msg === "contacts") { contentHolder.innerHTML = ""; View.render(contentHolder); isRendered = true; } else { if(isRendered) { View.teardown(); isRendered = false; console.log(View.get('contacts')); // Here I can see the data. } } }); In first render() call view is rendered as expected, but after calling teardown(), again if I call render() it does not render contacts list data and only displays name property, but was rendered on initial call. Please help me to fix this.
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/24965479
has title: calling render() after teardown() does not display list data

http://stackoverflow.com/a/24926774
has body: Lots of answers, so one more won't hurt. Presumably you don't have control of the server, otherwise you'd just modify the href there and be done with it. A simple method is: &lt;a href="..." onclick="this.href+=this.textContent||this.innerText"&gt;...&lt;/a&gt; Using textContent or innerText means you can have markup in the content of the link and it won't be part of the href. A more general solution to modify just the links with "google.com" in the href is: function modifyLinks() { var link, links = document.links; var re = /google\.com/i; for (var i=0, iLen=links.length; i&lt;iLen; i++) { link = links[i]; if (re.test(link.href)) { link.href += link.textContent || link.innerText; } } } window.onload = modifyLinks; The test can be changed to anything, maybe you want to base it on className or some other property. If you want to modify all links, just remove the test.
answers question: http://stackoverflow.com/q/24926508
score: 0
type: Answer

http://stackoverflow.com/comment/38840235
score: 0
type: AnswerComment
has text: Mmm, that may be causing a trouble because I'm using to implement this to Tumblr, and you never know which one of posts it will be. Any solution to make it current function only in div that caption is?
comment on: http://stackoverflow.com/a/24983729
type: Comment

http://stackoverflow.com/a/31123307
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: What's certainly wrong here is this: socket.ondata = function (event) { var data = event.data; var lines = data.split('\r\n'); for (var i=0;i&lt;lines.length;i++) { if (lines[i].length&gt;0) console.log(lines[i]); } } You're setting the ondata method on an undefined object. Which means that any call to connect() later won't have any effect anyway. Also as you're defining a method of an undefined object, the method above probably is crashing. You should rewrite your code to something like this. window.addEventListener('DOMContentLoaded', function() { 'use strict'; var socket; var host = "someserver"; var port = 6667; //connect(); // when calling from here, connection works fine $(document).bind("pageshow", function(e) { if (typeof e.currentTarget.URL==="string") { var haystack = $.mobile.path.parseUrl(e.currentTarget.URL); var needle = /^#server/; if (haystack.hash.search(needle)!==-1) { connect(); // ...from here is failing } } }); function connect() { socket = navigator.mozTCPSocket.open(host, port); socket.ondata = onData; } function onData (event) { var data = event.data; var lines = data.split('\r\n'); for (var i=0;i&lt;lines.length;i++) { if (lines[i].length&gt;0) console.log(lines[i]); } } });
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24988658
score: 1
answers question: http://stackoverflow.com/q/24988658

http://stackoverflow.com/comment/38887926
type: Comment
has text: can you upload this so I can see?
comment on: http://stackoverflow.com/a/24992661
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38946067
has text: I have no idea where to look. function genericOnClick(info, tab) gives info about selection without coordinates and tab - all information about current tab. I google chrome API, but found nothing. I have an idea - to inject at the page js and get selection coordinates from there, but I think there should be more nice mechanism for it.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25040168

http://stackoverflow.com/q/25046354
favorite count: 0
has comment: http://stackoverflow.com/comment/38967005
has comment: http://stackoverflow.com/comment/38964290
tagged with: requirejs
upvote count: 1
has comment: http://stackoverflow.com/comment/38989195
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38989248
has title: Include require.js library in bundle or keep separate?
has answer: http://stackoverflow.com/a/25066193
accepted answer: http://stackoverflow.com/a/25066193
tagged with: amd
tagged with: gruntjs
type: Question
answer count: 2
has body: When combining AMD modules with RequireJS and the r.js optimizer, is it better to bundle the require.js library with your modules or keep it separate?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25063130
score: 0
has comment: http://stackoverflow.com/comment/38989304
has answer: http://stackoverflow.com/a/25063130

http://stackoverflow.com/q/24916342
has comment: http://stackoverflow.com/comment/38713417
score: 1
has body: I am trying to call a function when I mousever a radio button. The function never gets called. The first of my two radio buttons below show my latest attempt. Door Trim Roof Siding Stone BB EDIT: Here are my JS functions. I put an alert to notify me if I made it into the function. function mouseOver(a) { alert(a) document.getElementById(a).style.visibility = 'visible'; } function mouseOff(a) { alert(a); document.getElementById(a).style.visibility = 'hidden'; }
has comment: http://stackoverflow.com/comment/38713287
has comment: http://stackoverflow.com/comment/38713203
has comment: http://stackoverflow.com/comment/38713234
answer count: 2
has answer: http://stackoverflow.com/a/24916571
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38713231
has answer: http://stackoverflow.com/a/24916701
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24916701
has comment: http://stackoverflow.com/comment/38713376
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24916571
upvote count: 1
has title: Trying to get a mouseover event when over a radio button
type: Question

http://stackoverflow.com/q/24915618
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24915761
score: 1
type: Question
possible better answer: http://stackoverflow.com/a/24915676
has answer: http://stackoverflow.com/a/24915676
tagged with: javascript
has answer: http://stackoverflow.com/a/24915845
answer count: 3
downvote count: 0
has title: avoiding callback hell losing variable scope
favorite count: 0
accepted answer: http://stackoverflow.com/a/24915845
upvote count: 1
has body: I'm new to Node.js and I'm having problems trying to aboid callback hell. Now I'm developing an endpoitn to register users in a mongo database, the problem I'm facig is that I lose the acces to some variables if I modularize the function where they are used. The code: Working callback hell: var mongoose = require('mongoose'), dbserver = 'mongodb://localhost/', dbname = 'authdb'; mongoose.connect(dbserver + dbname); var db = mongoose.connection; db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function callback () { console.log('connectet to mongo db: ' + dbname); }) userModel = require('./user.js'); function singIn (req, res){ var email = req.body.email, name = req.body.name, secondName = req.body.secondName, pass = req.body.pass, bday = req.body.bday; var user = new userModel.user(); user.Email = email; user.Name = name; user.SecondName = secondName; user.Pass.Hash = pass; user.BirthDate = bday; db.model('user').find({Email : email},function (err,foundUsers){ if(!err &amp;&amp; foundUsers.length === 0){ user.save(function (err, users){ if(err){ console.log(err); res.send("Not inserted"); }else{ console.log(user); console.log('registered!'); res.send("OKish"); } }); }else{ console.log(err); console.log(foundUsers); res.send("Not inserted"); } }); }; exports.singIn = singIn; Not working modularized var mongoose = require('mongoose'), dbserver = 'mongodb://localhost/', dbname = 'authdb'; mongoose.connect(dbserver + dbname); var db = mongoose.connection; db.on('error', console.error.bind(console, 'connection error:')); db.once('open', function callback () { console.log('connectet to mongo db: ' + dbname); }) userModel = require('./user.js'); function singIn (req, res){ var email = req.body.email, name = req.body.name, secondName = req.body.secondName, pass = req.body.pass, bday = req.body.bday; var user = new userModel.user(); user.Email = email; user.Name = name; user.SecondName = secondName; user.Pass.Hash = pass; user.BirthDate = bda…
tagged with: node.js

http://stackoverflow.com/q/25015148
accepted answer: http://stackoverflow.com/a/25015743
tagged with: internet-explorer
linked to: http://stackoverflow.com/q/3326650
tagged with: javascript
score: 0
answer count: 3
has body: I understand what this error mean, and why it happens. The question is how to find code, that causes the error. Enabling dev tools (f12) adds console variable, and no error is shown Javascript debugging is enabled in browser, but still IE doenst offer to debug the error. Are there any ideas how to find a place where console is missing and used?
has answer: http://stackoverflow.com/a/25015236
tagged with: console
has answer: http://stackoverflow.com/a/25016511
possible better answer: http://stackoverflow.com/a/25015236
has answer: http://stackoverflow.com/a/25015743
has title: IE 9 console is undefined
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/38877294
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25003618
has text: ... if you don't, then `ribbonMenu` will be a global variable, and therefore shared across all iterations.
score: 1

http://stackoverflow.com/comment/38991103
score: 0
comment on: http://stackoverflow.com/q/25063664
type: QuestionComment
has text: @adeneo: even if, later, I have to loop through all the elements of the object? having them undefined mean looping more, right?
type: Comment

http://stackoverflow.com/comment/38839500
comment on: http://stackoverflow.com/a/24982291
has text: @Meysam: No worries. :-)
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38955631
comment on: http://stackoverflow.com/q/25045131
score: 1
type: Comment
type: QuestionComment
has text: I take it you're asking if the object is passed by value or reference?

http://stackoverflow.com/q/24969790
has comment: http://stackoverflow.com/comment/38813405
tagged with: javascript
answer count: 2
upvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/24969898
has title: How do I use a function from one js file inside another js file?
favorite count: 0
has comment: http://stackoverflow.com/comment/38813347
has body: I have two js files in a structure that can be simplified to this: js1: $(function() { function f1 { f2(); } }); js2: $(function() { function f2() { } }); Do i have to declare all my functions in js2 in a global object to do this or is there an easier way? I'm currently getting Uncaught reference error because js1 can't find js2's function. Both script files are included in the page header.
type: UnansweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/38813501
has answer: http://stackoverflow.com/a/24969812
downvote count: 1
type: Question

http://stackoverflow.com/comment/38963026
type: Comment
type: AnswerComment
has text: Mind commenting on the downvote? Does this not answer the question? It's not like I ripped off the tutorial, I linked it
comment on: http://stackoverflow.com/a/25048979
score: 0

http://stackoverflow.com/comment/38960443
score: 0
type: Comment
type: QuestionComment
has text: [Learn how to debug JavaScript](http://www.creativebloq.com/javascript/javascript-debugging-beginners-3122820) and [read a JavaScript tutorial](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Functions).
comment on: http://stackoverflow.com/q/25047126

http://stackoverflow.com/a/24968254
type: AcceptedAnswer
score: 0
type: Answer
has body: Since you using jquery, why not make a click event rather than having onclick inline event, something like this, $(document).on('click','#offlineId',function(){ if ((typeof color !== undefined)&amp;&amp;(typeof size === undefined)) { $("#offlinecart").show(); $("#offlinecart").load('addoffline.php?orderno='+orderno+'pcode='+pcode); alert(" Product successfully added."); } else if ((typeof color !== undefined)&amp;&amp;(typeof size === undefined)) { $("#offlinecart").show(); $("#offlinecart").load('addoffline.php?orderno='+orderno+'pcode='+pcode+'color='+color); alert(" Product successfully added."); } else if ((typeof color === undefined)&amp;&amp;(typeof size !== undefined)) { $("#offlinecart").show(); $("#offlinecart").load('addoffline.php?orderno='+orderno+'pcode='+pcode+'size='+size); alert(" Product successfully added."); } else if ((typeof color !== undefined)&amp;&amp;(typeof size !== undefined)) { $("#offlinecart").show(); $("#offlinecart").load('addoffline.php?orderno='+orderno+'pcode='+pcode+'color='+color+'size='+size); alert(" Product successfully added."); }});
answers question: http://stackoverflow.com/q/24967941
accepted answer of: http://stackoverflow.com/q/24967941

http://stackoverflow.com/comment/38713519
type: AnswerComment
type: Comment
has text: give them a class "Gender" and then do $('.Gender[value='+result.gender+']').prop('checked', true);
comment on: http://stackoverflow.com/a/24916480
score: 0

http://stackoverflow.com/comment/38903118
has text: The goal is to understand what is the state of the art in client side encryption, not simply to get some opinions. Thanks for your feedback.
score: 0
comment on: http://stackoverflow.com/q/25017117
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24986020
has comment: http://stackoverflow.com/comment/38844073
favorite count: 0
has comment: http://stackoverflow.com/comment/38844085
has comment: http://stackoverflow.com/comment/38844115
has comment: http://stackoverflow.com/comment/38844197
has body: For word games, it is often the frequency of letters in English vocabulary, regardless of word frequency, which is of more interest. 1. &gt;E 11.1607% 56.88 M 3.0129% 15.36 2. A 8.4966% 43.31 H 3.0034% 15.31 3. R 7.5809% 38.64 G 2.4705% 12.59 4. I 7.5448% 38.45 B 2.0720% 10.56 5. O 7.1635% 36.51 F 1.8121% 9.24 6. T 6.9509% 35.43 Y 1.7779% 9.06 7. N 6.6544% 33.92 W 1.2899% 6.57 8. S 5.7351% 29.23 K 1.1016% 5.61 9. L 5.4893% 27.98 V 1.0074% 5.13 10. C 4.5388% 23.13 X 0.2902% 1.48 11. U 3.6308% 18.51 Z 0.2722% 1.39 12. D 3.3844% 17.25 J 0.1965% 1.00 13. P 3.1671% 16.14 Q 0.1962% (1) &lt;- The third column represents proportions, taking the least common letter (q) as equal to 1. The letter E is over 56 times more common than Q in forming individual English words. How is it possible to build an algorithm is javascript such that if I generate say 100 letters, 11-12% of then i.e. 11-12 letters will be E and so on.
has comment: http://stackoverflow.com/comment/38844088
has answer: http://stackoverflow.com/a/24986401
downvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/38844111
type: AnsweredQuestion
tagged with: algorithm
has comment: http://stackoverflow.com/comment/38844101
score: 1
accepted answer: http://stackoverflow.com/a/24986401
has comment: http://stackoverflow.com/comment/38844151
has title: Word Games in Javascript
upvote count: 4
has comment: http://stackoverflow.com/comment/38844134
has comment: http://stackoverflow.com/comment/38844098
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/25051053
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38966635
has answer: http://stackoverflow.com/a/25051792
has comment: http://stackoverflow.com/comment/38966633
has answer: http://stackoverflow.com/a/25051609
type: Question
has body: So i've been stuck with this problem for hours now... actually almost a day already. Please look at the jsfiddle I did for this problem So what I'm trying to achieve here is to change the image being shown when the arrows are clicked and selected. I wanted them to change into this but it's obviously not happening. Right now, the background image is showing but it's appearing at the back of the button. What I want is to show a new button/image that would appear or would cover the old button Here's the js $('.step_wrapper').on('click','.step_box',function () { $('.step_box').removeClass('selected'); $(this).addClass('selected') }); The HTML and the CSS, you can look at the fiddle :)
has comment: http://stackoverflow.com/comment/38966657
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38966647
has answer: http://stackoverflow.com/a/25051405
tagged with: http://stackoverflow.com/tag/html
answer count: 7
has answer: http://stackoverflow.com/a/25051138
accepted answer: http://stackoverflow.com/a/25051609
possible better answer: http://stackoverflow.com/a/25052088
has answer: http://stackoverflow.com/a/25051264
has answer: http://stackoverflow.com/a/25052088
has answer: http://stackoverflow.com/a/25051166
has comment: http://stackoverflow.com/comment/38967095
has comment: http://stackoverflow.com/comment/38966614
has title: Change div content with onclick
tagged with: css

http://stackoverflow.com/comment/38829646
has text: because of being client side, it seems it can be done! but I could not find anything by searching google!
type: QuestionComment
comment on: http://stackoverflow.com/q/24978441
score: 0
type: Comment

http://stackoverflow.com/comment/38972601
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25052478
score: 0
has text: @JerahmeelAcebuche sorry, that is invalid html ,The html tag should not inside any tag element , you have to use any other tags like ifrmae or some others

http://stackoverflow.com/comment/38989974
type: Comment
type: QuestionComment
has text: Is something like JSON.stringify(obj) alright? It's not formatted, but it will print all of the object's contents out.
comment on: http://stackoverflow.com/q/25063351
score: 0

youtube-javascript-api
type: Tag
tags question: http://stackoverflow.com/q/24997792
tag name: youtube-javascript-api
tags question: http://stackoverflow.com/q/24939094

http://stackoverflow.com/a/24942316
answers question: http://stackoverflow.com/q/24942248
has comment: http://stackoverflow.com/comment/38762558
type: Answer
has body: Here, at the end of your "while" loop: url : '' }, // &lt;--dangling comma ], Internet Explorer is particular harsh on those and will puke with a syntax error.
has comment: http://stackoverflow.com/comment/38762906
score: 0

http://stackoverflow.com/comment/38970057
has text: Updated my question. Sorry about the confusion.
comment on: http://stackoverflow.com/q/25052758
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38903853
comment on: http://stackoverflow.com/q/25016622
score: 0
type: Comment
type: QuestionComment
has text: I'm just wondering if there's a way to generate an element with HEX color values instead of RGB. Say I have a button that creates a table with the bg color #ff0000. When that button is clicked, the color values actually appearing in the innerHTML is RGB(255, 0, 0) and my designers can't simply copy and paste that into the email application because they need HEX values. Since HTML emails' styling is all done inline there could literally be hundreds of RGB values where it should be HEX. Is there no simple way to generate HTML code with HEX instead of converting to all RGB instances to HEX?

http://stackoverflow.com/comment/38948682
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25041190
has text: @IdanShechter do they have the same graphic drivers?

http://stackoverflow.com/a/24927557
type: Answer
answers question: http://stackoverflow.com/q/24926427
score: 0
has body: try this var string="SL45NU2154-60"; var string = string.split('-'); var len = string[1].length; initial = string[0].substr(-len); parseInt(initial); var fixedString = string[0].slice(0, string[0].length - len); var a= new Array(); for(var i=initial; i &lt;= parseInt(string[1]);i++){ a.push(fixedString+i); } console.log(a);

http://stackoverflow.com/comment/38936261
has text: Same thing. Still "ignores" the first change in sum up. And now it doesn't sum up in firefox and chrome, too.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25035138

http://stackoverflow.com/q/24993276
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/24993390
has answer: http://stackoverflow.com/a/24993406
favorite count: 0
tagged with: ajax
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/38857496
score: -1
has title: Capture onClick event in serverside php file using Ajax
accepted answer: http://stackoverflow.com/a/24993406
downvote count: 1
has answer: http://stackoverflow.com/a/24993378
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24993378
has body: I am very new to Ajax. My application uses ajax (and a server side php page called Req.php) to fetch records from a database, create table using those fetched records and display it. Now I want a column to be added having Delete option to it. May be something like this: echo ' Delete '; This deleteIt() method lies inside Req.php (server side) file like this: Now considering the fact that it is a server side file, and delete event happens at client side, what should be the procedure to capture this delete event so that it takes $rowID from the table made by server side php file and deletes the correponding record. Any help would be highly appreciated. And please let me know if there's insufficient information so that I can give more details.
answer count: 3

http://stackoverflow.com/comment/38969131
score: 0
type: QuestionComment
has text: where you can showcase your problem...you can even try jsfiddle
type: Comment
comment on: http://stackoverflow.com/q/25052379

http://stackoverflow.com/q/24985790
tagged with: javascript
tagged with: jquery
has title: Hammer.js TypeError: element is null, using inside $(document).ready:
tagged with: hammer.js
has answer: http://stackoverflow.com/a/24985864
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/42820941
type: Question
answer count: 2
has body: I'm trying to get the problem around this: using inside a block like this $(document).ready(function() { ... } ) a function for initialize Hammer.js, like so: var area = document.querySelector('#keyboard'); var hammertime = new Hammer(area); hammertime.on("pan", { /* options */ }, function(eventu) { console.log("pan"); }); hammertime.on("tap", { /* options */ }, function(eventu) { console.log("tap!"); }); When it is just called, this generates: TypeError: element is null and it links to this function inside hammer.js code: - element.addEventListener(type, handler, &gt; false); How should call correctly that? I'm really in stuck for this, jQuery ready seems not the right way... I tried also to move code inside a block like: window.addEventListener('load', function() { //here thecode above }, false); but I get same error. [edit] In all Hammer.js examples they use to work on DIVs element, here I'm trying doing this on li(st) ones, should be this related to my problem? I.e: &lt;ul id="keyboard"&gt; &lt;li id="first"&gt;...&lt;/li&gt; &lt;li id="second"&gt;...&lt;/li&gt; [...] &lt;/ul&gt; and then: var area = document.querySelector('#keyboard'); or (same problem): var area = document.querySelector('#first'); Any ideas? Thanks :-)

http://stackoverflow.com/comment/38968912
has text: The top part is what i'm looking for as far as hiding but I would also like to open a new window once the .regionContent is hidden
comment on: http://stackoverflow.com/a/25052278
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38861486
type: QuestionComment
score: 0
has text: if (shift is pressed) { someShiftFlag = true; } if (/ is pressed && someShiftFlag) { // ? is actually pressed }
comment on: http://stackoverflow.com/q/24995316
type: Comment

http://stackoverflow.com/q/25007543
answer count: 1
downvote count: 0
favorite count: 0
tagged with: d3.js
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/svg
has body: I'm trying to do something relatively simple. I'm trying to get the following working in D3: Draw an image as an SVG element in its natural width and height. Be able to click on this image to draw circles with D3. I'm stuck on how to draw the image as an SVG element. So far I have: content.append("image") .attr("xlink:href",this.store.image_url); But how can I get the natural width / height of this element?
has answer: http://stackoverflow.com/a/25009608
type: Question
tagged with: javascript
score: 4
upvote count: 4
has title: How can I get the natural width and height of an svg image element?

http://stackoverflow.com/a/25003899
has body: To share behavioral traits between otherwise unrelated classes, use mixins: Ext.define('MyApp.mixin.Foo', { foo: function(bar, baz) { alert(bar + ' ' + baz); } }); Ext.define('MyApp.class.Foo', { mixins: [ 'MyApp.mixin.Foo' ], methodThatCallsFoo: function(bar, baz) { this.foo(bar, baz); // foo method has been mixed in the } }); This applies to Ext JS 4.x+; bear in mind that in Ext JS 5 this mechanism became even more powerful, see Ext.Mixin doc.
answers question: http://stackoverflow.com/q/24996498
type: Answer
upvote count: 4
downvote count: 0
score: 4
has comment: http://stackoverflow.com/comment/38900351

http://stackoverflow.com/q/25042024
type: Question
has comment: http://stackoverflow.com/comment/38949476
has body: I have an object of objects and I want to iterate through the objects and show them in the browser; I have the following code, but it just shows me [object Object][object Object][object Object]; how can I show the actual objects? my my_obj looks like: { "User": { "description": "A user." }, "Media": { "description": "A media ." } } var output = ""; for (var key in my_obj) { output += my_obj[key]; } response.send(output); Thanks
possible better answer: http://stackoverflow.com/a/25042184
score: 12
has answer: http://stackoverflow.com/a/25042184
answer count: 2
has title: show the actual [object Object] in javascript
upvote count: 12
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38949529
has comment: http://stackoverflow.com/comment/38949374
has answer: http://stackoverflow.com/a/25042291
accepted answer: http://stackoverflow.com/a/25042291
tagged with: node.js
linked to: http://stackoverflow.com/q/957537
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38949536
duplicate of: http://stackoverflow.com/q/957537

http://stackoverflow.com/comment/38740998
type: Comment
type: QuestionComment
has text: Can't you just use a `div` or something with `contenteditable` attribute?
score: 1
comment on: http://stackoverflow.com/q/24931421

http://stackoverflow.com/a/24914743
upvote count: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24913835
has body: Using a simpler regex /\|(.*)/ var str = "http://www.yahoo.com/abc/123|X|Y|Z"; var aryMatches = str.match(/\|(.*)/); // aryMatches[1] will have your results regex explaination
score: 1

http://stackoverflow.com/comment/38717383
has text: @PM77-1 A basic loop - like forEach - doesn't allowed delayed iteration or lazy fetching.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24918390

http://stackoverflow.com/comment/38749943
type: Comment
comment on: http://stackoverflow.com/q/24930737
has text: `splice` isn't even being used here, except that `this.splice` is referring to `Array.prototype.splice` (but in a way which creates an empty array to do so.)
score: 0
type: QuestionComment

http://stackoverflow.com/comment/40759082
comment on: http://stackoverflow.com/a/25367910
type: Comment
has text: Only the strict compliance of this three advises made it work for me. Thanks a lot.
score: 4
type: AnswerComment

http://stackoverflow.com/a/24953001
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24940590
has body: i found a solution by switching btns on mouseenter but thanks for the help and idea's
answers question: http://stackoverflow.com/q/24940590
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/a/24986285
has comment: http://stackoverflow.com/comment/38845151
downvote count: 0
score: 1
has body: You'll have to keep track of were the mouse is, using the mousemove event and then check if the mouse is within the elements bounds once the fadeIn is done. http://jsfiddle.net/6xw8Z/5/ jQuery var mouseX = 0, mouseY = 0; setTimeout(function() { $('#kitty').fadeIn('slow', function() { var thisOffset = $(this).offset(), thisWidth = $(this).outerWidth(), thisHeight = $(this).outerHeight(); if(mouseX &gt;= thisOffset.left &amp;&amp; mouseX &lt;= (thisOffset.left + thisWidth) &amp;&amp; mouseY &gt;= thisOffset.top &amp;&amp; mouseY &lt;= (thisOffset.top + thisHeight)) { $(this).trigger('mouseenter'); } $('body').unbind('mousemove'); }); }, 3000); $('#kitty').mouseenter(function() { $(this).css({ 'transform': 'scale(1.5)', 'transition': 'transform 500ms' }); }).mouseleave(function() { $(this).css({ 'transform': 'scale(1)', 'transition': 'transform 500ms' }); }); $('body').mousemove(function(event) { mouseX = event.pageX; mouseY = event.pageY; }); Or if you wish the mouseenter to be triggered as soon as the fadeIn starts. http://jsfiddle.net/6xw8Z/6/ jQuery var mouseX = 0, mouseY = 0; setTimeout(function() { $('#kitty').fadeIn('slow'); var thisOffset = $('#kitty').offset(), thisWidth = $('#kitty').outerWidth(), thisHeight = $('#kitty').outerHeight(); if(mouseX &gt;= thisOffset.left &amp;&amp; mouseX &lt;= (thisOffset.left + thisWidth) &amp;&amp; mouseY &gt;= thisOffset.top &amp;&amp; mouseY &lt;= (thisOffset.top + thisHeight)) { $('#kitty').trigger('mouseenter'); } $('body').unbind('mousemove'); }, 3000); $('#kitty').mouseenter(function() { $(this).css({ 'transform': 'scale(1.5)', 'transition': 'transform 500ms' }); }).mouseleave(function() { $(this).css({ 'transform': 'scale(1)', 'transition': 'transform 500ms' }); }); $('body').mousemove(function(event) { mouseX = event.pageX; mouseY = event.pageY; });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24986197
upvote count: 1
answers question: http://stackoverflow.com/q/24986197
has comment: http://stackoverflow.com/comment/38845189
type: Answer

http://stackoverflow.com/comment/38793467
has text: You should have your developer console open while testing your code.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24959202

http://stackoverflow.com/comment/38766924
score: 0
comment on: http://stackoverflow.com/q/24944635
type: Comment
type: QuestionComment
has text: Did you define `fullscreen` before using it?

http://stackoverflow.com/comment/45306201
has text: Sadly, no. However, I did find this tip in the mongo documentation. Haven't tried it yet. It might work for canceling db ops: http://docs.mongodb.org/manual/reference/method/db.killOp/
type: Comment
comment on: http://stackoverflow.com/q/24944316
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38922531
type: Comment
comment on: http://stackoverflow.com/a/25027437
type: AnswerComment
has text: I'm making progress with that code, as the background's color changed when I put it in, however the sequence stopped to a halt and the page is the same every time I rotate it (images and all), any idea on what the problem may be?
score: 0

http://stackoverflow.com/a/24978509
answers question: http://stackoverflow.com/q/24978505
has comment: http://stackoverflow.com/comment/38830637
score: 6
type: Answer
has comment: http://stackoverflow.com/comment/38829922
has comment: http://stackoverflow.com/comment/39097815
upvote count: 7
has comment: http://stackoverflow.com/comment/38829843
downvote count: 1
has comment: http://stackoverflow.com/comment/38830083
has comment: http://stackoverflow.com/comment/38829804
has body: You probably need find() instead of filter as you need to get the descendant whereas filter "Reduce the set of matched elements to those that match the selector or pass the function's test" Live Demo $(result).find('#se2'); If the #se is added in DOM then you can directly use the id selector se = $('#se2'); I made another demo (as I am still waiting for your demo that is not working) to further elaborate how a string containing the html you have could be passed to jQuery function $() to search elements within it using find. Live Demo html = ' \ Enter name \ \ \ \ \ \ \ \ '; alert($(html).find('#se2').val()); Note You can further check the code working in the example above by using find wont work by using filter over this jsfiddle example

http://stackoverflow.com/a/54929156
upvote count: 1
score: 1
has body: @Jacob Raccuia to open a dynamic content lightbox you still need a DOM placeholder. jQuery(document).ready(function() { jQuery('#countit').on('click', function() { $popup = jQuery('#mylightbox'); $count = ' '; for (var n = 0; n < 100; n++) { $count += `${n} `; } $count += ' '; $popup.html($count); jQuery.featherlight($popup, {}); }); jQuery('#getit').on('click', function() { fetch('https://baconipsum.com/api/?type=all-meat&paras=2&start-with-lorem=1') .then(function(response) { return response.text(); }) .then(function(body) { $popup = jQuery('#mylightbox'); $popup.html(body); jQuery.featherlight($popup, {}); }); }); }); #mylightbox { display: none; } #mylightbox.featherlight-inner { display: block; } .numbers { width: 220px; } .numbers span { background: #fe0; border-radius: 50%; padding: 2px; margin: 2px; display: inline-block; } Get Bacon Count to 100
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24922427

http://stackoverflow.com/q/24947025
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38771293
has comment: http://stackoverflow.com/comment/38771858
has title: Trying to use Javascript/CSS to change a property, but can't get it to work within an if/else statement?
has comment: http://stackoverflow.com/comment/38771454
type: Question
has comment: http://stackoverflow.com/comment/38771514
has comment: http://stackoverflow.com/comment/38771166
score: 0
has comment: http://stackoverflow.com/comment/38771304
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38771975
has body: So you're my last hope. I need to create a quiz, that validates name and email. Once the name and email have been validated ONLY THEN will the quiz show up. Thing is, when I put my code of function changeStyle() { if (document.getElementById('quiz').style.display == "none") { document.getElementById('quiz').style.display = "block"; } else { document.getElementById('quiz').style.display = "none"; } } in, my if/else statement it doesn't work. Running this code outside of the if/else statement works, albeit simply on the click of a button. The alert in the if/else statement runs as well, as does the rest of script afterwards. It seems to be just ignoring this script. Here is the Jquery i'm using: $(document).ready(function() { $('#contact_name').on('input', function() { var input = $(this); var re = /^[A-Za-z0-9]+ [A-Za-z0-9]+$/; var is_name = re.test(input.val()); if (is_name) { input.removeClass("invalid").addClass("valid"); } else { input.removeClass("valid").addClass("invalid"); } }); $('#contact_email').on('input', function() { var input = $(this); var re = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; var is_email = re.test(input.val()); if (is_email) { input.removeClass("invalid").addClass("valid"); } else { input.removeClass("valid").addClass("invalid"); } }); $("#contact_submit button").click(function(event) { var form_data = $("#contact").serializeArray(); var error_free = true; for (var input in form_data) { var element = $("#contact_" + form_data[input]['name']); var valid = element.hasClass("valid"); var error_element = $("span", element.parent()); if (!valid) { error_element.removeClass("error").addClass("error_show"); error_free = false; } else { error_element.removeClass("error_show").addClass("error"); } } if (!error_free) { event.preventDefault(); } else { alert('This alert is working'); function changeStyle() { if (document.getElementById('quiz').style.display == "none") { document.getElementById('quiz').style.display = "blo…
has answer: http://stackoverflow.com/a/24947165
has comment: http://stackoverflow.com/comment/38771194
has comment: http://stackoverflow.com/comment/38771175
has comment: http://stackoverflow.com/comment/38771147
tagged with: css

http://stackoverflow.com/a/24916943
has body: Does instantiating it only if there is an image work? In that case, try this: var numberOfImages = $('.bxslidertwo li').length; if( numberOfImages &gt; 1 ) { var slider = $('.bxslidertwo').bxSlider({ pager: true, pagerType:'full', autoHidePager: true, }); }
type: Answer
score: 3
answers question: http://stackoverflow.com/q/24916850
upvote count: 3
has comment: http://stackoverflow.com/comment/38714725
downvote count: 0

http://stackoverflow.com/comment/38829922
comment on: http://stackoverflow.com/a/24978509
score: 0
type: Comment
has text: Thanx fr ur suggestion, i hv tried find() instead of filter bt still is not working the way i want.....i hv one que. that for finding any text in returned html , is there any need of event to be fired like onclick event or onkeyup....??
type: AnswerComment

http://stackoverflow.com/comment/38827965
comment on: http://stackoverflow.com/q/24977499
score: 0
type: Comment
type: QuestionComment
has text: @Derek朕會功夫 - You're splitting hairs; classes don't mean the same thing as they do in language like Java and C#. What would be an example of a valid "class" in Javascript?

http://stackoverflow.com/comment/38926212
comment on: http://stackoverflow.com/a/25028670
type: Comment
has text: It is because i don't know how to implement three function in the function o().
type: AnswerComment
score: 0

http://stackoverflow.com/q/24930628
has answer: http://stackoverflow.com/a/24930698
has body: I have some jquery which I want to run on load time but It doesn't seem to hit the load event. Here is my jquery $(function () { $('.field-of-work').load(function () { var $wrapper = $(this).closest('.field-of-work-wrapper'); $wrapper.find('.position').hide(); $wrapper.find('.position').find('select').val(''); }); }); Why would the load event not get hit?
has answer: http://stackoverflow.com/a/24930727
has comment: http://stackoverflow.com/comment/38739629
has comment: http://stackoverflow.com/comment/38739555
has comment: http://stackoverflow.com/comment/38739592
answer count: 4
has answer: http://stackoverflow.com/a/24930704
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38739590
has answer: http://stackoverflow.com/a/24930867
possible better answer: http://stackoverflow.com/a/24930704
has title: Jquery function is being called on load
type: Question
accepted answer: http://stackoverflow.com/a/24930698
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38739572

http://stackoverflow.com/a/25009027
has comment: http://stackoverflow.com/comment/38887872
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38888053
accepted answer of: http://stackoverflow.com/q/25008978
answers question: http://stackoverflow.com/q/25008978
type: AcceptedAnswer
downvote count: 0
has body: From the jqueryMobile docs: Updating lists: If you add items to a listview, you'll need to call the refresh() method on it to update the styles and create any nested lists that are added. For example: $('#mylist').listview('refresh'); Note that the refresh() method only affects new nodes appended to a list. This is done for performance reasons. Any list items already enhanced will be ignored by the refresh process. This means that if you change the contents or attributes on an already enhanced list item, these won't be reflected. If you want a list item to be updated, replace it with fresh markup before calling refresh.
type: Answer

http://stackoverflow.com/a/24944114
answers question: http://stackoverflow.com/q/24944019
score: 2
has body: Here's the regex for what you're asking: var re = /^[a-zA-Z]+(?: [a-zA-Z]+)?$/; If it matches, it means the input is valid. Explanation: ^...$ anchors the regex so it must match the entire string, and not just any substring inside it [a-zA-Z]+ matches one or more consecutive letters (?:...) is just a grouping expression ... which contains a space and another [a-zA-Z]+ ... and is optional thanks to the ? You could also apply variations if you wish, for example [A-Z][a-z]* instead of each [a-zA-Z]+ would make sure each name starts with an uppercase letter and contains only lowercase letters after the first one.
downvote count: 0
upvote count: 2
type: Answer

http://stackoverflow.com/comment/103996717
comment on: http://stackoverflow.com/a/25068604
type: AnswerComment
score: 2
has text: How about now? :)
type: Comment

http://stackoverflow.com/q/24965834
type: UnansweredQuestion
upvote count: 1
tagged with: checkbox
has body: The aim of the code is to use checkboxes for filtering. In the JSFiddle example you can see that there are 5 filter groups with checkboxes. The goal is: when somebody ticks multiple checkboxes, it should narrow the results list down, no matter if the checked checkboxes are in one filter group or in different groups. For example if you check two boxes in the Filter 1 group (e.g. Check1 and Check2) it should only display those results which are in Check1 AND Check2, which in this case is Result1 only. (Currently the code expands the results and if you check these 2 checkboxes it shows Result1, Result2, Result3 and Result9.) (The narrowing works if you check checkboxes in different Filter groups and it should remain this way.) Another goal is that, there are 5 Filter groups, but only the first 3 groups are coded in yet. How can I include the Filter 4 and Filter 5 groups in the code? Thank you for your help. The code: Filter 1 Check1 Check2 Check3 Filter 2 Check4 Check5 Check6 Check7 Check8 Check9 Filter 3 Check10 Check11 Check12 Filter 4 Check13 Check14 Check15 Check16 Check17 Filter 5 Check18 Check19 Check20 Result1 Result2 Result3 Result4 Result5 Result6 Result7 Result8 Result9 Result10 Result11 Result12 Result13 Result14
has comment: http://stackoverflow.com/comment/46441223
score: 1
has title: Multiple checkbox filtering with jQuery
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24966092
tagged with: filter
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/38812553
score: 0
type: Comment
type: QuestionComment
has text: As far as the random trajectories go, it seems as simple as setting your x and y components to a random float within some range, determined by yourself as preferred. Am I wrong?
comment on: http://stackoverflow.com/q/24969315

http://stackoverflow.com/q/24911008
has answer: http://stackoverflow.com/a/24918845
tagged with: java
has title: Dynamic calculation of a TextView that is linked to a seris of buttons
type: Question
has body: I'm trying to create this flow on an application I'm building. I am having a little bit of trouble getting the TextView to be friendly with any kind of formula/conditions. Any suggestions on how I can get the TextView to output the result dynamically through my text watchers? Thanks in advance! Text Views //------------------DISPLAY-----------------\\ netsale = (TextView)findViewById(R.id.netsale_input); //--------------WAIT ASSISTANT--------------\\ waMain = (TextView)findViewById(R.id.txt_wa_main); waSplit = (TextView)findViewById(R.id.txt_wa_split); Clear Button public void clr_Clicked(View sender){ netsale.setText("0"); isempty=true; } Number Pad static boolean isempty=true; public void num_Clicked(View sender){ Button bt=(Button)sender; if(netsale.getText().length()&gt;5)return; if(isempty) { if(bt.getText().toString().equals("0"))return; netsale.setText(bt.getText()); isempty=false; } else { netsale.append(bt.getText()); } } Text Watchers private TextWatcher filterTextWatcher = new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { } @Override public void afterTextChanged(Editable s) { } }
tagged with: javascript
score: 0
answer count: 1
tagged with: textview
type: UnansweredQuestion
tagged with: android

http://stackoverflow.com/q/25000615
linked to: http://stackoverflow.com/q/122102
has comment: http://stackoverflow.com/comment/38875020
type: UnansweredQuestion
has title: How to copy by value?
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38871372
type: Question
has body: I have a DataTables plugin defined as var oTable = $('#table1').dataTable({ 'aaData': data, 'aoColumns': columns, 'bScrollInfinite': true, 'bScrollCollapse': true, 'iDisplayLength': 20, 'sScrollY': '300px' }); var oTable_Copy = oTable.slice(); Now whenever any value in oTable changes, the corresponding value also changes in oTable_Copy. How do I prevent oTable_Copy from changing?
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38871312
tagged with: datatables
has answer: http://stackoverflow.com/a/25000807
answer count: 1
has comment: http://stackoverflow.com/comment/38871415
has comment: http://stackoverflow.com/comment/38871330

http://stackoverflow.com/a/25063425
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
has comment: http://stackoverflow.com/comment/38990063
answers question: http://stackoverflow.com/q/25063264
upvote count: 1
has body: Try divArray.style.display = ''; insted of divArray.style.display = 'initial'; also commented by epascarello
accepted answer of: http://stackoverflow.com/q/25063264

http://stackoverflow.com/comment/38942418
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25027715
has text: yes, I'm using jquery to run ColorThief

http://stackoverflow.com/comment/38984169
type: QuestionComment
score: 1
has text: You want to remove the classes from the elements, or the elements from the collection ?
comment on: http://stackoverflow.com/q/25060337
type: Comment

http://stackoverflow.com/comment/38902091
type: Comment
has text: You are correct in your understanding. jQuery is not longer necessary so I edited to remove.
type: AnswerComment
comment on: http://stackoverflow.com/a/24999793
score: 0

http://stackoverflow.com/q/24940536
has comment: http://stackoverflow.com/comment/38759403
answer count: 1
has title: Why does $.ajax() cause the wep page to postback twice?
tagged with: javascript
tagged with: jquery
has body: Can anyone tell me why does this $.ajax() cause the webpage to do a postback twice? Isn't it suppose to fire only once? This is what I saw when debugging in Visual Studio and it is causing the server-side script to run twice. I'm using JQuery version 2.0.0 . The ThrobblerAnimationBegin() function is what show the processing icon animation to let the end-user know the webpage is busy executing the script. The @{} bracket is the server-side script, this is how I was able to tell when a postback was made to the server-side backend, by using debugging breakpoint. Thanks... @{ string foo = "Me Me Me"; foo += ", fee fee fee"; } BookItOut - A New Dawn In Auto Pricing" EDIT as per request Here's the snapshot from Firefox's Firebug.
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/24943655
has comment: http://stackoverflow.com/comment/38758991
downvote count: 1
has comment: http://stackoverflow.com/comment/38760682
has comment: http://stackoverflow.com/comment/38759323
upvote count: 0
has comment: http://stackoverflow.com/comment/38760452
type: Question
linked to: http://stackoverflow.com/q/12116505
type: AnsweredQuestion
score: -1
has comment: http://stackoverflow.com/comment/38764598
accepted answer: http://stackoverflow.com/a/24943655

http://stackoverflow.com/a/24991830
has comment: http://stackoverflow.com/comment/38855416
answers question: http://stackoverflow.com/q/24991582
has body: Updated.. see this fiddle Do u Mean like this $(document).scroll(function(){ var top=$(document).scrollTop()-322; console.log(top) if(top&lt;0) { $('.mainLeft li a').css('color','black') $('#li1 a').css('color',$('#section1').css('color')) //$('#li1 a').css('color',"red") } if(top&gt;0 &amp;&amp; top&lt;322) { $('.mainLeft li a').css('color','black') $('#li2 a').css('color',$('#section2').css('color')) //$('#li1 a').css('color',"red") } if(top&gt;322 &amp;&amp; top&lt;644) { $('.mainLeft li a').css('color','black') $('#li3 a').css('color',$('#section3').css('color')) //$('#li1 a').css('color',"red") } if(top&gt;644 &amp;&amp; top&lt;966) { $('.mainLeft li a').css('color','black') $('#li4 a').css('color',$('#section4').css('color')) //$('#li1 a').css('color',"red") } if(top&gt;966 &amp;&amp; top&lt;1288) { $('.mainLeft li a').css('color','black') $('#li5 a').css('color',$('#section5').css('color')) //$('#li1 a').css('color',"red") } });
has comment: http://stackoverflow.com/comment/38854992
has comment: http://stackoverflow.com/comment/38855226
score: 0
type: Answer

http://stackoverflow.com/comment/38919584
type: AnswerComment
has text: Works perfectly! Also, the first step is the most important as PageDown/PageUp does the "paragraph" thing in my usecase. I added it in `extraKeys: { "End": "goLineRight", "Home": "goLineLeft"}`, but it is just the same. Thanks for a great library, Marijn!
type: Comment
comment on: http://stackoverflow.com/a/25019442
score: 0

http://stackoverflow.com/a/25056231
answers question: http://stackoverflow.com/q/25056180
has comment: http://stackoverflow.com/comment/38977833
has comment: http://stackoverflow.com/comment/38979066
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/38978625
has comment: http://stackoverflow.com/comment/38978569
has body: i wish to keep classes and id's of the converted tables If you only want those two: At some point in whatever code you're using to do this, you should have a reference to the old table and the new div, probably in jQuery objects. So: theNewDiv.attr("id", theOldTable.attr("id")); theNewDiv.attr("class", theOldTable.attr("class")); Now that you've shown your code: $('table').each(function (){ var theOldTable = $(this); var theNewDiv = $(theOldTable.html() .replace(/&lt;tbody/gi, "&lt;div class='table'") .replace(/&lt;tr/gi, "&lt;div class='ccbnOutline'") .replace(/&lt;\/tr&gt;/gi, "&lt;/div&gt;") .replace(/&lt;td/gi, "&lt;span") .replace(/&lt;\/td&gt;/gi, "&lt;/span&gt;") .replace(/&lt;\/tbody/gi, "&lt;\/div") ); theNewDiv.attr("id", theOldTable.attr("id")); theNewDiv.attr("class", theOldTable.attr("class")); theOldTable.replaceWith(theNewDiv); });
type: Answer
accepted answer of: http://stackoverflow.com/q/25056180
has comment: http://stackoverflow.com/comment/38976833

forms
tags question: http://stackoverflow.com/q/24912986
tags question: http://stackoverflow.com/q/24977466
tags question: http://stackoverflow.com/q/24971054
tags question: http://stackoverflow.com/q/25051018
tags question: http://stackoverflow.com/q/25002137
tags question: http://stackoverflow.com/q/25061512
tags question: http://stackoverflow.com/q/25064740
tags question: http://stackoverflow.com/q/24985656
tags question: http://stackoverflow.com/q/25043227
tags question: http://stackoverflow.com/q/25066989
type: Tag
tags question: http://stackoverflow.com/q/25039378
tags question: http://stackoverflow.com/q/24972586
tags question: http://stackoverflow.com/q/25035075
tags question: http://stackoverflow.com/q/24913939
tags question: http://stackoverflow.com/q/25010875
tags question: http://stackoverflow.com/q/24982691
tags question: http://stackoverflow.com/q/24921977
tags question: http://stackoverflow.com/q/25053888
tags question: http://stackoverflow.com/q/24924669
tags question: http://stackoverflow.com/q/24914729
tags question: http://stackoverflow.com/q/25060578
tags question: http://stackoverflow.com/q/25024388
tags question: http://stackoverflow.com/q/25021383
tags question: http://stackoverflow.com/q/25035522
tags question: http://stackoverflow.com/q/25040756
tags question: http://stackoverflow.com/q/24959843
tags question: http://stackoverflow.com/q/24981946
tags question: http://stackoverflow.com/q/25049686
tags question: http://stackoverflow.com/q/24954861
tags question: http://stackoverflow.com/q/25003587
tags question: http://stackoverflow.com/q/24967505
tags question: http://stackoverflow.com/q/25066688
tags question: http://stackoverflow.com/q/24919103
tags question: http://stackoverflow.com/q/25028610
tags question: http://stackoverflow.com/q/25024910
tags question: http://stackoverflow.com/q/24978522
tags question: http://stackoverflow.com/q/24936399
tags question: http://stackoverflow.com/q/24912542
tags question: http://stackoverflow.com/q/25024233
tags question: http://stackoverflow.com/q/25064009
tags question: http://stackoverflow.com/q/24910340
tags question: http://stackoverflow.com/q/24953377
tags question: http://stackoverflow.com/q/24914139
tags question: http://stackoverflow.com/q/24927677
tags question: http://stackoverflow.com/q/25038178
tags question: http://stackoverflow.com/q/25044942
tags question: http://stackoverflow.com/q/25068138
tags question: http://stackoverflow.com/q/25015184
tags question: http://stackoverflow.com/q/25052667
tags question: http://stackoverflow.com/q/25046611
tags question: http://stackoverflow.com/q/24930105
tags question: http://stackoverflow.com/q/24924666
tags question: http://stackoverflow.com/q/24964851
tags question: http://stackoverflow.com/q/25048203
tags question: http://stackoverflow.com/q/25068093
tags question: http://stackoverflow.com/q/25051981
tags question: http://stackoverflow.com/q/25037454
tags question: http://stackoverflow.com/q/24943078
tags question: http://stackoverflow.com/q/24951604
tags question: http://stackoverflow.com/q/24960336
tags question: http://stackoverflow.com/q/24925972
tags question: http://stackoverflow.com/q/24941618
tags question: http://stackoverflow.com/q/24966325
tags question: http://stackoverflow.com/q/25053639
tags question: http://stackoverflow.com/q/24990346
tags question: http://stackoverflow.com/q/25047669
tags question: http://stackoverflow.com/q/25040571
tags question: http://stackoverflow.com/q/25067716
tags question: http://stackoverflow.com/q/24915964
tags question: http://stackoverflow.com/q/24913512
tags question: http://stackoverflow.com/q/24998754
tags question: http://stackoverflow.com/q/24986991
tags question: http://stackoverflow.com/q/24927519
tags question: http://stackoverflow.com/q/24964095
tags question: http://stackoverflow.com/q/24961471
tags question: http://stackoverflow.com/q/25006644
tags question: http://stackoverflow.com/q/25044548
tag name: forms
tags question: http://stackoverflow.com/q/25068719

http://stackoverflow.com/a/24976970
score: 0
has body: You have this error message because req.query.message is undefined. Check that the variable req.query.message exists and this should work.
type: Answer
has comment: http://stackoverflow.com/comment/38827030
accepted answer of: http://stackoverflow.com/q/24976955
has comment: http://stackoverflow.com/comment/38827006
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24976955

http://stackoverflow.com/a/24925525
has comment: http://stackoverflow.com/comment/38731321
has comment: http://stackoverflow.com/comment/38744522
has comment: http://stackoverflow.com/comment/38731143
has body: You not storing the get value anywhere in the controller. Better approach would be something like this: app.service('createFeedList',['feedLoader', function(feedLoader){ return{ get:function(callback){ var feed = { feedName: 'Slashdot', feedURL: 'http://rss.slashdot.org/Slashdot/slashdot' }; feedLoader.collect({q: feed.feedURL, num: 10},{},function(results){ var results = data.responseData.feed; feedList.push(results); callback(feedList); }); }; } }]) app.controller('blogCtrl',['$scope','createFeedList', function($scope, createFeedList){ createFeedList.get(function(data){ this.feedList = data; }); }]);
has comment: http://stackoverflow.com/comment/38731241
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24925433
has comment: http://stackoverflow.com/comment/38731342

http://stackoverflow.com/q/25014419
answer count: 2
has comment: http://stackoverflow.com/comment/38897474
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25014779
accepted answer: http://stackoverflow.com/a/25015521
possible better answer: http://stackoverflow.com/a/25014779
has comment: http://stackoverflow.com/comment/38899292
has body: I am trying to open Jquery ui modal with doubleclicking on tables row. For now I open modal with a button: $('button.adminModal').on("click", function (event) { loadDialog(this, event, '#adminPanel'); }); Function loadDialog opens modal with given href. How can I open modal by doubleclicking on tables row? I have tried using event ondblclick in tag, but it did not worked. LoadDialog function: function loadDialog(tag, event, target) { event.preventDefault(); var $loading = $(''); var $url = $(tag).attr('href'); var $title = $(tag).attr('title'); var $dialog = $('&lt;div&gt;&lt;/div&gt;'); $dialog.empty(); $dialog .append($loading) .load($url) .dialog({ autoOpen: false , title: $title , width: 500 , modal: true , minHeight: 200 , show: 'fade' }); };
has comment: http://stackoverflow.com/comment/38897906
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38897404
has comment: http://stackoverflow.com/comment/38897663
has title: Jquery Ui modal open doubleclick on row
has answer: http://stackoverflow.com/a/25015521
type: Question
score: 0

http://stackoverflow.com/comment/38831549
type: Comment
comment on: http://stackoverflow.com/a/24979437
type: AnswerComment
score: 0
has text: Thanks a lot! It solved the problem. But the only problem left is when I first run the activity, even though there is nothing selected from the spinner, the tableOri still appear. Do you have any idea why?

http://stackoverflow.com/comment/38871093
type: Comment
type: QuestionComment
has text: Yes, it is initialized to 1. Then `$stateChangeSuccess` gets called, loading the correct value. Then gets reset to 1. All of this happens on the initial page load.
score: 0
comment on: http://stackoverflow.com/q/25000380

http://stackoverflow.com/comment/38917126
score: 1
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25024464
has text: Please post the relevant code here, not just as a link to a live site. When you fix the problem, the link will no longer be relevant to the question.

http://stackoverflow.com/a/24965382
has comment: http://stackoverflow.com/comment/38805402
upvote count: 3
type: AcceptedAnswer
has body: You can check the nodeType property of the nodes: $('#parent').contents().each(function() { if (this.nodeType === 3) { this.nodeValue = this.nodeValue.replace('text', 'candy'); } }); If you want to replace the text with HTML, you can use the replaceWith method: $('#parent').contents().filter(function() { return this.nodeType === 3 && this.nodeValue.indexOf('text') > -1; }).replaceWith(function() { return this.nodeValue.replace(/(text)/g, 'candy'); });
has comment: http://stackoverflow.com/comment/38805613
type: Answer
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24965295
answers question: http://stackoverflow.com/q/24965295

http://stackoverflow.com/q/24979106
has comment: http://stackoverflow.com/comment/38831801
has answer: http://stackoverflow.com/a/24979302
has comment: http://stackoverflow.com/comment/38831944
has comment: http://stackoverflow.com/comment/38831422
has comment: http://stackoverflow.com/comment/38830888
type: Question
has comment: http://stackoverflow.com/comment/38832042
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38832241
accepted answer: http://stackoverflow.com/a/24979302
score: 0
has title: c# Webbrowser - identify javascript function by div id
has body: actually i´m having some trouble with a webiste. I´m trying to get a div content that is created by a javascript. Sadly I can´t figure out which Javascript actually is filling this div. How could I find that script ? The tables including those TR30739... are created by that unkown script. I´ve tried to checkout the scripts I found with firebug one by one but I´m not sure if I´m calling them correctly and may not notice if it´s the one I´m looking for.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38831662

http://stackoverflow.com/comment/38772954
comment on: http://stackoverflow.com/q/24947935
type: QuestionComment
has text: Did you inspect the page? It is all right there
type: Comment
score: 4

http://stackoverflow.com/comment/38828229
comment on: http://stackoverflow.com/a/24977647
score: 4
type: AnswerComment
type: Comment
has text: The selector is arbitrary for the sake of the demo. OP can inherit for his implementation.

http://stackoverflow.com/q/24913564
upvote count: 5
has comment: http://stackoverflow.com/comment/38707714
has comment: http://stackoverflow.com/comment/38708215
type: UnansweredQuestion
tagged with: append
has comment: http://stackoverflow.com/comment/38708367
has comment: http://stackoverflow.com/comment/38708773
type: Question
has body: I am encountering a massive problem in terms of loading big amounts of data into the DOM. In fact, only IE11 is the deal breaker here. Here is some example code first, basically I am doing this: var concat = []; for (var i = 0; i &lt; 10000; i++) { concat[i] = "&lt;li value='"+'XYZ' + i+"'&gt;"+'XYZ ' + i+"&lt;/li&gt;"; } var element = conc.join(''); $('ul.mylist').append(element); Now, its broken down to a very basic example, its inspired by a jsFiddle I found here in a similar topic: http://jsfiddle.net/bVAFF/152/ The fiddle works fine in IE! I insert large chunks of list elements, up to ~10.000. This performs great since I am concatenating the single elements into one big string, which is appended to the DOM finally. At least it performs great on Chrome and Firefox, it takes them 1-2 seconds to insert the data, whereas IE11 needs MINUTES to resurrect from its injection seizure. I was experimenting with even bigger data amounts: strings with up to 9MB/70.000 Elements (!) still loaded "meh" (but i didnt test this on IE at that point). I have to admit, that the strings I inject for real are way bigger than the ones in the (very simple) example, but still: it performs great on Chrome and FF. Only IE freezes! Has anyone a clue why this is the case? Greetings from Berlin! Ahab
tagged with: internet-explorer-11
tagged with: javascript
score: 4
has answer: http://stackoverflow.com/a/24954043
has title: Appending large groups of elements in IE11 enormously slow
has comment: http://stackoverflow.com/comment/38707655
answer count: 3
downvote count: 1
has answer: http://stackoverflow.com/a/44729118
tagged with: jquery
has answer: http://stackoverflow.com/a/24914520
favorite count: 0
has comment: http://stackoverflow.com/comment/38707718
has comment: http://stackoverflow.com/comment/38709180

http://stackoverflow.com/a/24923969
has comment: http://stackoverflow.com/comment/38727973
upvote count: 1
has comment: http://stackoverflow.com/comment/38727610
has body: html <?php $test="00010387";?> <a href="javascript:browsePricebySKU('<?php echo $test;?>');"> (close php before starting html) or html <?php $test="00010387"; echo "";
type: Answer
has comment: http://stackoverflow.com/comment/38735950
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24923950

http://stackoverflow.com/a/24913730
has comment: http://stackoverflow.com/comment/103437834
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38708203
type: Answer
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/103394859
answers question: http://stackoverflow.com/q/24913361
has comment: http://stackoverflow.com/comment/38797217
has comment: http://stackoverflow.com/comment/38797136
has comment: http://stackoverflow.com/comment/38710739
has body: 1) you can't restart a buffersourcenode. They're a one shot deal - once they're stopped, you need to throw them away and create a new one (pointing to the same AudioBuffer). 2) You need to plan ahead, in order to get the playback restarted at the same time that you've stopped it. Javascript is not a real-time language, so the playback is happening on a different thread. 3) If you're just trying to get close, but still overlapping, you may want to put envelopes on the ending and beginning to smooth the transitions - e.g. use setTargetAtTime to ramp a gain value up (at the beginning) and down (at the stop time).
accepted answer of: http://stackoverflow.com/q/24913361

http://stackoverflow.com/a/25022713
type: Answer
has body: Javascript: $(document).ready(function() { $('#box1').mouseup(function(event) { if (event.which == 3) { // right click $('#right-click-menu').offset({ top: event.pageY, left: event.pageX }); } }); }); HTML: Be sure to include position: absolute for the menu to allow it to move around, and oncontextmenu to return false to prevent the default browser right-click. option1 option2 option3 option4 Fiddle: http://jsfiddle.net/ALAHX/1/ You'll want to include things like hiding the menu at first and when options are selected, but this should get you started. Looking at you comment, you may or may not have included jQuery in your project, which is a Javascript addon. The above code is written using jQuery, so make sure to include a link to it in your HTML.
accepted answer of: http://stackoverflow.com/q/25022426
answers question: http://stackoverflow.com/q/25022426
type: AcceptedAnswer
score: 0

http://stackoverflow.com/comment/52141646
has text: @JoeSloth yeah that's what I meant with the native application. The soundflower approach works but sadly in my use case that wasn't an option. I'm glad it worked out for you though.
comment on: http://stackoverflow.com/q/25033583
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24924136
upvote count: 4
downvote count: 0
tagged with: javascript
score: 4
favorite count: 0
has title: grunt-concurrent and handling SIGINT
tagged with: grunt-concurrent
tagged with: node.js
answer count: 0
type: UnansweredQuestion
type: Question
tagged with: gruntjs
tagged with: concurrency
has body: I'm struggling to understand behavior I'm seeing when using grunt-concurrent and trying to handle SIGINT, and hope someone can shed some light on it. Basically: when I use a SIGINT handler within my function(grunt) { } declaration, why does only one of the concurrent tasks see SIGINT? The brief setup: I'm using grunt-concurrent to fire off watch and nodemon tasks; the exact concurrent stanza of my Gruntfile.js file is: concurrent: { dev: { options: { logConcurrentOutput: true }, tasks: [ 'watch', 'nodemon:dev' ] } } I wanted to watch for SIGINT, so that when I hit Ctrl+C, I can clean up a few files that get copied as part of the watch task. I began by adding the following to the end of my Gruntfile.js, outside of the module.exports = function(grunt) { ... } function declaration: process.on('SIGINT', function() { console.log('Cleaning up after the dev server...'); console.log(JSON.stringify(process.argv)); }); When it's included there and I hit Ctrl+C, it runs three times — once for the main grunt task I ran (dev), and one for each of the two tasks that grunt-concurrent ran (watch and nodemon:dev). That's clearly not what I intended. When I move the SIGINT handler within the function(grunt) { } method, then when I hit Ctrl+C, it only runs once — for the nodemon:dev task. What I can't understand is why I'm not seeing it run for the watch task too (and for the master concurrent task dev that fires both of them off!), and it's sorta killing me... mostly because I don't want to depend on this behavior when I can't understand it and can't be sure it won't be the same on all the different machines this app will end up on. So... thoughts? What am I missing here? Thanks!

http://stackoverflow.com/q/24992773
answer count: 3
has comment: http://stackoverflow.com/comment/38856475
has comment: http://stackoverflow.com/comment/38856512
has comment: http://stackoverflow.com/comment/38856448
tagged with: jquery
has answer: http://stackoverflow.com/a/24993427
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has answer: http://stackoverflow.com/a/24992938
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24992878
has title: Get image src while using the .find() function
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38856579
has body: I need to get the image src into a variable however i am using .find() to reference the current selected class image. my code is as such. var imagesrc = $(this).find(".shape img").attr("src"); alert(imagesrc); it is returning an undefined. where am i going wrong?
tagged with: image
has comment: http://stackoverflow.com/comment/38856452

http://stackoverflow.com/q/25025190
tagged with: javascript
score: 0
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/38919296
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38919735
has title: Intercept page load to show only a portion of the page
has comment: http://stackoverflow.com/comment/38918499
has answer: http://stackoverflow.com/a/25035293
has comment: http://stackoverflow.com/comment/38918663
type: Question
has body: Here is the situation: I am building a chrome extension that injects a sidebar to a page (simple HTML) when the browser icon is clicked. I also use message passing to check if the button was already clicked for a domain name so that I automatically (re)display the sidebar. I am wondering if it is possible to intercept the loading of the page content so that my sidebar loads first, then the actual page.
answer count: 1

http://stackoverflow.com/q/24942101
has answer: http://stackoverflow.com/a/32081505
score: 1
tagged with: java
answer count: 2
has body: For WorkLight applications I don't see some cookie headers being sent to the server for basic WL.Client.invokeProcedure calls. How do you properly add cookie headers? Ideally, these would be global but I read that there may be issues using WL.Client.addGlobalHeader("Cookie"). procedure). This is basically the code in Javascript: var invocationData = { adapter : "data", procedure : procedure, headers : { "Cookie", "CookieData=val" } parameters : parms, }; WL.Client.invokeProcedure(invocationData) Edited: http://www-01.ibm.com/support/docview.wss?uid=swg21678099 "The WL.Client.addGlobalHeader API replaces the entire 'Cookie' header and destroys the session state."
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38762243
favorite count: 0
type: UnansweredQuestion
tagged with: ibm-mobilefirst
tagged with: cordova
has answer: http://stackoverflow.com/a/24942920
has title: Worklight : how to set use addGlobalHeader for WL.Client.invokeProcedure calls
upvote count: 1
has comment: http://stackoverflow.com/comment/38762054
type: Question

http://stackoverflow.com/comment/38833298
comment on: http://stackoverflow.com/q/24980478
has text: because you are declaring a local variable `i`,not a global one, in the first block, and trying to access it in the second
score: 2
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24965970
has comment: http://stackoverflow.com/comment/39090363
type: Answer
has body: You don't provide a lot of details or much code, but if there's a single request to retrieve multiple objects (as per your previous framework), then that request is most likely not really a REST interface. By default, Backbone expects to use a REST interface (Ruby-flavored) for its models (and, thus, collections), so there is no way to do what you want "out of the box." Backbone, however, is easily extended, and you could certainly override the model/collections' fetch methods to use a non-REST API. An even better approach might be to make your own AJAX request for the three model/collections and then feed the appropriate data into the model/collection when creating it, thus avoiding the Backbone fetch altogether. Something like: render: function() { $.getJSON("url/to/aggregated/data", function(data) { var favorites = new Favorites(data.favorites); var feed = new Feed(data.feed); var account = new Account(data.account); new FavoritesView({el: $A.el('#nm'), collection: favorites); new FeedView({el: $A.el('#at_view'), model: feed); new AccountView({model: account}); }); }
has comment: http://stackoverflow.com/comment/38806808
accepted answer of: http://stackoverflow.com/q/24963160
answers question: http://stackoverflow.com/q/24963160
has comment: http://stackoverflow.com/comment/38806621
score: 0
type: AcceptedAnswer

http://stackoverflow.com/q/25045917
accepted answer: http://stackoverflow.com/a/25047058
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has title: Chrome Extension: accessing the DOM of the popup.html AND getting jQuery to work
tagged with: google-chrome
type: AnsweredQuestion
score: 2
has body: I am trying to write a Chrome Extension, but I am stuck with two problems (keep in mind that I am an absolute beginner when it comes to building Chrome Extensions): I want to access the DOM of the popup.html file (which is the basis of my extension). I have tried doing this using script directly inside popup.html but I get a warning from Chrome saying that inline script is unsafe. I have tried using an external file in the same way and that also does not work. I have also tried putting the code in a background script file as well as a content script file. Secondly, I want to use jQuery on to access my popup.html page and it doesn't seem to be working. Here is my manifest.json file: { "name": "Test", "version": "1", "manifest_version": 2, "browser_action": { "default_icon": "icon.png", "default_title": "Testing.", "default_popup": "popup.html" }, "background": { "scripts": ["jquery.js", "background.js"], "persistent": false }, "content_scripts": [ { "matches": ["http://*/*", "https://*/*"], "js": ["content.js"] } ] } Here is my popup.html file: NAV BAR In order to test all this, I have been trying to access the div navigation bar and simply display its contents, but the alert always displays null. When using jQuery, the alert does not even come up. This is the JavaScript I use: var div = document.getElementById("top_bar"); alert(div.innerHTML); I would really appreciate some help with this, as well as an explanation as to where to proper place would be to put code for accessing the DOM of the popup.html page.
type: Question
upvote count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25047058

http://stackoverflow.com/comment/38745461
score: 0
type: AnswerComment
has text: FYI, this did not work. It doesn't pass the data correctly. The method is called, but the Boolean is always false and the Guid is always all zeroes.
type: Comment
comment on: http://stackoverflow.com/a/24919695

http://stackoverflow.com/a/25035794
has comment: http://stackoverflow.com/comment/38937776
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25035676
has body: You can use the timeupdate event that fires whenever the video's currentTime attribute updates. Reference: https://developer.mozilla.org/en-US/docs/Web/Events/timeupdate Example: $(document).ready(function(){ $( '.header-video' ).on( 'timeupdate', function(event){ // Save object in case you want to manipulate it more without calling the DOM $this = $(this); if( this.currentTime &gt; ( this.duration - 3 ) ) { $this.fadeOut(200); } }); }); JSFiddle
type: Answer
accepted answer of: http://stackoverflow.com/q/25035676
has comment: http://stackoverflow.com/comment/38937536
upvote count: 7
score: 7
has comment: http://stackoverflow.com/comment/38937338

http://stackoverflow.com/q/25032325
has comment: http://stackoverflow.com/comment/38931045
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38931217
has title: Passing objects with functions from PHP to JS
duplicate of: http://stackoverflow.com/q/1745248
type: Question
has body: I've created a jQuery plugin that takes options in the form of an object. If I initialised the object client side I would do something like $(selector).myPlugin({ opt: value, id: 2, onclose: function () {}, }); My function would interpret the options as 1. {opt: string(value), id: int(2), onclose: function () {}} However, the plugin declaration is made server side, and I turn a PHP associative array into the object required for the plugin options by using json_encode. The problem here is that my plugin recognises the declaration as 2. {opt: string(value), id: string(2), onclose: string(function () {})} What I want to know is how do I pass that associative array from PHP in a way that JS interprets it as 1
linked to: http://stackoverflow.com/q/1745248
answer count: 1
has answer: http://stackoverflow.com/a/25032459
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38931124
score: 0
has comment: http://stackoverflow.com/comment/38931102

http://stackoverflow.com/q/25053228
has comment: http://stackoverflow.com/comment/38972848
has body: I am programming an educational web in PHP and JS and I interact with another webpage that corrects for me some programming exercises. I don't know when this correction will finish, but this correction webpage calls a given address when the correction is available. Is it possible to wait for that result with PHP or JS and then do some stuff (not just showing the result to the user), even if the user closes the tab? Thanks in advance. STEP BY STEP explanation: A student is trying to do a programming exercise. The statement of the exercise is shown, as well as other details to complete it. When he thinks he has reached a solution, he uploads his code. Then, he can wait (or not) for the correction to finish. My web page uploads then the code file (with other files as well as an address to callback when it finishes) to the corrector webpage. I keep waiting until the callback is made. When the correction is finished, I do some stuff like assigning a grade to the student and, if he/she stayed on the same page, he/she can see details of the correction. The correction is done by another webpage and I don't know when it would finish, but when it finishes it calls a given adress (for example: www.example.com/ex1sub1usr1 ). The doubts are between step 2 and 3. It is possible to do all this process with PHP/JS? If not, what are the alternatives?
tagged with: javascript
has answer: http://stackoverflow.com/a/25053373
has answer: http://stackoverflow.com/a/25053346
score: 0
answer count: 2
has title: Wait until a callback address is called
has comment: http://stackoverflow.com/comment/38971723
tagged with: php
possible better answer: http://stackoverflow.com/a/25053373
has comment: http://stackoverflow.com/comment/38970719
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/15514674
type: Question
accepted answer: http://stackoverflow.com/a/25053346

http://stackoverflow.com/q/24927585
accepted answer: http://stackoverflow.com/a/24927637
has answer: http://stackoverflow.com/a/24927705
upvote count: 1
possible better answer: http://stackoverflow.com/a/24927661
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24927661
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38734259
has body: I want to click a paragraph and show something, which has a class created inside script tag but I couldn't make it clickable. Can anyone help how to do it? Below is part of my code.. $('#three-star').click(function(){ var id=$('#elements-container').children().length+1; $('#elements-container').append(' Type your question here '); }); $('p.edit').click(function(){ $('#editor').show(); }); How can I do show() when I click on "Type your question here"? Thanks in advance.
downvote count: 0
has comment: http://stackoverflow.com/comment/38734885
tagged with: javascript
tagged with: event-handling
tagged with: jquery
has answer: http://stackoverflow.com/a/24927637
tagged with: class
has title: jQuery created class inside script
has comment: http://stackoverflow.com/comment/38734369
has answer: http://stackoverflow.com/a/24927691
answer count: 4
favorite count: 0
tagged with: dom-manipulation

http://stackoverflow.com/a/24982564
answers question: http://stackoverflow.com/q/24982471
type: Answer
has body: In several other languages e.g. C# &amp; Java, this may be safely omitted when member functions are working with member data in the same class / instance. (I realise that JS is structured fundamentally differently due to it being designed as a prototypal rather than a hierarchical inheritance language.) It's not about the inheritance chain, which is rather static in js as well. It's about JS being a dynamic language, with the global scope being able to add new variables at will, and objects being amendable with arbitrary properties. So it's just not really possible to make an identifier dynamically resolve to either a local variable or an object property, and we want to distinguish explicitly between them every time by using property accessors for property access. Is there any way to make the unspecified scope NOT point to window, but rather to the current, local value of this? The "unspecified scope" is the local scope, which is statically determined and optimized. To make it point to an object (and fall back to variables if the property is not found), you can use the with statement. However, due to this ambiguity it's not only slow, but also considered bad practise - the lookup (of variables) can be influenced by non-local code (that interacts with the instances) which breaks encapsulation and is a maintainability issue. My typical JS class structure … Of course you could also change that, and use local variables that are accessed via closure as members instead (see also Javascript: Do I need to put this.var for every variable in an object?). This solves the problems with this, but is also a bit slower (though probably still faster than with).
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/38840794
type: QuestionComment
has text: @doniyor No, yahw, nearly. If you are typing somewhere in the field, the usual state should be unhighlighted. But as soon as you put the caret into a bold text, it should be highlighted (different background color). And the next step is to debold the "whole" bold text. Hope that helps. %)P
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24984087

http://stackoverflow.com/q/24966781
upvote count: 10
type: Question
accepted answer: http://stackoverflow.com/a/24969143
score: 10
tagged with: javascript
answer count: 2
has title: gulp error handling for dependent task
downvote count: 0
tagged with: gulp
favorite count: 0
possible better answer: http://stackoverflow.com/a/34029263
has body: Please find the content of the gulpfile.js as below. The task uglify depends on the task jshint. Currently when I run gulp, both the tasks get executed, irrespective of the outcome of the jshint task. I don't want the uglify task to get executed when there are 'jshint' error(s). In other words, when ever there are dependent tasks, I don't want the subsequent tasks to get executed, if there are error detected by the preceding task. Is it possible in gulp? var gulp = require('gulp'); var jshint = require('gulp-jshint'); var uglify = require('gulp-uglify'); gulp.task('jshint', function () { return gulp.src(['assets/js/**/*.js']) .pipe(jshint('.jshintrc')) .pipe(jshint.reporter('jshint-stylish')); }); gulp.task('uglify', ['jshint'], function() { return gulp.src('assets/js/**/*.js') .pipe(uglify()) .pipe(gulp.dest('assets-min/js/')); }); gulp.task('default', ['jshint', 'uglify']); Please refer the below console output - not desired. Though there had been jshint error, the uglify task ran successfully. I have also created a GitHub repository with the boilerplate code for the above mentioned. Please find the same at @sarbbottam/gulp-workflow. Console out of the undesired workflow Console out of the expected workflow
type: AnsweredQuestion
tagged with: build
has answer: http://stackoverflow.com/a/34029263
has answer: http://stackoverflow.com/a/24969143

http://stackoverflow.com/q/24912015
tagged with: node.js
has comment: http://stackoverflow.com/comment/38707433
has comment: http://stackoverflow.com/comment/38707597
type: Question
tagged with: mongodb
has comment: http://stackoverflow.com/comment/38706409
tagged with: mongoose
tagged with: javascript
tagged with: express
has body: I have an Event schema declared like this: var EventSchema = new Schema({ type: String, action: String, createdAt: { type : Date, default : Date.now }, payload: {}, }); And I'm trying to create a new instance using this hash (other attributes omitted for clarity): { "payload": { "apikey": { "created_at": "2014-07-22T18:35:19.995Z", "id": 1, "owner_id": 3, "owner_type": "User", "permissions": [ { "can_create": false, "can_delete": false, "can_read": false, "can_update": false, "created_at": "2014-07-22T18:37:18.111Z", "id": 3, "key": "second", "role_id": 1, "updated_at": "2014-07-22T18:37:18.121Z" }, { "can_create": false, "can_delete": false, "can_read": false, "can_update": false, "created_at": "2014-07-22T18:37:18.111Z", "id": 2, "key": "permission-key-2", "role_id": 1, "updated_at": "2014-07-22T18:37:18.121Z" } ], "realm_id": 6, "realm_type": "Organization", "secret": "c35ca06eab38850493bae0f974787587", "token": "a9e4691ebc1551b6b1ee2147397248a6", "updated_at": "2014-07-22T18:40:26.553Z" } } } But instead of saving in the structure I sent, it's saving it like this: { "apikey": { "created_at": "2014-07-22 18:35:19 UTC", "id": "1", "owner_id": "3", "owner_type": "User", "permissions": { "can_create": [ "false", "false" ], "can_delete": [ "false", "false" ], "can_read": [ "false", "false" ], "can_update": [ "false", "false" ], "created_at": [ "2014-07-22 18:37:18 UTC", "2014-07-22 18:37:18 UTC" ], "id": [ "3", "2" ], "key": [ "second", "permission-key-2" ], "role_id": [ "1", "1" ], "updated_at": [ "2014-07-22 18:37:18 UTC", "2014-07-22 18:37:18 UTC" ] }, "realm_id": "6", "realm_type": "Organization", "secret": "c35ca06eab38850493bae0f974787587", "token": "a9e4691ebc1551b6b1ee2147397248a6", "updated_at": "2014-07-22 18:40:26 UTC" } } Do you have any idea why?
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/38707293
has title: Mongoose schema with Mixed type behaving awkward
type: UnansweredQuestion

http://stackoverflow.com/q/24936645
downvote count: 1
score: -1
has body: I have a custom logic to parse the REST response in my Backbone Model as below; _parse: function(model) { var myCollection = new myCollection(); var myModel = new myModel(); if (model.myCollInside) { for (var j = 0; j &lt; model.myCollInside.length; j++){ myModel.set("attr1", new SomeModel1(model.myCollInside[j].attr1)) myModel.set("attr2", new SomeModel2(model.myCollInside[j].attr2)) myCollection.push(myModel); } } return { "myColl": myCollection }; } Now the issue is even if I have 2 models and I do; myCollection.push(myModel) I just get one model finally in myCollection ? Am I doing something wrong with using push for multiple items?
type: Question
has comment: http://stackoverflow.com/comment/38751235
upvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24936694
has title: BackboneJS Custom logic to parse response to model
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/38752185
type: UnansweredQuestion

http://stackoverflow.com/q/24949661
accepted answer: http://stackoverflow.com/a/24954690
has answer: http://stackoverflow.com/a/24952343
type: AnsweredQuestion
has body: I call http://wsf.cdyne.com/WeatherWS/Weather.asmx web service from JavaScript. And I pass data ZIP code as 10007(Hard coded). Want to get some output data. But when I run the code success message come as alert and then alert pop up says none. Seems there is no data returned. Can anyone edit the code to return proper output? Calling Web Service from jQuery Calling Web Services with jQuery/AJAX
has title: Weather.asmx web service from JavaScript- No output returns
type: Question
answer count: 2
tagged with: javascript
linked to: http://stackoverflow.com/q/667519
has answer: http://stackoverflow.com/a/24954690
score: 0
possible better answer: http://stackoverflow.com/a/24952343
tagged with: web-services

http://stackoverflow.com/a/25205189
upvote count: 1
answers question: http://stackoverflow.com/q/25041232
has body: I agree with @Waog that good OOD is probably the solution to your problem. Given that you might have a lot of properties on the object that you're writing setAttribA functions for, why not use a map to clean up the code a bit? There are probably dozens of map implementations for JavaScript, a simple google search for "map polyfill" lead me to this one, which looks nice: http://eriwen.github.io/smap.js/
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38773469
has text: @geocodezip i dont want to sort after data is put into table i want to do it before when in the form of json
score: 0
comment on: http://stackoverflow.com/q/24943482
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38769643
comment on: http://stackoverflow.com/q/24945728
type: QuestionComment
type: Comment
has text: Try `$(document.body).click` instead.
score: 1

http://stackoverflow.com/q/24916559
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38713713
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38713586
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/38713663
has body: I'm new to Javascript and struggling to figure out why this piece of code isn't working for me. Essentially I'm defining a variable, yet when I go to use that variable in an IF or Switch statement, it doesn't seem to be able to match the contents of the variable. No errors, the IF statement just doesn't get satisfied. While with the Switch, it always falls through to the default setting, as it can't match the contents. I have a Print statement in place after the variable is defined, and it does display the contents of the variable correctly. I'm really at a loss as to why the print can return the value of the variable, yet the IF and Switch can't find it. Below is the snippet I'm working from. The variable is "strWilma", which doesn't get reflected properly in the Print second value statement, but not in the IF. for (var i=0; i &lt; Flinstones.length; i++) { if (Flinstones[i].startsWith("?")) { // Convert the Secondary field map to a Properties item, for easier navigation var objSecondaryFieldMap = PropertiesFromString(strSecondaryFieldMap); // Map all of the Secondary values var arraySecondaryFields = objSecondaryFieldMap.keys(); while (arraySecondaryFields.hasMoreElements()) { strFred = arraySecondaryFields.nextElement(); strWilma = objSecondaryFieldMap.get(strFred); print("TargetType:" + Object.prototype.toString.call(strFred)); print("SourceType:" + Object.prototype.toString.call(strWilma)); print("Text Type:" + Object.prototype.toString.call("hardcoded value")); print("First Value:" + objItem.getNewFieldValue(Flinstones[i].substring(1)) ); print("Second Value:" + strWilma ); if (objItem.getNewFieldValue(Flinstones[i].substring(1)) == strWilma) //if (objItem.getNewFieldValue(Flinstones[i].substring(1)) == "hardcoded value") // WORKS { print("It Worked!!!"); } } } } } Thanks
upvote count: 1
has comment: http://stackoverflow.com/comment/38713643
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38714367
has title: JavaScript not recognizing variable

http://stackoverflow.com/comment/39026589
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25068416
has text: Would you mind to show me how to reference the input in this case? Because the input field attribute as 'name' seem can not be reference correctly. I always got undefined value when I do that. Thanks!
score: 0

universal-analytics
tag name: universal-analytics
tags question: http://stackoverflow.com/q/24980821
tags question: http://stackoverflow.com/q/24941492
type: Tag

http://stackoverflow.com/q/24931772
type: Question
has answer: http://stackoverflow.com/a/24931895
has answer: http://stackoverflow.com/a/24932579
upvote count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24931857
score: 0
has title: Iterate deep JSON in JQuery
downvote count: 1
has answer: http://stackoverflow.com/a/24931850
has answer: http://stackoverflow.com/a/24931845
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24931845
has answer: http://stackoverflow.com/a/24931885
tagged with: http://stackoverflow.com/tag/json
answer count: 6
has comment: http://stackoverflow.com/comment/38741839
has body: I want to Iterate JSON in jQuery. Using $.each i am trying to iterate. I am trying but not getting result id and sizes of every user. JSON [ [ { "user": { "id": "8", "sizes": "65" } } ], [ { "user": { "id": "9", "sizes": "75" } } ], [ { "user": { "id": "10", "sizes": "85" } } ] ] My jQuery Script $.each (usersJson, function (key1, value1) { $. each (value1, function (key2, value2) { $. each (value2, function (key3, value3) { console.log(key3+"--"+value3); }); }); });
accepted answer: http://stackoverflow.com/a/24931857

http://stackoverflow.com/q/25022107
has body: So, I've been having problems getting my JavaScript to keep a element's class changed. Whenever I try and change the element's class to "overlist" it works for less than a second, and then reverts it right back to it's original state, underlist. I cannot figure out a way to make it so the class stays. HTML: Tutorials Filler Text More Filler Text Foo Tutorial More foo Tutorial Foo Guide CSS: .underlist { display: none; } Javascript: function activateTutorials(){ if(document.getElementsByClassName('Tutorials').classList.contains('underlist')){ document.getElementsByClassName('Tutorials').classList.remove('underlist'); }else{ document.getElementsByClassName('Tutorials').classList.add('underlist'); } };
type: Question
has comment: http://stackoverflow.com/comment/38912352
tagged with: function
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38912765
tagged with: class
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25022252
has title: Problems changing a class with Javascript
tagged with: css
has comment: http://stackoverflow.com/comment/38912581
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38912667
has answer: http://stackoverflow.com/a/25022252
has comment: http://stackoverflow.com/comment/38912393

http://stackoverflow.com/comment/38828417
type: AnswerComment
score: 0
type: Comment
has text: OK, I see what you are thinking. OK, in this case I usually have a "GET" items, "PUT" items, and "POST" a new item. So I would do a POST to store-products.json with the single product I was adding, and the backend returns all products. Then the $http call looks like `$http.post('/products/123/reviews', reviewToAdd).success(function(data) { /* update local copy */ } ));` where 123 is your product ID. So in this case the URL says "add review to product 123" and "return the modified product" (or return modified reviews array)
comment on: http://stackoverflow.com/a/24977618

http://stackoverflow.com/comment/38806735
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24966028
has text: @GustavoPinent, I provided an adaptation of my answer that closer matches your code. Please see [the fiddle demo](http://jsfiddle.net/naomi/6jF5j/) too.

http://stackoverflow.com/comment/69554126
type: Comment
comment on: http://stackoverflow.com/a/25018940
has text: See the above comment
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38729931
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24924988
has text: Not an issue ;) I just updted the plunker, to show you how easy is to introduce the parent child... you have to love `ui-router` ... it is a really **aaawesome** tool ;)

http://stackoverflow.com/comment/39002547
type: QuestionComment
comment on: http://stackoverflow.com/q/25068216
has text: for some reason as soon as I turned off htmlmode all links worked, all href links don't have the # and they still work
score: 0
type: Comment

http://stackoverflow.com/comment/38752484
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24935840
has text: Why are guys down vote a legitimate question?

http://stackoverflow.com/comment/38868432
has text: I've added the entity interface of the entity concerned to the problem description
type: Comment
comment on: http://stackoverflow.com/q/24997405
type: QuestionComment
score: 0

http://stackoverflow.com/a/25063297
score: 0
has comment: http://stackoverflow.com/comment/39028700
accepted answer of: http://stackoverflow.com/q/25054538
type: Answer
has body: IMHO this could be done a bit simpler, I would maybe create it like that: function enemyinvcoords(name, x1, y1, x2, y2, item, state){ return { name : name, x1 : x1, x2 : x2, y1 : y1, y2 : y2, item : item, state : state}; } var ENinvarr = [ enemyinvcoords('EI0', 420, 280, 460, 320, 1, false), enemyinvcoords('EI1', 465, 280, 505, 320, 2, false), enemyinvcoords('EI2', 510, 280, 550, 320, 3, false), enemyinvcoords('EI3', 555, 280, 595, 320, 4, false), enemyinvcoords('EI4', 600, 280, 640, 320, 5, false), enemyinvcoords('EI5', 645, 280, 685, 320, 6, false), enemyinvcoords('EI6', 690, 280, 730, 320, 7, false) ]; Hope that helps you a little to jump into JavaScript.
answers question: http://stackoverflow.com/q/25054538
type: AcceptedAnswer

http://stackoverflow.com/a/24974667
type: Answer
has comment: http://stackoverflow.com/comment/103299817
upvote count: 59
has body: A "node", in this context, is simply an HTML element. The "DOM" is a tree structure that represents the HTML of the website, and every HTML element is a "node". See Document Object Model (DOM). More specifically, "Node" is an interface that is implemented by multiple other objects, including "document" and "element". All objects implementing the "Node" interface can be treated similarly. The term "node" therefore (in the DOM context) means any object that implements the "Node" interface. Most commonly that is an element object representing an HTML element.
downvote count: 1
answers question: http://stackoverflow.com/q/24974621
has comment: http://stackoverflow.com/comment/103211817
has comment: http://stackoverflow.com/comment/103350514
accepted answer of: http://stackoverflow.com/q/24974621
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/103211961
score: 58

http://stackoverflow.com/q/24941799
has answer: http://stackoverflow.com/a/24941986
type: AnsweredQuestion
score: 1
type: Question
has title: Duplicate field value into included file field
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
accepted answer: http://stackoverflow.com/a/24941986
tagged with: http://stackoverflow.com/tag/html
has body: Well, as the title says, I would like to duplicate a certain field value into a field which is included by div, from another file. I have it working without the included file. But when I cut out the second field with its form out and paste it into another file, which next off is included by element, it won't paste it anymore. http://jsfiddle.net/amstel/9tmPC/1/ Fyi, the code isn't working in jsfiddle, is does when published, I don't know the correct setting in jsfiddle. And, the element I use is simply: Any ideas?
linked to: http://stackoverflow.com/q/3724106
downvote count: 0

http://stackoverflow.com/comment/38848226
score: 1
has text: `Ajax` -> `send text` -> `php script converts bbcodes to html tags` -> `php script sends back to ajax` -> `ajax success response appends text to DOM element` -> **`profit`** ?
comment on: http://stackoverflow.com/q/24988114
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24961745
has body: I am writing a simple code like: ready = -> $('div').click -> $(this).append "olol" $(document).ready(ready) $(document).on('page:load', ready) However nothing happens, when I click on div elements on my web-page. When I put it into the HTML file between tags everything works!!! Please, help, it seems, that I've tried everything!
type: UnansweredQuestion
tagged with: ruby-on-rails
downvote count: 0
score: 1
tagged with: coffeescript
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24961872
has title: JS (Coffee-Script) is not working in rails app
upvote count: 1
answer count: 1
favorite count: 0

http://stackoverflow.com/a/24990872
answers question: http://stackoverflow.com/q/24990807
has body: It's just an idea, maybe it's working. App.directive('mapUsa', [function() { return { restrict: 'A', link: function(scope, element, attrs) { element.vectorMap({ ... onRegionClick: function(event, code) { scope.onRegionClick(event, code); } } }, controller: ['citiesData', function(citiesData){ onRegionClick: function(event, code) { console.log(citiesData); } }]
score: 0
type: Answer

browser-history
tags question: http://stackoverflow.com/q/24962589
type: Tag
tags question: http://stackoverflow.com/q/25033832
tag name: browser-history

http://stackoverflow.com/comment/38863022
type: Comment
has text: I think that's what he is trying to do http://stackoverflow.com/questions/24936749/svg-content-of-telerik-radhtmlchart I hope my idea there will help. I have not used Server.Execute() and I can't help with this though.
score: 0
comment on: http://stackoverflow.com/q/24943159
type: QuestionComment

http://stackoverflow.com/q/25044262
score: 5
has body: I'm looking for a way to return a promise only if another promise fails. How can I do that? The promises that I have look like this ( of course I've remove non-related code ) : getUserByUsername = function(username) { return promise(function(resolve, reject) { user = userModel.getByUsername(username); if ( user ) { resolve(user); } else { reject("user not found"); } }); }; getUserByEmail = function(email) { return promise(function(resolve, reject) { user = userModel.getByEmail(email); if ( user ) { resolve(user); } else { reject("user not found"); } }); }; checkPassword = function(user, password) { return promise(function(resolve, reject) { if ( user.isValidPassword(password) ) { resolve() } else { reject("password mismatch"); } }); }; And I want to combine them in the following sequence Call getUserByUsername and if rejects then call getUserByEmail Return the value of whoever resolves from the two promises above OR if both promises fail reject the whole chain. Call checkPassword with the value and if it rejects, reject the whole chain So far I have done this and it seems to work. ( I'm using when.js btw ) getUserByUsername(usernameOrEmail) .then( function(user) { return user; }, function() { return getUserByEmail(usernameOrEmail) } ) .then( function(user) { return checkPassword(user, password) } ) .done( function() { console.log('success'); }, function(err) { console.log('failure', err) } ); So this code works but I'm pretty sure there should be more elegant way of doing this ( I think my code looks more like a hack ).
answer count: 1
upvote count: 5
tagged with: es6-promise
tagged with: javascript
has answer: http://stackoverflow.com/a/25044359
type: AnsweredQuestion
downvote count: 0
favorite count: 0
tagged with: promise
has title: How to get the value of the first promise that succeeds in a chain of promises
type: Question
accepted answer: http://stackoverflow.com/a/25044359

http://stackoverflow.com/comment/38928291
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25030600
score: 0
has text: Please use 'view source' of the browser and check that the jQuery js path is correct.

http://stackoverflow.com/comment/38935259
type: AnswerComment
comment on: http://stackoverflow.com/a/25032955
score: 0
type: Comment
has text: I got it.We should convert to String , like---> var node = tree.getNodeByKey(ParentId.toString());

http://stackoverflow.com/comment/38845968
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24986991
has text: add e.preventDefault() to your form submission function. It will prevent the default submission, allowing you only to submit if the form is valid.
score: 0

http://stackoverflow.com/comment/38870464
type: QuestionComment
comment on: http://stackoverflow.com/q/25000120
score: 0
has text: `location.href = '../minw.php'` in `stone.php` should do the trick. Not sure why you see `localhost.minw.php`.
type: Comment

http://stackoverflow.com/comment/138575997
type: Comment
comment on: http://stackoverflow.com/a/24929146
type: AnswerComment
has text: It is better if you don't identify the argument passed to the function called by bind as done, some people may find it confusing as there is a string with bind above. x().then((promisedValue) => { console.log(promisedValue)}); // --> 'done!' Something like this.
score: 0

http://stackoverflow.com/q/24954588
has answer: http://stackoverflow.com/a/24954662
tagged with: regex
has answer: http://stackoverflow.com/a/24954667
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38784728
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24954667
answer count: 2
downvote count: 0
tagged with: string
favorite count: 0
possible better answer: http://stackoverflow.com/a/24954662
has body: i need to replace in javascript string all letters and more than 2 spaces for "". I have this: order.Order.Telefonos = order.Order.Telefonos.replace(/[^A-Za-z]|[^\S\r\n]{2,}/, ''); But when order.Order.Telefonos have this: "CASA: 1111111111 Varios: Trabajo: 111111111" return me this: 1111111111Varios:Trabajo:111111111 whats wrong on my regex?
has title: Replace All letters and more than 2 spaces in javascript string for empty character

http://stackoverflow.com/a/25059619
downvote count: 0
type: Answer
score: 2
upvote count: 2
has body: Try this: angular.element($("#elementID")).scope().launchMyAppHere(); where #elementID is DOM ID of element where you attach you controller.
accepted answer of: http://stackoverflow.com/q/25059029
answers question: http://stackoverflow.com/q/25059029
has comment: http://stackoverflow.com/comment/73491050
type: AcceptedAnswer

http://stackoverflow.com/q/24974854
tagged with: javascript
has comment: http://stackoverflow.com/comment/38823319
score: 0
has comment: http://stackoverflow.com/comment/38823517
answer count: 1
tagged with: backbone.js
has answer: http://stackoverflow.com/a/24977321
accepted answer: http://stackoverflow.com/a/24977321
type: AnsweredQuestion
has body: In every method, that I use this and want it to point to the object, do I need to use _.bindAll(). If not, in what cases do I need to use bindAll()? var AccountView = Backbone.View.extend({ Name: 'AccountView', P: { pictures: $A.Reg.get('path_pictures'), images: $A.Reg.get('path_images') }, E: { hold_name: '#hold_name', hold_pic_small: '#hold_pic_small', hold_pic_large: '#hold_pic_large' }, initialize: function () { $A.morph(this.E, $A.el); _.bindAll(this, 'render'); if (_.isObject(this.model)) { this.obj = this.model; } else { this.obj = this.model.toJSON(); } this.render(); }, render: function () { var time = new Date().getTime(); this.E.hold_name.innerHTML = this.obj.name; $A.el('#p' + this.obj.privacy).checked = true; if (this.obj.picture === 0) { this.E.hold_pic_small.src = this.P.images + 'generic_small.jpg' + '?_time=' + time; this.E.hold_pic_large.src = this.P.images + 'generic_large.jpg' + '?_time=' + time; } else { this.E.hold_pic_small.src = this.P.pictures + this.obj.h_file + '-1.jpg' + '?_time=' + time; this.E.hold_pic_large.src = this.P.pictures + this.obj.h_file + '-2.jpg' + '?_time=' + time; } } });
type: Question
has title: Do all Backbone methods need to be bound to this?
has comment: http://stackoverflow.com/comment/38823008

http://stackoverflow.com/a/25066475
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25011114
has body: I'm hoping your using a single stand alone surface as just an example and your not actually making a view out of it in practice. Use a Render Controller to show and hide your views. var renderer = new RenderContoller; var currentPage; var showPage1 = function() { var Page1View = require('Views/Page1View'); currentPage = new Page1View(); renderer.show(currentPage); currentPage.on('linkClick', function(){ console.log('link was clicked'); renderer.hide(); currentPage = null; showPage2(); }); }; A surface inside showPage1 has the following: page = this; component.on('click', function(){ page._eventOutput.emit('linkClick'); }); Hopefully that helps if you don't understand anything above just ask I'll try and explain further.
upvote count: 1
type: Answer

http://stackoverflow.com/comment/38857665
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24993189
has text: Thank you Gena, each svg would have only one occurrence of those. so if it works that would be fine for me.

http://stackoverflow.com/comment/38934388
has text: Try this jquery plugin [ScrollToFixed](http://bigspotteddog.github.io/ScrollToFixed/)
comment on: http://stackoverflow.com/q/25034223
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24987773
type: UnansweredQuestion
has title: My PageMethods never gets reached in .NET
has answer: http://stackoverflow.com/a/24987877
type: Question
tagged with: javascript
has body: I've tried everything and nothing works. The PageMethods never gets reached, but everything before that call is fine. Could it be something in the code-behind? I'm suspecting that I'm doing something wrong with the project overall. Could it be something that I have to put in the page master? public class GetElements { [ScriptMethod, WebMethod] public static string[] getTargets() { //List&lt;string&gt; targetList = new List&lt;string&gt;(); string[] targetList = new string[2]; targetList[0] = "poo"; targetList[1] = "bar"; foreach (Target t in PbcXml.oDeserialized.oTargetList) { } return targetList; } } javascript: var a = new Array(); getTarget(); function getTarget() { PageMethods.getTargets(OnSuccessLoad); return false; } function OnSuccessLoad(response) { for (var v in response) { //a.push(v); alert(v); } } aspx page: &lt;asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"&gt; &lt;/asp:ScriptManager&gt;
score: 0
answer count: 1
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38847536

http://stackoverflow.com/q/24942885
tagged with: jquery
linked to: http://stackoverflow.com/q/7720398
has body: I have a listener set on click for the markers I create no GoogleMaps (V3 API). When it is clicked, first I load the infowindow with some simple plain HTML with a "loading" gif. Then I call a method, that grabs the content via ajax and calls infowindow.setContent(data) with the loaded data. But the transition between animated gif and the new loaded content is rather ugly. Is there a way I can make this a fadeIn/fadeOut? Here's the code for the function that loads the content: function load_infowindow_content(infowindow, user_id){ $.ajax({ url: site_root +'usuario/map_infowindow/' + user_id, success: function(data) { infowindow.setContent( data ); } }); } Looked around and didn't find anything. Thanks in advance.
type: UnansweredQuestion
score: 0
has title: Is there a way I can fadeIn custom content of a InfoWindow?
has comment: http://stackoverflow.com/comment/38763561
has answer: http://stackoverflow.com/a/24943139
type: Question
tagged with: google-maps
tagged with: infowindow
has comment: http://stackoverflow.com/comment/38763528
answer count: 1
tagged with: javascript

http://stackoverflow.com/q/24972586
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38819038
favorite count: 0
has body: So I have 25 HTML fields (Text, Drop downs, Selects etc...) I would need these to show to user depending on their level, some may show some may not, so far only option I've came up with is using if statements to check for user level before loading field, example: if(userLevel == 1 || userLevel == 2){ echo("&lt;input type='text' name='phoneNumber'/&gt;"); But after I do that the code ends up very long and messy, is there any way to give each field some kind of ID and on page load, based on users level load those fields with specific ID's? Same for JS field validation, anyway to give each field id (like email, url) so it gets validated automatically rather than writing and calling onChange on each field?
tagged with: php
has answer: http://stackoverflow.com/a/24972858
accepted answer: http://stackoverflow.com/a/24972858
has title: 25 HTML fields - different fields for different user level?
type: AnsweredQuestion
upvote count: 3
type: Question
score: 3
has comment: http://stackoverflow.com/comment/38818893
tagged with: forms
tagged with: http-post

http://stackoverflow.com/comment/38785210
type: Comment
comment on: http://stackoverflow.com/a/24954395
has text: Exactly, well-summarised :-)
type: AnswerComment
score: 0

http://stackoverflow.com/a/24955249
answers question: http://stackoverflow.com/q/24938918
upvote count: 2
type: Answer
has body: I personally like the second approach to go with different subdomains. Duplicating the codebase is not really necessary since you can leverage the cool features RequireJS provides to map aliases to your modules. The importance here is that through extracting the business logic into modules you can serve different implementations. I've created a small GitHub Repo called durandal-multisite to explain in detail how you would proceed. The general idea is to: Keep the same viewmodels/views Extract businesslogic (should be anyway done to follow proper SoC) Create 2 main.js implementations (frontend/backend) The respective main.js setup a RequireJS map to the aliases requested by your viewmodels which then deliver the concrete module implementation
score: 2
downvote count: 0

http://stackoverflow.com/comment/38998866
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25067756
score: 0
has text: Are you sure, without any doubt that `$(this).parent()` references the correct span element (the one with class='usertag') ?

http://stackoverflow.com/q/24969006
has comment: http://stackoverflow.com/comment/38828156
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24969065
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24969030
accepted answer: http://stackoverflow.com/a/24969030
answer count: 4
has answer: http://stackoverflow.com/a/24969044
possible better answer: http://stackoverflow.com/a/24969065
type: AnsweredQuestion
tagged with: local-storage
type: Question
has title: How do I store a clicked list item in a session with JavaScript?
has comment: http://stackoverflow.com/comment/38815894
has answer: http://stackoverflow.com/a/24969041
score: 0
has body: My goal is to store the alert message in the session. How can I accomplish this? JavaScript $(document).ready(function(){ $("ul[id*=licity] li").click(function(){ alert($(this).text()); }); }); HTML Satara Karad Wai
has comment: http://stackoverflow.com/comment/38828140

http://stackoverflow.com/q/24965173
type: Question
has answer: http://stackoverflow.com/a/24965207
has body: I'm currently following the exercises from Eloquent Javascript and got a little stuck at one exercise. Let me explain it with code: var _numberArray = []; function range(start, end, step) { console.log(_numberArray); if (!step) { step = 1; } if (step &lt; 0) { for(var i = start; i &gt;= end; i -= step) { _numberArray.push(i); console.log(_numberArray); } } else { for(var i = start; i &lt;= end; i += step) { _numberArray.push(i); console.log(_numberArray); } } return _numberArray; } function sum(array) { var total = 0; for (var i = 0; i &lt; array.length; i++) { total += array[i]; } return total; } console.log(sum(range(42,14,-2))); So I created the range function where I check if the step argument has been set. If not, set the default step variable to 1. If step is smaller than 0, be sure to loop where as long as the first argument is bigger the second, and decrement the value with the step amount given. This is the same for incrementing. However, this code causes to crash only when I use negative values. So when I do "sum(range(22,6,-2));" the code crashes. The other way round "sum(range(6,22,2));" it does work. Also when I replace: for(var i = start; i &gt;= end; i -= step) { _numberArray.push(i); console.log(_numberArray); } For: for(var i = start; i &gt;= end; i--) { _numberArray.push(i); console.log(_numberArray); } It does work again! Can someone help me out and give me some understanding why it crashed and why the last method does work? Thanks.
tagged with: javascript
tagged with: for-loop
answer count: 3
has answer: http://stackoverflow.com/a/24965257
downvote count: 0
accepted answer: http://stackoverflow.com/a/24965207
favorite count: 0
has title: Javascript : The sum of its range
possible better answer: http://stackoverflow.com/a/24965257
score: 2
has answer: http://stackoverflow.com/a/39947087
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/a/24984821
type: Answer
has body: Javascript closure should help you: var HM = new window.HashManager(); $.each(ajaxURLS, function(_hash, _uri) { HM.on(_hash, (function(uri,hash) { console.log(uri); console.log(hash); })(_hash, _uri)); });
score: 0
answers question: http://stackoverflow.com/q/24984774

http://stackoverflow.com/q/25024534
favorite count: 0
has comment: http://stackoverflow.com/comment/38917228
tagged with: filter
has title: Narrowing displayed content by checkbox
has body: I am looking to modify this code so that the results displayed have the values of all checkboxes. For instance, by checking "computers" and "video-games" I would only have result 3. How would I make this change? Arts Computers Health Video Games Result 1 Result 2 Result 3 Result 4 $('div.tags').delegate('input:checkbox', 'change', function() { var $lis = $('.results > li').hide(); //For each one checked var numChecked = $('input:checked').each(function() { $lis.filter('.' + $(this).attr('rel')).show(); }).length; if (!numChecked) $lis.show(); }); http://jsfiddle.net/gZUrA/2/
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38919451
type: Question
has comment: http://stackoverflow.com/comment/38917129
score: 0
has answer: http://stackoverflow.com/a/25025665
accepted answer: http://stackoverflow.com/a/25025665
upvote count: 1
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24992802
tagged with: javascript
has answer: http://stackoverflow.com/a/24995686
favorite count: 0
tagged with: ember.js
has body: I'm using Pusher with EmberJS and Ember Data. To avoid the push notifications coming back to the same client, I would like to always send the Pusher socketId with each API call. I can get the socketId from within my controller's actions, but don't know how to send it back. e.g. var socketId = this.pusher.get('socketId'); var project = this.get("model"); project.save(); The problem is, the socketId will be different for each controller. So I can't do it directly in the adapter. Something like this would be ideal... var socketId = this.pusher.get('socketId'); var project = this.get("model"); project.ajaxParams = { socketId: socketId }; project.save();
type: AnsweredQuestion
upvote count: 2
accepted answer: http://stackoverflow.com/a/24995686
type: Question
has title: Sending additional parameters with Ember Data
tagged with: ember-data
score: 2
downvote count: 0
answer count: 1

http://stackoverflow.com/q/24995316
has answer: http://stackoverflow.com/a/24995479
linked to: http://stackoverflow.com/q/11030532
has comment: http://stackoverflow.com/comment/38861256
answer count: 2
score: 5
accepted answer: http://stackoverflow.com/a/24995506
has comment: http://stackoverflow.com/comment/38861486
tagged with: keyboard-shortcuts
tagged with: javascript
tagged with: keycode
favorite count: 0
has comment: http://stackoverflow.com/comment/38861434
upvote count: 5
has answer: http://stackoverflow.com/a/24995506
tagged with: keyboard-events
has comment: http://stackoverflow.com/comment/38861252
has comment: http://stackoverflow.com/comment/38861283
has comment: http://stackoverflow.com/comment/38861303
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38863404
has title: How to make difference between question mark ? and / for azerty keyboard
type: Question
has comment: http://stackoverflow.com/comment/38862924
possible better answer: http://stackoverflow.com/a/24995479
has comment: http://stackoverflow.com/comment/38862138
has body: When I bind the ? and the / key with javascript on qwerty keyboard they have the same keycode (191) but you have to press shift to do a ?. How can I tell which character was pressed on an azerty keyboard (layout shown below), as they're different keys, both require Shift, and I get the same keycode for them in keyup.: $(document).keyup(function(event) { if (event.which === 191) { action(); } }); (Original image is "KB France" by Yitscar (English Wikipedia) Michka B (French Wikipedia) Licensed under Creative Commons Attribution-Share Alike 3.0 via Wikimedia Commons - see use in the article linked above.)

http://stackoverflow.com/q/25045913
score: 0
has answer: http://stackoverflow.com/a/25045966
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38957260
answer count: 2
accepted answer: http://stackoverflow.com/a/25045966
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25046062
tagged with: click
has title: jquery click event to swap text not firing on first click but works after
possible better answer: http://stackoverflow.com/a/25046062
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38957622
has body: I'm new to javascript and jquery, and I have this little bit of code to swap one bit of text for another that works perfectly except for the very first time you click the div. Any ideas? I'm probably just calling on it wrong but not sure how to proceed Here's a fiddle: http://jsfiddle.net/pauljackson/4r8v6/ js: $(document).ready(function() { $("#showemail").click(function() { var $self = $(this); if ($self.text() == "Contact") $self.text("someguy@theinternet.com"); else $self.text("Contact"); }); }); html: &lt;div id="showemail"&gt; Contact &lt;/div&gt; css: #showemail:hover { cursor:pointer; } Thanks!

http://stackoverflow.com/comment/38910591
comment on: http://stackoverflow.com/q/25019704
score: 0
type: Comment
type: QuestionComment
has text: JScript and JavaScript are not the same. I don't believe you can get away with mixing languages.

http://stackoverflow.com/q/25014600
possible better answer: http://stackoverflow.com/a/25014732
tagged with: javascript
has answer: http://stackoverflow.com/a/25014732
answer count: 3
downvote count: 0
has body: I may have gone around the most convoluted way to achieve this (see code below). Could someone with experience tell me if there is a better way? I have two JSON objects resource and data. I want to loop over each new item in data and if the key matches in resource replace the value for that key in resource with the value in data. If this does not make sense the code I have below will. This works and does what I need it to do, but it does not feel right (don't laugh) factory.put = function (resource, data) { dataArr = [data]; resourceArr = [resource]; for (var i = 0; i &lt; dataArr.length; i++) { var obj = dataArr[i]; for (var key in obj) { var attrName = key; var attrValue = obj[key]; for (var i = 0; i &lt; resourceArr.length; i++) { var obj = resourceArr[i]; for (var key in obj) { var resourceArrName = key; var resourceArrValue = obj[key]; if (resourceArrName == attrName){ resource[resourceArrName] = attrValue } } } } } resource.put() }
accepted answer: http://stackoverflow.com/a/25014852
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38898197
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38897807
has comment: http://stackoverflow.com/comment/38897921
score: 1
has title: Can I simplify this Javascript loop?
has answer: http://stackoverflow.com/a/25014865
has comment: http://stackoverflow.com/comment/38897815
upvote count: 1
has comment: http://stackoverflow.com/comment/38897861
type: Question
has answer: http://stackoverflow.com/a/25014852

http://stackoverflow.com/comment/38723425
type: QuestionComment
comment on: http://stackoverflow.com/q/24921501
has text: you don't have to change anything in the fiddle! And yes, this is how FF implemented it but me and a lot of other people need it the other way... Chrome works the other way too.
score: 0
type: Comment

http://stackoverflow.com/comment/38862173
score: 0
comment on: http://stackoverflow.com/q/24952118
type: QuestionComment
has text: Why would a user manually be typing in a complex URL query string in the first place, brackets or not. Where does it come from?
type: Comment

http://stackoverflow.com/a/25041709
has body: The problem is that you are using heights to control the menu and the height is not properly calculated when you have sub elements with height equal to 0. I changed your code to use slideUp() and slideDown() and using display: none; instead of height: 0; and it worked. Here is a working demo.
has comment: http://stackoverflow.com/comment/38949110
score: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25041017
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38948934
accepted answer of: http://stackoverflow.com/q/25041017
downvote count: 0

http://stackoverflow.com/q/24911092
answer count: 1
tagged with: javascript
has title: HTML, Javascript. RegEx on numbers
favorite count: 0
has comment: http://stackoverflow.com/comment/38702628
has body: I have an input field for phone numbers. If the first number is 8, it should be automatically removed when a person types it. If a person starts writing a number with the first number of 0, 1, 2 ,3, 4, 5, 6, 7, 9 then it should do nothing, but if the first number is 8 and it goes like 865453 etc., than it should be instantly removed ( or that first number highlighted red ) by JavaScript.
tagged with: regex
score: -1
has comment: http://stackoverflow.com/comment/38702705
has answer: http://stackoverflow.com/a/24911168
downvote count: 1
type: AnsweredQuestion
type: Question
upvote count: 0
accepted answer: http://stackoverflow.com/a/24911168

http://stackoverflow.com/q/24981274
possible better answer: http://stackoverflow.com/a/24981287
has title: What does the ! (exclamation mark) mean before selector in jQuery
type: AnsweredQuestion
has body: I know already that the ! is used generally to express negation like no, not, and null in JavaScript. But what does the exclamation mark mean before a selector in jQuery? if(!$('selector').hasClass('something')){do something}
has answer: http://stackoverflow.com/a/24981412
accepted answer: http://stackoverflow.com/a/24981294
type: Question
duplicate of: http://stackoverflow.com/q/8012003
has comment: http://stackoverflow.com/comment/38834798
tagged with: syntax
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24981287
has answer: http://stackoverflow.com/a/24981294
tagged with: jquery-selectors
has comment: http://stackoverflow.com/comment/38834886
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38858300
type: Comment
comment on: http://stackoverflow.com/a/24993737
score: 0
type: AnswerComment
has text: how to check this php is exit or not? if exited that php file reult wants to shows in the same page

http://stackoverflow.com/comment/38927159
has text: @Ethan JWPlayer Can you guess what could be the problem?Video is playing fine in this case but audio is not.
comment on: http://stackoverflow.com/q/25014668
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38827796
type: QuestionComment
has text: I showed you how to do it in the first comment.
comment on: http://stackoverflow.com/q/24977159
score: 0
type: Comment

http://stackoverflow.com/comment/38703373
has text: see, I kinda knew the answer should be so simple... but when I look at the same bit of code for a while, my brain goes mush.... this seems to of worked just fine so thanks.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24911034

http://stackoverflow.com/q/25049699
has body: I have a total of two input values. Only one value passes to the url of the next page, but both should. What's causing this? JSFiddle: http://jsfiddle.net/p8dCC/ HTML: Brand Model
has answer: http://stackoverflow.com/a/25049774
has comment: http://stackoverflow.com/comment/38964230
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25049725
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25049804
has title: Input value not passing to URL
type: UnansweredQuestion

http://stackoverflow.com/comment/38871085
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24989102
type: Comment
has text: @glatiuden, I added a demo, see if that helps

http://stackoverflow.com/a/25029585
has body: Follow the naming conventions, You cannot start a function name with numbers Try as one, two, three Button Between script tags var x = 5; function three() { alert(x); }
score: 2
upvote count: 2
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25029546

http://stackoverflow.com/q/24915609
score: 1
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24915974
tagged with: javascript
linked to: http://stackoverflow.com/q/21012580
answer count: 2
possible better answer: http://stackoverflow.com/a/24917141
tagged with: http://stackoverflow.com/tag/csv
has answer: http://stackoverflow.com/a/24917141
downvote count: 0
has title: How to write to CSV file in Javascript
favorite count: 0
tagged with: jenkins
accepted answer: http://stackoverflow.com/a/24915974
has body: I have a script (using PhantomJS) that tests how long it takes to load a webpage. What I am trying to figure out is how to write the result of time taken to load the page to a .csv file. Then if I were to re-run the test again for it to add another result to the .csv file. code: var page = require('webpage').create(), system = require('system'), t, address; var pageLoadArray = []; var csvContents = ""; fs = require('fs'); if (system.args.length === 1) { console.log('Usage: loadspeed.js &lt;some URL&gt;'); phantom.exit(1); } else { t = Date.now(); address = system.args[1]; page.open(address, function (status) { if (status !== 'success') { console.log('FAIL to load the address'); } else { t = Date.now() - t; console.log('Page title is ' + page.evaluate(function () { return document.title; })); if(t&gt;7000){ console.log('Loading time was too long... ' + t + "msec"); pageLoadArray.push(t); console.log(pageLoadArray.length); console.log(pageLoadArray[0]); //store the time value to the .csv file phantom.exit(1); } else{ console.log('Loading time ' + t + ' msec'); pageLoadArray.push(t); console.log(pageLoadArray.length); console.log(pageLoadArray[0]); //store the time value to the .csv file } } phantom.exit(); }); }
type: AnsweredQuestion
tagged with: phantomjs

http://stackoverflow.com/a/24992390
type: Answer
downvote count: 0
has body: To do what you asked for you can do this with jquery: working fiddle var _li, _sections; $(function() { _li = $("#mymenu").find("li"); _sections = $("#wrapper").find(".section"); $(window).on('scroll', liBgs); }); function liBgs() { for (var i = 0; i &lt; _li.length ; i++) { var _litop = _li.eq(i).offset().top; for (var j = 0; j &lt; _sections.length; j++) { var $s = _sections.eq(j), _sectop = $s.offset().top, _secbottom = $s.offset().top+$s.height()-20; if (_litop &gt; _sectop &amp;&amp; _litop &gt; _secbottom) { var _color = rgb2hex($s.css('background-color')); _li.eq(i).find('a').css('color', (_color=="#ffffff") ? "#000000" : "#ffffff"); } } } } function rgb2hex(rgb) { rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); function hex(x) { return ("0" + parseInt(x).toString(16)).slice(-2); } return "#" + hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } NOTE: rgb2hex() function was taken from this question: How to get hex color value rather than RGB value? What this code does: I'm basically comparing positions of the menu li's to the sections, checking under what section each li is over everytime you scroll.. I'm not sure this is very efficient, but for something small scale it's ok.. if anyone knows how to make this even more efficient I'll be happy to learn.
score: 3
accepted answer of: http://stackoverflow.com/q/24991582
upvote count: 3
answers question: http://stackoverflow.com/q/24991582
type: AcceptedAnswer

http://stackoverflow.com/q/24958960
has body: I'm a bit lost with the following: When I do a console.log of two different arrays, one is giving me the actual length but not the other. Output of first array, with good length: [Object, Object, Object] 0: Object 1: Object 2: Object length: 3 __proto__: Array[0] Output of the second one, length should be 4 but is actually 0: [A: Object, B: Object, C: Object, D: Object] A: Object B: Object C: Object D: Object length: 0 __proto__: Array[0] Why do my first array do have a correct length, but not the second one ? Edit: this is the code generating the above output: var links = [ {source: "A", target: "B"}, {source: "A", target: "C"}, {source: "A", target: "D"} ]; var nodes = []; // Compute the distinct nodes from the links. links.forEach(function(link) { link.source = nodes[link.source] || (nodes[link.source] = {name: link.source}); link.target = nodes[link.target] || (nodes[link.target] = {name: link.target}); }); console.log(links); console.log(nodes);
has comment: http://stackoverflow.com/comment/38793112
has comment: http://stackoverflow.com/comment/38792824
has comment: http://stackoverflow.com/comment/38793475
answer count: 2
tagged with: arrays
has title: JavaScript array length issue
downvote count: 0
has comment: http://stackoverflow.com/comment/38793192
favorite count: 0
has comment: http://stackoverflow.com/comment/38794188
has answer: http://stackoverflow.com/a/24958994
has comment: http://stackoverflow.com/comment/38794429
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38793181
score: 3
has comment: http://stackoverflow.com/comment/38793207
linked to: http://stackoverflow.com/q/5223
upvote count: 3
duplicate of: http://stackoverflow.com/q/10563251
has comment: http://stackoverflow.com/comment/38793426
has comment: http://stackoverflow.com/comment/38793013
has comment: http://stackoverflow.com/comment/38793296
has comment: http://stackoverflow.com/comment/38793193
has answer: http://stackoverflow.com/a/24959346
type: Question
has comment: http://stackoverflow.com/comment/38792972
has comment: http://stackoverflow.com/comment/38793268
has comment: http://stackoverflow.com/comment/38794034
has comment: http://stackoverflow.com/comment/38792835
has comment: http://stackoverflow.com/comment/38792839
possible better answer: http://stackoverflow.com/a/24959346
accepted answer: http://stackoverflow.com/a/24958994
tagged with: javascript
has comment: http://stackoverflow.com/comment/38794463
has comment: http://stackoverflow.com/comment/38793208

http://stackoverflow.com/a/24976222
answers question: http://stackoverflow.com/q/24976171
type: Answer
has comment: http://stackoverflow.com/comment/38825537
upvote count: 1
has body: I just solved this here. It's a node project but the main file is dependency-less hence portable. Use the dynamic programming algorithm to compute the Levenshtein distance, and use that transform to generate the regex. Subsitutes become wildcards, inserts or deletes become optional characters. var Levenshtein = require('levenshtein-transformation)'; var lev = new Levenshtein(str1, str2); console.log(lev.regex());
has comment: http://stackoverflow.com/comment/38825500
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38825518

http://stackoverflow.com/comment/38935426
comment on: http://stackoverflow.com/a/25021964
type: Comment
has text: If the code that you coded is working.. then why can't you show me in a fiddle ?
score: 0
type: AnswerComment

http://stackoverflow.com/q/24934670
has answer: http://stackoverflow.com/a/24935746
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24935746
has body: I have a table with 4 rows that are repeated by a knockout foreach in the . The first row is a Basketball Match and the other 3 rows are the Task performers (referee etc) of the match. I have in the match row a hyperlink to a details page of the location of the sportshall in the city were the match will be played. The problem is that the performer rows can be expanded and collapsed. This all works fine but now the hyperlink is not working anymore because then the knockout click event is fired. When I do a right mouse click on the hyperlink and say "open in new tab" the hyperlink works fine. So the problem is that the row knockout click is overruling the hyperlink. Of course I can exclude the TD of the hyperlink and add the collapse click event to the other TDs but that is not what I want. Scheidsrechters , Scorer , Timer , Zaalwacht ,
type: AnsweredQuestion
has title: Hyperlink not working in table row with click event
has comment: http://stackoverflow.com/comment/38748228
tagged with: knockout.js
type: Question
tagged with: asp.net-mvc
tagged with: javascript

http://stackoverflow.com/comment/38894283
score: 0
type: AnswerComment
type: Comment
has text: `$(document).ready(function() { $(".block_overlay").overlay({ mask : '#fff', left: 'center' }); });` This is the function I use to call the overlay.. how would I incorporate the scrollbar update in to that?
comment on: http://stackoverflow.com/a/25012497

http://stackoverflow.com/comment/38935339
type: QuestionComment
comment on: http://stackoverflow.com/q/25034641
has text: There is no CSS code, this is the full HTML.
score: 0
type: Comment

http://stackoverflow.com/a/25051046
score: 0
has body: May be there is some problem with sequence or syntax. Try this code which I've checked and worked fine: trigger pop-up trigger secondPop-up
type: Answer
answers question: http://stackoverflow.com/q/25050768
has comment: http://stackoverflow.com/comment/38968300

http://stackoverflow.com/comment/38784278
has text: Yes, it is my dashboard template. I am using express-ejs-layout for my rendering.
comment on: http://stackoverflow.com/q/24952467
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38909744
type: QuestionComment
has text: When a `$scope` is destroyed, the `$$watchers` and `$$listeners` should be emptied by the framework, so I'm wonder why your workaround is working!?
comment on: http://stackoverflow.com/q/25015947
score: 0
type: Comment

http://stackoverflow.com/q/25050876
tagged with: javascript
answer count: 2
upvote count: 0
accepted answer: http://stackoverflow.com/a/25051663
favorite count: 0
has answer: http://stackoverflow.com/a/25051586
score: -3
has body: I am trying to solve a similar problem and running into issues. Javascript recursion completes before traversing the whole tree?. I have the same function listFiles but with two parameters. The second parameter is the folder name that is passed to this function. The function should return the filenames that fall under the passed foldername. For eg. if the folder name passed is 'js' then the function should return 5 files i.e - main.js', 'app.js', 'misc.js', 'jquery.js' and 'underscore.js'. Here is the code i am trying to write to achieve the result - function listSubfolder(fileSystem, subFolder){ var result = []; for(var i=0; i&lt;fileSystem.files.length; i++){ if(typeof fileSystem.files[i] !== 'string') { fileSystem = fileSystem.files[i]; findFiles(fileSystem); } } function findFiles(fileSystem) { var files = fileSystem.files; if (typeof files !== 'undefined') { for (var i = 0; i &lt; files.length; i++) { if (typeof files[i] === 'string') { result.push(files[i]); } else { findFiles(files[i]); } } } } return result; }
has title: Get the filenames from the folder structure with a specified folder name
possible better answer: http://stackoverflow.com/a/25051586
linked to: http://stackoverflow.com/q/14207496
tagged with: recursion
type: AnsweredQuestion
downvote count: 3
has answer: http://stackoverflow.com/a/25051663
type: Question

http://stackoverflow.com/q/24915279
has body: I've got the interesting (and theoretically impossible) task of getting AmazonAWS Kinesis analytics from IE 8 and 9. According to Amazon's own SDK, this is not possible since XDomainRequest does not allow custom headers. Contrary to this statement, however, AmazonAWS allows you to authenticate using query string parameters. My goal was to write a shim for XMLHttpRequest which utilized the XDomainRequest object and converted all Amazon headers into query string parameters. The actual implementation turned out to be much more difficult than I would have liked. Since Amazon's query string authentication only uses the "host" for SignedHeaders (whereas the AmazonAWS SDK was attempting to use host, date, and target) I had to re-compute the signature. This meant CryptoJS and lots of experimentation to get everything working. After 4 hours of receiving "Computed signature did not match", I finally started getting a different error code: Unable to determine service/operation name to be authorized Googling this error was not very helpful: anything from a typo to an extra new-line character to using a datestamp instead of a version number. However I tried everything and nothing helped. Below is an example cURL request and the return value: curl -H "Content-Type:text/plain" --data "{\"Data\":\"VALID BASE64 DATA\",\"PartitionKey\":\"PARTITION\",\"StreamName\":\"STREAM\"}" "https://kinesis.us-east-1.amazonaws.com/?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJMAGAYBGGRNZQI4A/20140723/us-east-1/kinesis/aws4_request&X-Amz-Date=20140723T153144Z&X-Amz-SignedHeaders=host&X-Amz-Target=Kinesis_20131202.PutRecord&X-Amz-User-Agent=aws-sdk-js/2.0.0&X-Amz-Signature=VALID_SIGNATURE" Return: Unable to determine service/operation name to be authorized I've tried appending Action and Version parameters (noting that the Version should be in YYYY-MM-DD format as opposed to YYYYMMDD) and this didn't help. I also tried escaping all of my / characters or escaping all of my . characters (or …
has comment: http://stackoverflow.com/comment/38868512
answer count: 1
tagged with: amazon-web-services
has answer: http://stackoverflow.com/a/31978497
accepted answer: http://stackoverflow.com/a/31978497
tagged with: authentication
has comment: http://stackoverflow.com/comment/38727547
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38872173
tagged with: javascript
tagged with: post
score: 0
has title: Post to AmazonAWS Kinesis Stream Using Query String Authentication

http://stackoverflow.com/a/25061281
answers question: http://stackoverflow.com/q/25061219
has comment: http://stackoverflow.com/comment/38985975
has comment: http://stackoverflow.com/comment/38987112
has comment: http://stackoverflow.com/comment/38986594
type: AcceptedAnswer
has body: It is called variable hoisting, where variable and function declarations are processed before the rest of the code is actually executed. Whenever a var is encountered in a non-global scope, a new variable is declared and initialized at undefined in that scope. Since if does not introduce a new (block) scope, var inside if shadows the var from the parent scope. Bonus: regarding your side question whether there are any other examples of JavaScript execution being influenced by unreachable code: Yes, but only in terms of performance. Modern JavaScript interpreters are quite sophisticated and try to optimize the interpreted code as much as possible. There are some constructs that result in a performance hit, even if it is within an unreachable code block. For example: for (var i=0; i&lt;100000000; ++i) ; // Busy loop if (false) { eval(); // BOOM - Killed optimizations. } Check out the benchmark: The snippet containing eval runs significantly slower than the one without: http://jsperf.com/eval-hurts-performance.
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/38985875
downvote count: 0
score: 3
accepted answer of: http://stackoverflow.com/q/25061219

http://stackoverflow.com/a/24928754
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24928380
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/24928380
has body: in many cases(Not in every case) will get you the URL of the last page if they got to the current page by clicking a link using document.referrer; See here You can also take help from here

http://stackoverflow.com/a/25068099
answers question: http://stackoverflow.com/q/25051893
score: 2
has comment: http://stackoverflow.com/comment/38999307
accepted answer of: http://stackoverflow.com/q/25051893
upvote count: 2
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39003803
has body: I created a report using the article below from Microsoft to convince management of the need to upgrade their browsers to the latest IE and that did the trick. http://blogs.windows.com/ie/2012/12/13/ten-reasons-why-internet-explorer-10-is-best-for-business/ I hope this helps someone else. And like Phil said, always remember to include Javascript in your requirements gathering.
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/39034605

http://stackoverflow.com/q/24945979
has body: I have to write a c# class that gets an html page's content (the page is public) and trigger a javascript function that downloads a file. My goal is to download the file and save it in a folder The page is a public html page that does not require login. The link looks like this : href="javascript:__doPostBack(&amp;#39;lbtSpreadsheet&amp;#39;,&amp;#39;&amp;#39;)" style="font-weight: 700"&gt;Export Results&lt;/a&gt; the doPostBack function contains the following code: function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } when you click the link manually, it submits the form and returns an excel sheet, the download dialog box opens to ask you where you need to save it. I want to do this automatically to get the excel sheet and then process it. I found out that I can find the links on a page like this: HtmlWeb hw = new HtmlWeb(); HtmlDocument doc = hw.Load(/* url */); foreach(HtmlNode link in doc.DocumentElement.SelectNodes("//a[@href]")) { } but how can I trigger the javascript in the link and save the file returned? Thank you
has answer: http://stackoverflow.com/a/24946150
type: Question
tagged with: c#
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38769352
has answer: http://stackoverflow.com/a/24946018
score: 0
has title: trigger javascript function using c#
has comment: http://stackoverflow.com/comment/38770893
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38769394

http://stackoverflow.com/comment/38955148
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25043625
type: Comment
has text: hmm... evething still the same... I tried @dragonslovetacos' code but doesn't workt too... I can't understand what's wrong with my code, yesterday everything worked fine..

http://stackoverflow.com/comment/38913554
score: 0
comment on: http://stackoverflow.com/q/25022168
type: Comment
type: QuestionComment
has text: Are you sure that's everything? I'm not getting any white space. Is this hosted on a site somewhere I could look at?

http://stackoverflow.com/a/25019608
has comment: http://stackoverflow.com/comment/38909573
has comment: http://stackoverflow.com/comment/38907494
has comment: http://stackoverflow.com/comment/38907915
has comment: http://stackoverflow.com/comment/38912490
has comment: http://stackoverflow.com/comment/38916312
score: 0
answers question: http://stackoverflow.com/q/25019475
has body: If you define authenticate as a method rather than as a function, it will work. You won't need to do var self = this; as suggested (correctly) above. That would make the class look like this: class UserService implements IUserService { data = { loginMessage: "" }; static $inject = [ '$http' ]; constructor( private $http ) { } private authenticate(): void { // This works this.data.loginMessage = 'Authenticating ...'; this.$http({ method: 'POST', url: '/Token', data: 'xxx', }) .success((data1, status, headers, cfg) =&gt; { // Here the this.data is undefined this.data.loginMessage = 'Okay'; }) }) }
has comment: http://stackoverflow.com/comment/38913959
has comment: http://stackoverflow.com/comment/38909339
type: Answer

http://stackoverflow.com/a/24919572
downvote count: 0
answers question: http://stackoverflow.com/q/24919121
type: Answer
has body: center attribute is required for creating maps using Google maps Javascript API, add center to your mapOptions and it will works fine.
upvote count: 1
score: 1

http://stackoverflow.com/q/25048264
tagged with: javascript
tagged with: ajax
score: 0
tagged with: xmlhttprequest
has title: getting info from xmlhttprequest
has body: this might be a simple question from a beginner so thanks for your understanding. With a php script I managed to get some info from my database. That's the info from a checkup of the variable which holds the data: XMLHttpRequest {statusText: "OK", status: 200, response: "[{"id":"3","login":"ada",...."phone":"123456789"}]", responseType: "", responseXML: null…} onabort: null onerror: null onload: null onloadend: null onloadstart: null onprogress: null onreadystatechange: function (){ ontimeout: null readyState: 4 response: "[{"id":"3","login":"ada","created":"2014-06-20 07:00:20","email":"f@o.pl","phone":"123456789"}]" responseText: "[{"id":"3","login":"ada","created":"2014-06-20 07:00:20","email":"f@o.pl","phone":"123456789"}]" responseType: "" responseXML: null ...etc... My question is how do I get to the data Im interested in? I tried $data.responseText but it doesn't work. Any ideas?
answer count: 0
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38975701
has comment: http://stackoverflow.com/comment/38961878
type: Question
has comment: http://stackoverflow.com/comment/38983185
has comment: http://stackoverflow.com/comment/38969368

html5-video
tags question: http://stackoverflow.com/q/24930553
tags question: http://stackoverflow.com/q/24935986
tags question: http://stackoverflow.com/q/25022168
tags question: http://stackoverflow.com/q/25045914
tags question: http://stackoverflow.com/q/24946295
tags question: http://stackoverflow.com/q/24933398
tags question: http://stackoverflow.com/q/25035454
tags question: http://stackoverflow.com/q/25007947
tags question: http://stackoverflow.com/q/25057622
tag name: html5-video
type: Tag
tags question: http://stackoverflow.com/q/25051336
tags question: http://stackoverflow.com/q/25055899
tags question: http://stackoverflow.com/q/24959729
tags question: http://stackoverflow.com/q/24916437

http://stackoverflow.com/a/25011776
has comment: http://stackoverflow.com/comment/38892877
has comment: http://stackoverflow.com/comment/38892818
has comment: http://stackoverflow.com/comment/38892737
has comment: http://stackoverflow.com/comment/38894034
has body: make a function that counts keys in object function isNotEmpty(obj){ var count = 0; for (var k in obj) { if (obj.hasOwnProperty(k)) { ++count; } } return count ? true : false; } and modify your if to if (isNotEmpty(this.NaEptStr(jsonStr))) But the simplest way to check if required field in object is present if(this.naEpStr(jsonStr).myRequiredField)
has comment: http://stackoverflow.com/comment/38892683
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38892592
answers question: http://stackoverflow.com/q/25011687

http://stackoverflow.com/comment/38935999
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25025630
has text: It looks like the problem is with the `addEventListener`. I added some `console.log`'s within the eventlistener, and none of them ran. But they did run when I put them outside the eventlistener. Any ideas?

http://stackoverflow.com/comment/38860439
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24994768
has text: I tried this. by default it is showing a pop up which is saying you want "leave this page" or "stay on this page" I dont need this pop up and i want show my own pop up in place of default. and it will work refresh also
type: AnswerComment

http://stackoverflow.com/q/25050608
has comment: http://stackoverflow.com/comment/38966097
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38965885
type: Question
has comment: http://stackoverflow.com/comment/38965988
has body: Edit: This question is about aligning to a baseline. Meaning the base of the characters (the bottom of character 'h'). When including 2 different font sizes of the text 'jh', being able to align them at baseline with div. I could not find any solution for aligning to a baseline grid on the internet. They all stink. Without a Javascript framework or css preprocessor. This makes no sense if the proportion of the font below the baseline is known. For the code linked below: Change .text2 font-size to 22px, and observe the two text groups are no longer aligned at the baseline (the bottom of the 'h'). Change it back to 32 px and they are aligned. Given the .bottomalign class has em units, both fonts are in arial, and em refers to font size, the descenders of the 'j' would be an equal proportion in both text groups, so any ideas why it dosnt align big genius if you no the answer. will be giving bounty if no one knows this. http://jsfiddle.net/FX5zq/ css: .bottomalign { position: absolute; float: left; bottom: -.24em; } .container { position: relative; height: 50px; overflow: visible; } div { font-family: arial; } .text1 { font-size: 16px; } .text2 { font-size: 32px; margin-left: 2px; color: green; } html: jh jh
has comment: http://stackoverflow.com/comment/38965892
has comment: http://stackoverflow.com/comment/38966147
possible better answer: http://stackoverflow.com/a/25052715
has comment: http://stackoverflow.com/comment/38966163
has title: align to baseline grid css
has answer: http://stackoverflow.com/a/25103184
score: 0
has answer: http://stackoverflow.com/a/25183319
has comment: http://stackoverflow.com/comment/38966042
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25103184
favorite count: 0
has comment: http://stackoverflow.com/comment/38965873
answer count: 5
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38967768
has comment: http://stackoverflow.com/comment/38965837
tagged with: css
has comment: http://stackoverflow.com/comment/38965859
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38965850
has answer: http://stackoverflow.com/a/25127006
has answer: http://stackoverflow.com/a/25214411
has answer: http://stackoverflow.com/a/25052715
has comment: http://stackoverflow.com/comment/38968017
has comment: http://stackoverflow.com/comment/38966192

http://stackoverflow.com/comment/38820332
comment on: http://stackoverflow.com/a/24973347
type: Comment
score: 0
has text: @blex yeah it works me to , I checked it again with chrome and it worked . Is this code work on mozila firefox too ?
type: AnswerComment

http://stackoverflow.com/q/25051733
has answer: http://stackoverflow.com/a/25051994
favorite count: 0
has comment: http://stackoverflow.com/comment/38967951
has body: In the following example the j++ both acts as a variable and a function var j = 0; var arr = []; arr[j++] = "a1"; arr[j++] = "a2"; console.log(arr[0]); console.log(arr[1]); is there a way to write this without using the ++ like: function addx(i) { return i+1; } var j=0; arr[addx(j)] = "a1"; arr[addx(j)] = "a2"; the issue is that i can only change the space between the brackets []. I'm not allowed to declare the j variable above the function and update it within so this solution is not acceptable. var j=0; function addx(i) { j = i+1; return j-1; } arr[addx(j)] = "a1"; arr[addx(j)] = "a2"; In Pascal you can declare the function like function addx(var i:integer) : integer; in which case the parameter would be the variable so having i := i+1; inside the function would update the calling variable too.
accepted answer: http://stackoverflow.com/a/25051781
has title: Javascript replace ++.-- when used as a parameter with a function call that both updates the variable and returns it
has comment: http://stackoverflow.com/comment/38968054
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38967993
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25052018
possible better answer: http://stackoverflow.com/a/25051803
has comment: http://stackoverflow.com/comment/38967908
has comment: http://stackoverflow.com/comment/38968102
has comment: http://stackoverflow.com/comment/38967921
has answer: http://stackoverflow.com/a/25051803
has comment: http://stackoverflow.com/comment/38967927
score: -1
has answer: http://stackoverflow.com/a/25051781
upvote count: 0
linked to: http://stackoverflow.com/q/7744611
tagged with: javascript
tagged with: variables

http://stackoverflow.com/a/29034262
has body: Have you considered that the input images may not be valid? After some digging I'm discovering that Node Canvas gives some pretty misleading error messages, so "Image has not completed loading" could potentially point to a range of errors related to the image file. See https://github.com/Automattic/node-canvas/issues/486 I'm stuck on this issue too, so will keep digging and will post here if I find more. EDIT: You can easily install Node and the resemble package without installing JPG support, and you won't be warned that JPGs aren't supported. Unfortunately it looks like adding JPG support is a real pain point currently; see https://github.com/Automattic/node-canvas/issues/289 EDIT 2: Just found a Node-Canvas wiki page that specifically names this problem and explains that it means the libjpeg package is missing. Install that package, then recompiling Node-Canvas. See more at https://github.com/Automattic/node-canvas/wiki/installation---osx
answers question: http://stackoverflow.com/q/24944987
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/24995567
has comment: http://stackoverflow.com/comment/38862583
has comment: http://stackoverflow.com/comment/38862027
score: 0
has body: In order to do what you want there are a couple of options 1) create a partial view as @Satpal suggests and have that return the HTML of the table, and fetch that with jQuery in the way you have done (rather than return JSON) 2) Return the filtered JSON (as you have done) and itterate through it in the success function in order to dyanmically build replacement html, and drop that into the table Option 1) will transmit more data, but be slightly easier to write (as you have use MVC views to re-build the table) Option 2) wlll only send JSON over the wire, so will be lighter, but will need to you build the HTML dynamically.
has comment: http://stackoverflow.com/comment/38862239
type: Answer
answers question: http://stackoverflow.com/q/24995430

http://stackoverflow.com/q/25005958
tagged with: node.js
has body: I'm trying to write a simple client/server implementation to transfer image data between a browser and node.js server using BinaryJS websockets. Following the api examples I've come up with something that appears to work, however it seems to be leaking memory as the usage reported by 'top' for the node process continually increases. I'm not very familiar with javascript debugging, but using nodetime it appears to me as though none of the objects created are being garbage collected. My basic code is as follows: Server: var BinaryServer = require('binaryjs').BinaryServer; var fs = require('fs'); var server = BinaryServer({port: 9000}); server.on('connection', function(client){ console.log('Connection'); client.on('stream', function(stream){ stream.on('data', function(data) { var file = fs.createReadStream(data['path']); client.send(file, {'target':data['target']}); }); }); }); Client: var client = new BinaryClient('ws://example.com:9000'); var controlStream; function loadImage(target, src) { controlStream.write({'path':src, 'target':target}); } client.on('open', function(){ controlStream = client.createStream(); }); client.on('stream', function(stream, meta){ var parts = []; stream.on('data', function(data){ parts.push(data); }); stream.on('end', function(){ $('#'+meta['target']+' img').attr('src', (window.URL || window.webkitURL).createObjectURL(new Blob(parts))); }); }); My understanding is this: the client opens a connection to the server, then creates a stream for sending requests. Upon receiving data from this stream, the server opens a FileStream with the requested path and pipes the data through a new stream to the client. When this finishes, the client update a page element with the data. What am I missing here?
upvote count: 3
accepted answer: http://stackoverflow.com/a/25148194
has title: binaryjs websockets leaking memory
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25118765
has answer: http://stackoverflow.com/a/25118765
type: AnsweredQuestion
score: 3
downvote count: 0
tagged with: websocket
favorite count: 0
has answer: http://stackoverflow.com/a/25148194
type: Question
answer count: 2

http://stackoverflow.com/comment/38699393
has text: So your server responds with a 403 Forbidden error? What's that got to do with Javascript? Maybe you should detail what backend you're using.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24909326
type: QuestionComment

http://stackoverflow.com/comment/38823598
score: 0
type: QuestionComment
has text: It seems dont help( I would want that firefox show .slider-side block width 40%, and img into it with width 100% (100% of 40%).
type: Comment
comment on: http://stackoverflow.com/q/24974554

http://stackoverflow.com/q/24923904
type: UnansweredQuestion
score: 1
favorite count: 0
has body: I have an application controller that is responsible for adding users to another Model. There are two ways to add users in my application. We can add them by selecting the users themselves, or by selecting an entire group which will add all of the users of that group. To make the UI a bit more friendly, I thought it would be a good idea to have tabs for adding users individually and through groups... that way I don't have to show both forms at the same time - the user can flip between the forms using tabs. To implement tabs, I am using Angular Directives, since I use these tabs in other places in my application. Here is the html code to show you how the tabs are implemented: Select Users Here: Add Users Select Groups Here: Add User Groups In the controller for this HTML, I'd love to get access to the tab-pane's ng-model values for selectedUsers and selectedUserGroups. I would have thought that since they are defined as transcludes, that the scope would be the application's controller itself, but I think the scope value is actually in the tab-pane directive's scope. This means that in my main application controller, $scope.selectedUsers and $scope.selectedUserGroups is not defined. If I temporarily remove the tabs and tab-pane directives, everything in the main controller works. So I think those directives are hidding ng-model when they are transcluded within a tab-pane. How do I get access to it?
type: Question
has comment: http://stackoverflow.com/comment/38727542
has title: AngularJS : How do you access ng-model's scope value within a directive that is using transclusion?
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38727470
has comment: http://stackoverflow.com/comment/38727517
upvote count: 1
has comment: http://stackoverflow.com/comment/39058063
tagged with: angularjs-scope
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/38727413
tagged with: transclusion
answer count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/38727777
tagged with: javascript

http://stackoverflow.com/comment/38907856
comment on: http://stackoverflow.com/a/25006601
score: 0
type: Comment
has text: Why are you explicitly returning a `$q.reject`? Rejections are like exceptions, that's a beauty of it - they propagate so you don't have to manually like you do with callbacks :)
type: AnswerComment

http://stackoverflow.com/a/25020603
type: Answer
answers question: http://stackoverflow.com/q/25019926
downvote count: 1
score: -1
accepted answer of: http://stackoverflow.com/q/25019926
upvote count: 0
type: AcceptedAnswer
has body: Using jQuery, you can move through the #scroll pretty easily: DEMO You can adjust the newMargin values based on margins/padding of the LI elements $(function(){ $('#scroll_arrowleft').on("click",function(){ var newMargin = 0; switch (parseInt($('#scroll ul').css("margin-left"),10)) { case 0: newMargin = -2760; break; case -920: newMargin = 0; break; case -1840: newMargin = -920; break; case -2760: newMargin = -1840; break; default: newMargin = 0; } var newMargin = newMargin + "px" $('#scroll ul').animate({marginLeft:newMargin}); }); $('#scroll_arrowright').on("click",function(){ var newMargin = 0; switch (parseInt($('#scroll ul').css("margin-left"),10)) { case 0: newMargin = -920; break; case -920: newMargin = -1840; break; case -1840: newMargin = -2760; break; case -2760: newMargin = 0; break; default: newMargin = 0; } var newMargin = newMargin + "px" $('#scroll ul').animate({marginLeft:newMargin}); }); });

http://stackoverflow.com/comment/38844115
type: Comment
type: QuestionComment
has text: @Brad: If you find an appropriate one, please vote to close as a duplicate.
score: 0
comment on: http://stackoverflow.com/q/24986020

http://stackoverflow.com/a/25034805
score: 3
upvote count: 3
has body: Try, $('.edit,.done').click(function () { var section = $(this).siblings('.edit-section'); var isEdit = $(this).is('.edit'); section.prop('contenteditable',isEdit).css('border',isEdit?"2px solid":"none"); $('.edit').toggle(!isEdit); $('.done').toggle(isEdit); if(isEdit){section.focus(); document.execCommand('selectAll',false,null); } }); DEMO Source
accepted answer of: http://stackoverflow.com/q/25034611
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25034611

http://stackoverflow.com/a/24966647
type: Answer
upvote count: 1
downvote count: 1
answers question: http://stackoverflow.com/q/24962863
score: 0
has body: Since you are using Braintree's Client-side Encryption flow, according to their documentation, you cannot access the unencrypted version of the sensitive information (i.e. credit card numbers). This is done on purpose, so that you can reduce security risks and maintain PCI compliance. Braintree states in this post: Once the user presses the “Submit” button on the form containing their credit card information, you use a Braintree-provided JavaScript library to encrypt sensitive fields before the form is ever posted to your server. The sensitive non-encrypted data is not included on the form that is submitted and, therefore, will never pass through your system. However, all other fields will be available to you. This means you can perform custom validations, formatting, and logging to your heart’s content without exposing yourself to the security risk and extra PCI compliance requirements of having unencrypted credit card data passing through your environment. Also note that there is no way to decrypt the data either as you do not have access to the decryption keys. If you want to gain access to the actual sensitive credit card data then I think you'll have to take a different approach. The Server-to-Server flow looks like your best bet. Braintree states: S2S works in a similar fashion to accessing any API over HTTP. First, you create a form on your website where the user enters their credit card data, billing information, etc. When the user submits the form, the contents are sent to your server. Using the data you’ve received, you make an API call to Braintree using one of their client libraries, check the result and display necessary information to your user.

http://stackoverflow.com/q/24979943
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38832493
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24980206
downvote count: 0
tagged with: javascript
favorite count: 0
possible better answer: http://stackoverflow.com/a/24980000
has title: Extract JSON data and embed in HTML
has answer: http://stackoverflow.com/a/24980000
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24980206
has body: I'm trying to use an API which outputs the results as JSON. The output of the JSON is like this: "status": "ok", "registry": { "id": 110915, "name": "John", "enlisted": 1359114500 } From that output, I'd like to extract the name and print it with php/html. How to do this? I tried stuff like iframe, but that didn't work.
upvote count: 1
tagged with: php
type: AnsweredQuestion
score: 1

http://stackoverflow.com/q/25003028
has body: Okay, so I've read like 20 other questions asked here and elsewhere on the web concerning a similar thing, but it all ended up being that they didn't like, set a variable properly and assumed the clearInterval was based on a function ID or some such thing. Here's what I've got (there's more, but it's rather lengthy and from I understand this is the important bit): var fan1 = function () { var f1 = setInterval("flare1baserotate()",10); setTimeout("clearInterval(f1)",2000); }; Basically, the "fan1()" function gets called properly, the setInterval runs properly, as the "flare1baserotate()" function properly runs and rotates my object every 10 milliseconds, but the problem comes in where "clearInterval(f1)" doesn't run properly after 20 seconds as I feel it should. What do I have to do to get it to clear after 20 seconds?
type: Question
tagged with: javascript
upvote count: 2
answer count: 2
possible better answer: http://stackoverflow.com/a/25003056
has answer: http://stackoverflow.com/a/25003056
tagged with: setinterval
favorite count: 0
tagged with: clearinterval
accepted answer: http://stackoverflow.com/a/25003310
has title: clearInterval not working, Interval Undefined
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25003310
tagged with: settimeout
downvote count: 0

http://stackoverflow.com/q/24932687
has answer: http://stackoverflow.com/a/24933589
type: Question
score: -1
has answer: http://stackoverflow.com/a/24934455
has comment: http://stackoverflow.com/comment/38743423
answer count: 2
downvote count: 1
has title: Upload image with preview
has body: Im in the making of creating an upload feature for forum users, so they can upload a personal picture. What i got so far: HTML Profile image JAVASCRIPT function showPhotoPreview() { var photoUrl = $.trim($("#photo").val()); var img = $("#photoPreview img"); if (photoUrl != "") { if (img.length == 0) { img = $(" ").appendTo($("#photoPreview")); } img.prop("src", photoUrl); } else { img.remove(); } } function changePhoto(sender) { var value = $(sender).val(); sender.selectedIndex = 0; switch (value) { case "upload": assignPicture(); break; } showPhotoPreview(); return false; } function assignPicture() { var forumPhoto = $("#forumPhoto").val(); if (forumPhoto == "") { alert("You must specify an address to use forumPhoto."); return; } $("#photo").val(forumPhoto); } The current issue is that it doesnt show up in the preview picture. JsFiddle: http://jsfiddle.net/qLsY7/
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38745098
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/38892399
score: 0
type: Comment
type: QuestionComment
has text: All I need to append my li value from checklist to my li of append-checklist once my checklist li has class active. Similarly if the active class is removed from the li the values should also removed from the append-checklist li.
comment on: http://stackoverflow.com/q/25011615

http://stackoverflow.com/comment/38808461
has text: That has an error because I'm not sure the `)` was supposed to be there after `player }`, but I deleted that and it doesn't work.
type: Comment
comment on: http://stackoverflow.com/a/24966902
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38806350
comment on: http://stackoverflow.com/a/24965832
type: AnswerComment
has text: Does featherlight load the select menus after the page is loaded? Via ajax?
type: Comment
score: 0

http://stackoverflow.com/comment/38707655
comment on: http://stackoverflow.com/q/24913564
score: 6
type: QuestionComment
has text: Welcome to Internet Explorer.
type: Comment

http://stackoverflow.com/q/25015966
type: AnsweredQuestion
has body: form.parse() never called, when i delete bodyparser then it, my session variable throughs error , how to make it work logcat write(string, encoding, offset, length) is deprecated. Use write(string[, offset[, length]][, encoding]) instead. events.js:85 throw er; // Unhandled 'error' event ^ Error: ENOENT, open '/home/pitu/CODING/NODE-PROJECTS/chichat/files/a88b7a4fbd8cb31e276ef60c8e934d2d.png' at Error (native) app.js file var express = require('express'), app = express(), http = require('http'), path = require('path'), fs = require('fs'), mysql = require('mysql'), server = http.createServer(app), //events = require('events'), //path = require('path'), //url = require('url'), //Create a new store in memory for the Express sessions sessionStore = new express.session.MemoryStore(), passport = require('passport'), flash = require('connect-flash'), useragent = require('express-useragent'), cookieParser = express.cookieParser('hjnjnm'), io = require('socket.io').listen(server); // configuration =============================================================== // connect to our database require('./config/passport')(passport); // pass passport for configuration app.configure(function() { // set up our express application app.use(express.logger('dev')); // log every request to the console app.use(cookieParser); // read cookies (needed for auth) app.use(useragent.express()); app.use(express.methodOverride()); app.use(express.bodyParser({keepExtensions:true,uploadDir:path.join(__dirname,'/files')})); app.set('view engine', 'ejs'); // set up ejs for templating // required for passport app.use(express.session({store: sessionStore,key: 'myuser.sid',cookie: { secure: false,maxAge:3600000}} )); // session secret1 app.use(passport.initialize()); app.use(passport.session()); // persistent login sessions app.use(flash()); // use connect-flash for flash messages stored in session app.use(express.static(path.join(__dirname, 'public'))); app.all('*', function(req, res, next) { res.header("…
tagged with: formidable
score: -1
answer count: 1
tagged with: javascript
tagged with: express
favorite count: 0
has answer: http://stackoverflow.com/a/25152370
accepted answer: http://stackoverflow.com/a/25152370
has title: form.parse() is never invoked in node.js
linked to: http://stackoverflow.com/q/14720765
tagged with: node.js
upvote count: 0
downvote count: 1
type: Question

http://stackoverflow.com/comment/39101146
type: Comment
comment on: http://stackoverflow.com/a/25029406
has text: do you know why? Is it because it isn't in a form?
score: 0
type: AnswerComment

http://stackoverflow.com/comment/40081070
comment on: http://stackoverflow.com/a/25053808
type: AnswerComment
has text: can you post the config that solved the issue? your answer is not very helpful otherwise
type: Comment
score: 4

http://stackoverflow.com/comment/38884525
type: Comment
type: QuestionComment
has text: @mason : i realized that iframes is not a good option, so using modal window popup now.. if you can suggest any other solution, then that would be great
comment on: http://stackoverflow.com/q/25003328
score: 0

http://stackoverflow.com/q/24912659
has title: Is it possible to detect being inside of a chrome app?
has comment: http://stackoverflow.com/comment/38706603
has body: I have written a chrome extension that should embed itself on most pages; however, chrome applications (such as slack, google hangouts, etc.) still have my extension embedded on the page. Is it possible to detect that I am running inside a chrome app (or, basically, anywhere that chrome defaults to not showing a website url) via javascript so I can not embed my script?
score: 3
has comment: http://stackoverflow.com/comment/39834701
has comment: http://stackoverflow.com/comment/38718093
type: Question
has comment: http://stackoverflow.com/comment/38706495
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/25513994
upvote count: 3
tagged with: google-chrome-app
has comment: http://stackoverflow.com/comment/38706018
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/39832547
has comment: http://stackoverflow.com/comment/38707434
favorite count: 0
has comment: http://stackoverflow.com/comment/38716942
downvote count: 0
type: UnansweredQuestion
tagged with: google-chrome

http://stackoverflow.com/comment/38992054
type: QuestionComment
comment on: http://stackoverflow.com/q/25064555
score: 1
has text: Where are you fetching `eventTime` from? What is that second code paragraph supposed to do, and why is it in that scope?
type: Comment

http://stackoverflow.com/comment/38865706
comment on: http://stackoverflow.com/q/24996921
type: Comment
type: QuestionComment
score: 0
has text: You don't need " $(function () { }); " part. The whole thing is already inside document ready instance. The way you are accessing your highcharts within your getJson function is incorrect. Check your console. You can access the chart by storing it in a variable something like var myChart=$("#container").highcharts(); then update it using this variable.

http://stackoverflow.com/q/25038670
has comment: http://stackoverflow.com/comment/38943282
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38943178
possible better answer: http://stackoverflow.com/a/25038713
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/38943071
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25038735
favorite count: 0
score: 0
has title: onclick event works only on first product it doesn't work on other fetched data
has body: I am developing shopping cart in codeigniter where I am fetching data from data base and when user clicks on add to cart the the data related to current item which is clicked by user get store in jQuery variables now I am facing problem that onclick event works only on first fetched item and on the rest it won't works and I am confuse why it's not working. Here is my code. <?php if(isset($products)) { foreach($products as $row) { ?> <a href="products/<?=$row->sub_c_id?>/<?=$row->pid?>"> <img id="imgslct" alt="<?=$row->pname?>" height="173" width="144" src="<?php echo base_url(); ?>uploads/<?=$row->product_pic?>"> <?=$row->pname?> price : <?=$row->pprice?> <input type="hidden" id="pquan" value="<?=$row->pquantity;?>"> Add to cart <?php } } ?> Here is JQuery code.
downvote count: 2
answer count: 3
has answer: http://stackoverflow.com/a/25038713
has answer: http://stackoverflow.com/a/25038735
has answer: http://stackoverflow.com/a/25039110

ruby-on-rails-4
type: Tag
tags question: http://stackoverflow.com/q/24969627
tags question: http://stackoverflow.com/q/24923383
tag name: ruby-on-rails-4
tags question: http://stackoverflow.com/q/24988738
tags question: http://stackoverflow.com/q/24967990
tags question: http://stackoverflow.com/q/24951991

http://stackoverflow.com/a/24967757
has body: Would you please right click on the browser, select Inspect Element, select console tab and refresh the page and check if any error is shown in console when that page is used for like box? Did s/he edit the age restriction? If yes, please ask him/her to select Anyone 13+ for the page. Fix this problem first. I tried using chrome and got some errors please check it out. If not then the facebook page might have to change country restrictions. If you don't see the box on a certain browser check to make sure you are logged into facebook on that browser. [This article explains what might possibly be your problem.] (http://www.andreavahl.com/facebook/why-your-facebook-like-box-is-not-showing-up.php)
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24967685
score: 1
upvote count: 1

http://stackoverflow.com/comment/38763855
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24943041
has text: @user3799837 No worries.
score: 0

http://stackoverflow.com/comment/38932611
type: Comment
comment on: http://stackoverflow.com/a/25011821
type: AnswerComment
has text: Oh my... Please read about [`document.write()`](https://developer.mozilla.org/en-US/docs/Web/API/document.write) to learn, what it does after the page has been parsed ... Also I'm not sure, if `dw()` is still blocked at jsFiddle.
score: 0

http://stackoverflow.com/a/24951369
has comment: http://stackoverflow.com/comment/38779213
answers question: http://stackoverflow.com/q/24951328
has body: in order to use the z-index proprety you have to define the position of the div in css to either : absolute,relative or fixed
type: Answer
has comment: http://stackoverflow.com/comment/38779122
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/a/24967951
type: Answer
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38810363
has body: You ought to be converting special chars on the upstream rather than the downstream. Converting it on the upstream saves time later when an inexperienced developer does not care to escape the data on the downstream when sent to the client. Since you have not properly converted the data on the upstream, you have no choice. You should escape it. share_it(escape(data_from_mysql_database)); Example" &gt; escape("You're awesome"); 'You%27re%20awesome' &gt;
accepted answer of: http://stackoverflow.com/q/24967903
score: -1
has comment: http://stackoverflow.com/comment/38810209
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24967903

pagination
tags question: http://stackoverflow.com/q/25000380
tag name: pagination
tags question: http://stackoverflow.com/q/25033183
type: Tag

http://stackoverflow.com/comment/38793296
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24958960
has text: @MarkReed at least in Chrome, `var arr = []; arr['b'] = "test"; console.log(arr);` produces output with that notation.
score: 0

http://stackoverflow.com/a/25047511
has comment: http://stackoverflow.com/comment/38960642
score: 2
has comment: http://stackoverflow.com/comment/38960562
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25047439
answers question: http://stackoverflow.com/q/25047439
type: Answer
has comment: http://stackoverflow.com/comment/38960290
upvote count: 2
has body: Try adding onsubmit="openPopupFunctionHere()" to your form tag. The onsubmit event will be triggered whenever the form should submit, which happens when you press the "Calculate" button.
has comment: http://stackoverflow.com/comment/38964327

http://stackoverflow.com/a/25057331
has comment: http://stackoverflow.com/comment/39008513
has comment: http://stackoverflow.com/comment/38983084
type: Answer
has comment: http://stackoverflow.com/comment/38978781
has body: Define a global variable and assign returned json to that variable then you can use that value anywhere in the page. Var datarow; $.ajax({ ..., success: function(dataJson) { datarow=dataJson } }); $("#yourHtmlId").html(''+datarow.firstValue);
has comment: http://stackoverflow.com/comment/39007127
score: 0
answers question: http://stackoverflow.com/q/25051707
has comment: http://stackoverflow.com/comment/38978480

http://stackoverflow.com/comment/38811864
type: AnswerComment
type: Comment
has text: can you please show me the same code inside PHP Echo? I guess the quotesare being messed up inside Echo, outside it works fine..
comment on: http://stackoverflow.com/a/24968855
score: 0

http://stackoverflow.com/comment/38795500
type: QuestionComment
has text: Well, it works on thoses 2 elements now but the fade at the same time.
comment on: http://stackoverflow.com/q/24959762
score: 0
type: Comment

http://stackoverflow.com/a/24961218
has comment: http://stackoverflow.com/comment/39582913
answers question: http://stackoverflow.com/q/24960936
has comment: http://stackoverflow.com/comment/38804620
score: 0
has body: Say "No" to parsing HTML with regex! Here is another approach, simple and elegant: var text = $('p[align]:last').text(); console.log(text.replace('CONDITION :', '')); Shows: Approximate tread: 8-9/32About 80-90% of tread life left. See fiddle. UPDATE: Since there are multiple content divs on the page, I've amended my code as follows: var texts = []; $('div.content').each(function() { texts.push($('p[align]:last font:last', this).text()); }); See updated fiddle.
type: Answer

http://stackoverflow.com/a/25020462
answers question: http://stackoverflow.com/q/24964807
type: Answer
score: 0
type: AcceptedAnswer
has body: Solved using jquery var ContactUs = (function() { jQuery('#exportcc &gt; li:nth-child(1) &gt; a').click(function () { var url = jQuery('#exportcc &gt; li:nth-child(1) &gt; a').data('url'); jQuery.get(url, function(data) { jQuery('#contactUsModalContent &gt; .modal-content').html(data); jQuery('#contactUsModal').modal('show'); }); }); });
accepted answer of: http://stackoverflow.com/q/24964807

http://stackoverflow.com/q/25030466
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38927778
upvote count: 1
has comment: http://stackoverflow.com/comment/38930773
has title: onbeforeunload event parameter and empty return value
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38927746
downvote count: 0
tagged with: javascript
tagged with: dom-events
has comment: http://stackoverflow.com/comment/38927798
favorite count: 0
linked to: http://stackoverflow.com/q/276660
tagged with: confirm
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38927718
has body: Q1: I have seen the following code in most sources: window.onbeforeunload = function () { return 'You might lose your data!'; }; For example: beforeunload | onbeforeunload event (Internet Explorer) onbeforeunload event | beforeunload event JavaScript javascript - How can I override the OnBeforeUnload dialog and replace it with my own? - Stack Overflow But on MDN the function has an extra parameter: (e). Why is that, what is the difference, and which is right? Q2: It seems that any browser has a default confirmation message that you cannot customize. Chrome, for example, displays: Are you sure you want to leave this page? Can I content myself to this message and leave the return value empty: return '';
tagged with: onbeforeunload
has comment: http://stackoverflow.com/comment/38927801
answer count: 0

http://stackoverflow.com/q/25001263
score: -1
tagged with: sorting
has answer: http://stackoverflow.com/a/25001575
answer count: 3
linked to: http://stackoverflow.com/q/1069666
upvote count: 0
has answer: http://stackoverflow.com/a/25001335
has comment: http://stackoverflow.com/comment/38872586
has comment: http://stackoverflow.com/comment/38872506
favorite count: 0
has comment: http://stackoverflow.com/comment/38872548
has comment: http://stackoverflow.com/comment/38872560
has title: Unable to sort a JavaScript object by id
type: UnansweredQuestion
has body: My JavaScript object needs to be sorted in a reverse fashion based on id's. Here is my JavaScript object: var model.todos = { 1:{"id":1,"text":"ksjdv;lv","completed":false}, 2:{"id":2,"text":"lsakckcv","completed":false}, 3:{"id":3,"text":"sakvalvs","completed":false} } When I try to sort as specified below I get "uncaught type error undefined is not a function" error sortId.addEventListener('click',function(){ todos.sort(sortItems);&lt;================//get uncaught type error undefined is not a function error redrawUI(model); }, false); function sortItems(a, b) { return( b.id - a.id); } any pointers
duplicate of: http://stackoverflow.com/q/1069666
has comment: http://stackoverflow.com/comment/38872525
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25001418
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/131294055
has text: You don't say what server that code for. Is it Apache?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25051902

http://stackoverflow.com/q/25066989
tagged with: forms
type: Question
score: -2
has answer: http://stackoverflow.com/a/25067409
tagged with: javascript
has answer: http://stackoverflow.com/a/25067309
has comment: http://stackoverflow.com/comment/38997196
answer count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/38997010
favorite count: 0
type: UnansweredQuestion
has body: I'm new to web design, and I have a question about cache. I have a page called buy-form.php that gets form data from form.php. I want it to have the cache error that makes Google Chrome read "Confirm Form Submission" when the is page accessed manually. For example, I only want the page to be accessible when form data is submitted. If someone were to type in the page on the address bar, it should have an error.
tagged with: php
upvote count: 0
has title: Confirm Form Submission
has comment: http://stackoverflow.com/comment/38996888

http://stackoverflow.com/q/25023637
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38915766
answer count: 0
downvote count: 0
score: 1
favorite count: 0
tagged with: angularjs
type: Question
has title: angularjs post variables are null in php file
tagged with: php
upvote count: 1
linked to: http://stackoverflow.com/q/15485354
has body: I have an http post operation in javascript side lie this: app.controller("ContactController", ["$scope","$http", function($scope, $http){ $scope.sendForm = function(){ var httpOptions = { url: "contact.php", method: "POST", data: { name: $scope.name, email: $scope.email, message: $scope.message, website: $scope.website } }; $http(httpOptions).success(onRequestSuccess).error(onRequestError); } And my PHP content like this: &lt;?php $name = isset($_POST['name']) &amp;&amp; $_POST['name'] ? $_POST['name'] : ''; $email = isset($_POST['email']) &amp;&amp; $_POST['email'] ? $_POST['email'] : ''; $message = isset($_POST['message']) &amp;&amp; $_POST['message'] ? $_POST['message'] : ''; $website = isset($_POST['website']) &amp;&amp; $_POST['website'] ? $_POST['website'] : ''; if($name &amp;&amp; $email &amp;&amp; $message) { echo "success" }else echo "error"; The php code writes error

http://stackoverflow.com/comment/38985068
has text: Yes but my question is, how do I go about animating the background position of the blur when the slider changes?
comment on: http://stackoverflow.com/a/25051381
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/38889946
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25004911
has text: Ah its not that I don't, I was just interested to see if I could do without it. Basically I want to do minimal changes to the blog itself (I have some reasons for this), apart from including a script or two. Is this possible?
score: 0

http://stackoverflow.com/a/25042851
type: Answer
accepted answer of: http://stackoverflow.com/q/24918911
score: 1
has body: you have too put last two line inside the callback function in order to work. If you don't want this than you could use some flag. var flag=0 var createPDF = function(imgData) { doc.addImage(imgData, 'JPEG', 10, 10, 50, 50, 'monkey'); doc.addPage(); if(flag==0) doc.output('datauri'); } var image = "some image url" flag =1 ; getImageFromUrl(image, createPDF); doc.text(35, 25, "Some extra text") flag=0;
upvote count: 1
answers question: http://stackoverflow.com/q/24918911
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24998656
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38871171
favorite count: 0
has comment: http://stackoverflow.com/comment/38874642
upvote count: 2
score: 2
type: AnsweredQuestion
has body: As you guessed, I'm newbie in JS and especially in React. I have a variable list for saving my calculations. I have one handler for drag-drop and form, but when data is updated, react still doesn't know about that. Should I use some special command for update this.props.data or the better way is write all logic in React components? btw, list consists of runs[]. Each run have id and balls[]. The ball have counter and value. /** @jsx React.DOM */ var Table = React.createClass({ render: function() { return ( {this.props.data.map(function (run){ return <TablesRun runId={id}/>; })} ); } }); var TablesRun = React.createClass({ render: function() { return {this.props.runId}ff ; } }); React.renderComponent( , document.getElementById('runTable'));
has title: How to say to React that data is already updated?
type: Question
tagged with: reactjs
possible better answer: http://stackoverflow.com/a/25003203
tagged with: javascript
has answer: http://stackoverflow.com/a/25022225
accepted answer: http://stackoverflow.com/a/25022225
has comment: http://stackoverflow.com/comment/38868550
has answer: http://stackoverflow.com/a/25003203

http://stackoverflow.com/comment/38893212
type: Comment
score: 0
type: AnswerComment
has text: @Edge - If your script is smart, no error will be output anywhere. You can test to see if a DOM element exists without creating any sort of error. I don't personally know of any way that one script can see if any other scripts caused any errors, but you'd be better to just not cause any errors in the first place by writing defensive code that tests any DOM query results before using them so as to never cause an error in the first place. You can also catch any of your own exceptions too so they are never "uncaught exceptions".
comment on: http://stackoverflow.com/a/25011270

http://stackoverflow.com/comment/38978886
type: Comment
type: QuestionComment
score: 1
has text: instead iFrame.css try $(this).css...
comment on: http://stackoverflow.com/q/25057705

http://stackoverflow.com/comment/38823417
comment on: http://stackoverflow.com/q/24975036
type: QuestionComment
type: Comment
score: 0
has text: why its only giving error when parameter is present?

http://stackoverflow.com/comment/38815956
has text: I'm working exactly like this. I might be using this solution if you don't mind. Is not the first time I try here: http://stackoverflow.com/questions/22571250/if-eventconstructor-is-not-a-constructor-how-should-i-create-the-event. Hope to succeed this time!
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24966245
type: AnswerComment

http://stackoverflow.com/comment/38932868
type: Comment
type: AnswerComment
has text: It is working when on clicks on the level 3 element but it show show when one click on level 2 menus for example `Child Two` or `Child Four` Menu item...
comment on: http://stackoverflow.com/a/25032687
score: 0

http://stackoverflow.com/comment/38957288
type: Comment
comment on: http://stackoverflow.com/q/25045531
has text: Ah, yes I see what you mean. OK I can come up with a better answer and title then.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38883048
score: 0
type: Comment
has text: I'm running on a mac and I have apache server running. If I have a simple <?php phpinfo(); ?> index.php script, then localhost:/index.php opens up fine... is there more I have to do?
type: AnswerComment
comment on: http://stackoverflow.com/a/25006779

http://stackoverflow.com/comment/38800415
comment on: http://stackoverflow.com/q/24962612
type: Comment
type: QuestionComment
has text: You should post the relevant code that you have.
score: 1

http://stackoverflow.com/comment/38719240
type: Comment
has text: Sure, but I'm trying to create an easy validation system not only for required fields, but numeric, alphanumeric, min-size, email, date, and others.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24917888

http://stackoverflow.com/comment/38820732
score: 0
comment on: http://stackoverflow.com/a/24972209
type: Comment
type: AnswerComment
has text: maybe a stupid question: have you done the same for your javascript code, e.g. checking the actual response text?

http://stackoverflow.com/comment/38916765
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25024116
has text: No luck with this. PyCharm actually recommends the switch.

http://stackoverflow.com/a/24958857
downvote count: 0
type: Answer
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24958294
has body: The usual way to do this would be to use window.requestAnimationFrame. This will essentially let you redraw the canvas every frame that the browser checks if it needs to redraw the screen. Below is my modification of your draw method and initialization code. function draw() { // schedule another draw for the next animation frame by calling // requestAnimationFrame with itself as a callback requestAnimationFrame(draw); // clear the canvas (otherwise your circles will leave trails) canvas.getContext("2d").clearRect(0, 0, canvas.width, canvas.height); // calc a new position for the circles based on the current time var now = +new Date(); var halfWidth = canvas.width / 2; // (waste to recheck each frame) var maxX = canvas.width - radius; // to avoid drawing the circles off screen var spaceBetween = canvas.width / 3; var x1 = (halfWidth + now) % maxX; var x2 = (x1 + spaceBetween) % maxX; var x3 = (x2 + spaceBetween) % maxX; var y = canvas.height / 2; var spaceBetween = canvas.width / 3; renderCircle(context, x1, y, radius, 'yellow'); renderCircle(context, x2, y, radius, 'blue'); renderCircle(context, x3, y, radius, 'red'); } var canvas = document.getElementById('ball-canvas'); var context = canvas.getContext('2d') var radius = 50; // start the animation draw();

http://stackoverflow.com/q/24966505
has comment: http://stackoverflow.com/comment/38810715
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38807702
has comment: http://stackoverflow.com/comment/38807534
has title: CSS/JS collapsible div working in JSFiddle, not in browser
answer count: 0
tagged with: jquery
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38807567
score: 0
has comment: http://stackoverflow.com/comment/38807475
has body: I am having a bit of a problem here. I am trying to make a collapsible div (think a folder tree-like thing) using the code at jsfiddle.net/cpkDg/ The code is working fine there, but when I try to integrate it into my site (a webapp) it's not working - http://dev.brandeer.ro/consins/standard/home.php I am using Pushy (christopheryee.ca/pushy/) for the side menu, and I suspect that this is the culprit, but I have no idea how to test it in JSFiddle (copy-pasting the script - Modernizr et al) in JSFiddle didn't work). I am only interested in this working on Chrome, since it is a webapp which will run only in Android WebView. In the near future I hope to implement it as a native app. Do you have any idea how I could solve this ? I have been looking for a few days on a pure css version of a collapsible menu but it seems that everyone prefers JavaScript/jQuery implementations.

http://stackoverflow.com/comment/38758370
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24940119
has text: Just to piggy back on @Dropzilla comment. You could have classes that pertain to each filter decorate the row, this might be something like ...class="stateCT catSOMEVALUE"... then, you could hide every row that doesn't have the filter values selected.

http://stackoverflow.com/comment/38768858
type: QuestionComment
comment on: http://stackoverflow.com/q/24945690
score: 0
type: Comment
has text: The two extra pairs of parentheses are unnecessary but they won't affect the output.

http://stackoverflow.com/q/25067856
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25067996
accepted answer: http://stackoverflow.com/a/25067996
tagged with: keycode
possible better answer: http://stackoverflow.com/a/25067941
has answer: http://stackoverflow.com/a/25067941
type: AnsweredQuestion
has body: I try to detect if a user presses F12 or ALT + L. document.onkeydown = function (event) { event = (event || window.event); if (event.keyCode == 123 || (event.keyCode == 18 &amp;&amp; event.keyCode == 76)) { //do anything return false; } } What am I doing wrong?
has title: Detect keycode ALT+L via Javascript
type: Question

http://stackoverflow.com/q/25060507
type: Question
possible better answer: http://stackoverflow.com/a/25060643
score: 0
answer count: 2
has body: My problem is when i click the button to show the data from database to html table it shows up but when i try to click the button again it duplicates the content of the table and it continues to duplicate as long as i click the button. script: $('#showData').click(function() { $.ajax({ url: 'Oppa/view/file.php', type: 'post', data: {tag: 'getData', code: $('#emailCodeResult').val()}, dataType: 'json', success: function(data) { if (data.success) { $.each(data, function(index, record) { if ($.isNumeric(index)) { var row = $("&lt;tr /&gt;"); row.appendTo("#myTable2 tbody"); } }) } $('#myTable2').dataTable({ "bjQueryUI": true, "bFilter": false, "bRetrieve": true, "sPaginationType": "full_numbers", "bAutoWidth": true, "bPaginate": false, "bInfo": false, "bLengthChange": false }); } }); });
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25060747
has comment: http://stackoverflow.com/comment/38984344
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/38984375
has title: Having issue showing data to html table using ajax and php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25060747
has comment: http://stackoverflow.com/comment/38984495
has answer: http://stackoverflow.com/a/25060643
tagged with: javascript
linked to: http://stackoverflow.com/q/13670579

http://stackoverflow.com/comment/38983382
comment on: http://stackoverflow.com/q/25044974
score: 0
has text: @GregBurghardt, it says that the error is at jquery.js (line 9476, col 16). And that line consists of "value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );". From that, I tried to alert out the object it is taking in from ticket_code, and it alerts what seems to be a jquery library.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38712842
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24916090
has text: An example would be better.

http://stackoverflow.com/comment/38801515
has text: `isNotDirty` is indeed part of TinyMCE, which Visual Composer uses, and in this case Visual Composer is trying to set the property on an object that is `null` and not an instance of `TinyMCE` so the issue is with Visual Composer. You should contact the developers to get a fix.
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24963278
type: Comment

http://stackoverflow.com/q/24942797
tagged with: leaflet
has title: Marker setDraggable for Leaflet?
score: 1
upvote count: 1
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24943101
downvote count: 0
answer count: 1
favorite count: 0
has body: With Leaflet, any suggestions on how to change the draggability of a marker from another event? For example, I have: marker = (L.marker([0,0], {draggable: true})); Then later I can do such things as: marker.setIcon(myicon).setLatLng(mylatlng).addTo(map); How would I also change draggable to false? I have multiple markers and I need to toggle the draggability for individual markers, so I also don't want to freeze the whole map. Thanks
accepted answer: http://stackoverflow.com/a/24943101
type: AnsweredQuestion

http://stackoverflow.com/comment/38974940
type: AnswerComment
has text: Welcome to Stack Overflow! Here, we don't open with a salutation, and we don't close with a signature or "thanks" or anything. Also, don't mark up your answer as code (which is what you've done by indenting it four spaces). The text of your answer should be normal text. To mark up blocks of code, use the `{}` button. To mark something up inline , use backticks. I've fixed it for you on this occasion.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25055472

http://stackoverflow.com/comment/38969650
comment on: http://stackoverflow.com/q/25052667
has text: $(function() { $( "#theForm" ).submit(); });
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/q/25016675
tagged with: jquery-ui
has comment: http://stackoverflow.com/comment/38901987
has title: jQuery sortable - only move one item
has comment: http://stackoverflow.com/comment/38901745
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/38901859
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
score: 4
has comment: http://stackoverflow.com/comment/38901767
accepted answer: http://stackoverflow.com/a/25017061
favorite count: 0
linked to: http://stackoverflow.com/q/11319663
has comment: http://stackoverflow.com/comment/38901946
type: AnsweredQuestion
has body: I'm using jQuery's sortable UI feature. I've got an unordered list with a few list items. When you click one of the list items it becomes the "active" list item. I'd like to make this (and only this) list item moveable, to any spot in the ul. Item 1 Item 2 Item 3 Item 4 Item 5 Item 6 Just to be clear, any item on this list can become active. But I only want the active element to be moveable.
has answer: http://stackoverflow.com/a/25017061

http://stackoverflow.com/comment/38723703
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24921780
has text: What about an `iframe`?

http://stackoverflow.com/comment/38910802
type: AnswerComment
score: 0
has text: Yeah I see what you mean. Thanks for the help.
type: Comment
comment on: http://stackoverflow.com/a/25020747

http://stackoverflow.com/comment/38702797
type: AnswerComment
has text: @jQuery Angry Bird : I think he wanted a smooth effect after leaving the text with the mouse. Perhaps I'm wrong, but it looks nicer imo.
comment on: http://stackoverflow.com/a/24910820
type: Comment
score: 0

http://stackoverflow.com/comment/38730819
type: Comment
comment on: http://stackoverflow.com/a/24925531
has text: I see you are setting the value to "1" will this be the same as setting to true?
score: 0
type: AnswerComment

http://stackoverflow.com/a/25069352
upvote count: 1
downvote count: 1
has body: You first fadeout the element with animate, than on the callback (when the fade is completed), you do the slideUp. $(function() { $('#error').delay(1000).animate({opacity: 0}, 100, "linear", function() { $('#error').slideUp(); }); }); Example: http://jsfiddle.net/4HT25/
accepted answer of: http://stackoverflow.com/q/25069312
answers question: http://stackoverflow.com/q/25069312
has comment: http://stackoverflow.com/comment/39001620
has comment: http://stackoverflow.com/comment/39001966
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/39001599
score: 0

http://stackoverflow.com/q/24956641
favorite count: 0
has answer: http://stackoverflow.com/a/24957027
possible better answer: http://stackoverflow.com/a/24956988
has body: Maybe this question has already been asked, but I searched and tried most of my afternoon without any success so I really hope somebody can help me with this. I want to be able to update my $http.get() - my data - that I have set in a factory service, every few seconds. I added some comment to my code and also left some old stuff for you guys to see what I have tried. (the old stuff is also commented out) My code: ovwid.factory('recentClients', [ '$http', '$rootScope', function ($http, $rootScope) { var apiURL = '/plugins/data/get_client.php'; var promise; var recentClients = { async: function() { if ( !promise ) { // $http returns a promise, which has a 'then' function, which also returns a promise promise = $http.get(apiURL) .then(function (response) { // The then function here is an opportunity to modify the response // The return value gets picked up by the then in the controller. return response.data; }); } // Return a promise to the controller return promise; } } return recentClients; }]); ovwid.controller(‘client’Ctrl, [ '$scope', 'recentClients', '$interval', function ($scope, recentClients, $interval) { $scope.loading = true; function reloadData() { // a call to the async method recentClients().async().then(function(data) { // console.log(data); $scope.loading = false; $scope.client = data; }); } // Initizialize function reloadData(); // Start Interval var timerData = $interval(function () { reloadData(); }, 1000); // function myIntervalFunction() { // var cancelRefresh = $timeout(function myFunction() { // reloadData(); // console.log('data refres') // cancelRefresh = $timeout(myFunction, 5000); // },5000); // }; // myIntervalFunction(); // $scope.$on('$destroy', function(e) { // $timeout.cancel(cancelRefresh); // }); }]); // [/controller]
tagged with: intervals
upvote count: 4
answer count: 4
tagged with: angularjs
downvote count: 0
tagged with: angularjs-directive
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24957098
accepted answer: http://stackoverflow.com/a/24957027
type: Question
has answer: http://stackoverflow.com/a/24956988
has answer: http://stackoverflow.com/a/24957021
tagged with: javascript
has title: Angular: Update data every few seconds
score: 4

http://stackoverflow.com/q/25019245
possible better answer: http://stackoverflow.com/a/25019504
has answer: http://stackoverflow.com/a/25029840
score: 0
has answer: http://stackoverflow.com/a/25019504
answer count: 3
has body: I have a JSP page with some javascript on it: function enviar(tableID) { var table = document.getElementById(tableID); var array= new Array(); for (var i = 1;i<table.rows.length; i++){ var row = table.rows[i]; for (var j = 0; j < row.cells.length; j++){ alert("added to array: "+row.cells[j].getElementsByTagName('INPUT')[0].value); array.push(row.cells[j].getElementsByTagName('INPUT')[0].value); } } var ajaxRequest; try{ // Opera 8.0+, Firefox, Safari ajaxRequest = new XMLHttpRequest(); } catch (e){ // Internet Explorer Browsers try{ ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ // Something went wrong alert("Your browser broke!"); return false; } } } ajaxRequest.open('POST', 'proyecto/saveRecompensas'); ajaxRequest.send('array='+array); } And a Controller, with a method which should receive the petition AND the array I am sending along with the petition: @RequestMapping ("/proyecto/saveRecompensas") public String saveRecompensas(@RequestParam String[] array){ System.out.println("saveRecompensas method"); return null; } The problem is, that sysout in the method is never called. This way, when the Javascript is executed, the server console says this: WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/myapp/proyecto/proyecto/saveRecompensas] in DispatcherServlet with name 'appServlet' Why the double "proyecto" in the URI? Which URL should I use to the server can receive the petition? Am I sending well the parameters? Thank you. EDIT: My Dispatcher: appServlet org.springframework.web.servlet.DispatcherServlet contextConfigLocation /WEB-INF/spring/appServlet/servlet-context.xml 1 appServlet /
has comment: http://stackoverflow.com/comment/38908564
tagged with: javascript
tagged with: ajax
has answer: http://stackoverflow.com/a/25021877
linked to: http://stackoverflow.com/q/5367309
tagged with: spring
has title: Send AJAX from Javascript to Spring Controller
has comment: http://stackoverflow.com/comment/38907609
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25021877
type: Question
has comment: http://stackoverflow.com/comment/38909668
has comment: http://stackoverflow.com/comment/38907706
has comment: http://stackoverflow.com/comment/38910214

http://stackoverflow.com/comment/38785384
type: AnswerComment
comment on: http://stackoverflow.com/a/24954811
score: 0
type: Comment
has text: @mitomed thanks i was doing it wrong here is the updated fiddle http://jsfiddle.net/dLk6E/1/

http://stackoverflow.com/a/25018923
has comment: http://stackoverflow.com/comment/38914339
has comment: http://stackoverflow.com/comment/38914352
type: Answer
answers question: http://stackoverflow.com/q/24921101
score: 0
has comment: http://stackoverflow.com/comment/38916459
has body: I have uploaded the polygons instead of points and Bootleaf works. But apple sidebar remain the mapicon of tearti. Also, if I click on the list in the sidebar, I do not make the pan / zoom the item ...

http://stackoverflow.com/comment/38796732
type: QuestionComment
has text: Duplicate of: http://stackoverflow.com/questions/10234725/accessing-an-objects-properties-from-a-template
score: 0
comment on: http://stackoverflow.com/q/24960852
type: Comment

http://stackoverflow.com/comment/38832636
has text: Please provide your sample.
comment on: http://stackoverflow.com/q/24978410
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38718707
comment on: http://stackoverflow.com/q/24917970
type: Comment
type: QuestionComment
has text: Here is everything http://jsfiddle.net/p9nn8/. This includes the graph and the Google spreadsheet embed.
score: 0

http://stackoverflow.com/a/24966905
type: Answer
answers question: http://stackoverflow.com/q/24966684
upvote count: 1
has body: I think you can do it just like this function Log() { var period = 1; var beginAge = age; console.log("Begin age : " + beginAge); console.log(" rrspStart : " + rrspStart); }
downvote count: 0
score: 1

http://stackoverflow.com/q/25051393
has comment: http://stackoverflow.com/comment/38967715
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25051491
type: Question
score: 0
has title: How to call URL without Localhost?
has answer: http://stackoverflow.com/a/25051610
tagged with: url
tagged with: javascript
has answer: http://stackoverflow.com/a/25051478
tagged with: ajax
has answer: http://stackoverflow.com/a/25051448
answer count: 4
has body: I am working on User management page in this,i want to store selected permissions in DB table .My code is following ... callajax("POST", "Permissions Details added Successfully.",formData); } var url= "http://localhost:8080/collection-ui/api/rolepermissions/updprm"; function callajax(posttype,successMsg,formData) { $.ajax({ type : posttype, url : url, data : JSON.stringify(formData), contentType : 'application/json', success : function(response) { if(response.status == "Success"){ Its working perfectly but this is working only in my system because the URL is Localhost right, then how can i call the url without localhost.plz anybody help
type: UnansweredQuestion
tagged with: http

http://stackoverflow.com/comment/38761965
has text: possible duplicate of [Angular filter on child property](http://stackoverflow.com/questions/20579177/angular-filter-on-child-property)
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24941297
type: QuestionComment

http://stackoverflow.com/comment/38850279
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24987862
has text: http://stackoverflow.com/a/11926757/2151050

http://stackoverflow.com/q/25057509
tagged with: drop-down-menu
has body: I have searched through here to find a javascript drop down that changes based on another drop down and the code I have works in Chrome. However, it doesn't work in IE 8.0.6 and I was wondering if anyone could highlight the part that isn't working, or suggest another workaround (JQuery, CSS etc). When I load this in IE, the second drop down is completely blank. The first drop down has a variation of the arrays, when a user selects one of those, they are then presented with the options in the array. So if I select iAffordability, i will be presented with the three values in the array. Here is the code I am using iAffordability = new Array("Unable to Get Mortgage", "Cant Afford to Move", "Price"); iDisintruction = new Array("Branch Disinstructed"); iCourtOrder = new Array("Court Order"); iLackofComms = new Array("Marketing", "Viewings", "Offers"); iLackofOffers = new Array("Not Happy with Amount", "Not Happy with Quality"); populateSelect(); $(function () { $('#WD').click(function () { populateSelect(); }); }); function populateSelect() { WD = $('#WD').val(); $('#Sub').html(); if (WD == 'iAffordability') { $('#Sub').empty(); iAffordability.forEach(function (t) { $('#Sub').append('&lt;option&gt;' + t + '&lt;/option&gt;'); }); } if (WD == 'iDisintruction') { $('#Sub').empty(); iDisintruction.forEach(function (t) { $('#Sub').append('&lt;option&gt;' + t + '&lt;/option&gt;'); }); } if (WD == 'iLackofComms') { $('#Sub').empty(); iLackofComms.forEach(function (t) { $('#Sub').append('&lt;option&gt;' + t + '&lt;/option&gt;'); }); } if (WD == 'iLackofOffers') { $('#Sub').empty(); iLackofOffers.forEach(function (t) { $('#Sub').append('&lt;option&gt;' + t + '&lt;/option&gt;'); }); } } JS Fiddle UPDATE: The code worked, I just had to add in: if (!window.console) console = {log: function() {}}; to my existing JS.
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25058237
has comment: http://stackoverflow.com/comment/38978462
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/38979296
has answer: http://stackoverflow.com/a/25058237
tagged with: internet-explorer
has title: javascript dependant drop down not working in IE 8
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/38825332
comment on: http://stackoverflow.com/q/24976039
score: 0
type: Comment
has text: Why are you using `display: none;` on the select tag. This way it won't be visible.
type: QuestionComment

http://stackoverflow.com/a/25023822
has comment: http://stackoverflow.com/comment/52506061
has comment: http://stackoverflow.com/comment/38945220
has comment: http://stackoverflow.com/comment/52525641
has comment: http://stackoverflow.com/comment/38943963
has comment: http://stackoverflow.com/comment/38945549
has comment: http://stackoverflow.com/comment/38944678
has comment: http://stackoverflow.com/comment/38944316
score: 158
has comment: http://stackoverflow.com/comment/96842974
has comment: http://stackoverflow.com/comment/52554500
type: AcceptedAnswer
has body: You can try this code if you are using bootstrap 3: HTML &lt;a href=&quot;#&quot; id=&quot;pop&quot;&gt; &lt;img id=&quot;imageresource&quot; src=&quot;http://patyshibuya.com.br/wp-content/uploads/2014/04/04.jpg&quot; style=&quot;width: 400px; height: 264px;&quot;&gt; Click to Enlarge &lt;/a&gt; &lt;!-- Creates the bootstrap modal where the image will appear --&gt; &lt;div class=&quot;modal fade&quot; id=&quot;imagemodal&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;myModalLabel&quot; aria-hidden=&quot;true&quot;&gt; &lt;div class=&quot;modal-dialog&quot;&gt; &lt;div class=&quot;modal-content&quot;&gt; &lt;div class=&quot;modal-header&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot;&gt;&lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;&lt;span class=&quot;sr-only&quot;&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class=&quot;modal-title&quot; id=&quot;myModalLabel&quot;&gt;Image preview&lt;/h4&gt; &lt;/div&gt; &lt;div class=&quot;modal-body&quot;&gt; &lt;img src=&quot;&quot; id=&quot;imagepreview&quot; style=&quot;width: 400px; height: 264px;&quot; &gt; &lt;/div&gt; &lt;div class=&quot;modal-footer&quot;&gt; &lt;button type=&quot;button&quot; class=&quot;btn btn-default&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; JavaScript: $(&quot;#pop&quot;).on(&quot;click&quot;, function() { $('#imagepreview').attr('src', $('#imageresource').attr('src')); // here asign the image to the modal when the user click the enlarge link $('#imagemodal').modal('show'); // imagemodal is the id attribute assigned to the bootstrap modal, then i use the show function }); This is the working fiddle.
has comment: http://stackoverflow.com/comment/38946113
has comment: http://stackoverflow.com/comment/50123744
type: Answer
answers question: http://stackoverflow.com/q/25023199
upvote count: 158
accepted answer of: http://stackoverflow.com/q/25023199
downvote count: 0

http://stackoverflow.com/comment/38930573
has text: Why shouldn't `regex1` match `test2`? It contains `perlpig` at the end. if you only want to match at the beginning, you should use the `^` anchor.
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25032023

http://stackoverflow.com/q/24974146
has answer: http://stackoverflow.com/a/24974605
type: Question
has comment: http://stackoverflow.com/comment/38822270
has title: preventDefault() for touchstart handler in Firefox not working - Pure Javascript
has comment: http://stackoverflow.com/comment/38821949
accepted answer: http://stackoverflow.com/a/24974605
tagged with: firefox
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has body: I would like for a button to react to 'touches' on a touch screen, and 'clicks' on a non-touch screen. In case of a touch screen, I only want the touchstart handler to direct my flow and prevent the system from further handling the click event. For this, I added two event listeners to my button. One listens for touchstart events. Once a touchstart has been detected, it uses event.preventDefault() to cancel the click event. The code below on a touchscreen in Chrome, Opera and Android browsers achieves the desired result: - one alert saying "touch". However, in Firefox both events are detected, in spite of the preventDefault() in the touchstart handler: two alerts... first one says "touch", followed by a second alert saying "click". lginButton.addEventListener('touchstart', function(event) { event.preventDefault(); alert("touch"); }, false); lginButton.addEventListener('click', function(event) { alert("click"); }, false); Why is this happening and how can I achieve the desired results in all browsers?
score: 2
has comment: http://stackoverflow.com/comment/38822115
type: AnsweredQuestion
upvote count: 2
has comment: http://stackoverflow.com/comment/38822256
tagged with: web-applications

http://stackoverflow.com/comment/38869824
comment on: http://stackoverflow.com/a/24993460
type: Comment
has text: @elbarto Its getting OT so I won't comment further but I don't think you should play with a production server if you don't really know what you're doing - specially on a cloud / VM setup.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/39140996
has text: how do i get it to select id= "price" of the particular "post id"
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24980784

http://stackoverflow.com/comment/38799748
type: Comment
comment on: http://stackoverflow.com/a/24941507
has text: It's not. But spamming them is.
type: AnswerComment
score: 0

http://stackoverflow.com/q/25000433
tagged with: javascript-objects
upvote count: 1
has comment: http://stackoverflow.com/comment/38871108
type: Question
accepted answer: http://stackoverflow.com/a/25000577
has comment: http://stackoverflow.com/comment/38871144
downvote count: 0
answer count: 1
has title: Best way to change presentation based on class variable in Javascript
tagged with: javascript
score: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25000577
has comment: http://stackoverflow.com/comment/38871177
has body: I have a class that could be two different logical types depending on the value of a variable. Just as an example, consider the case of a Human class that could be male or female. In my presentation I would like to be able to distinguish between males and females and display differently accordingly, but am not sure what is the canonical way to do so. My current approach is to use a getter function: var human = new Human('male'); if (human.getGender() === 'male') { //display male ... } else { //display female... } However I could also use a static function defined on the class or in a utility class: var instance = new Human('male'); if (Human.isMale(instance)) { ... } else { ... } And I could also make use of inheritance with instanceof: if (human instanceof Male) { ... } I had decided not to use separate Male and Female classes because both would have the exact same variables and functions in my application. Since there is no different behavior between the two except in presentation it seems redundant to define an extra class. Is my reasoning here correct? And out of these options, and any others I might have missed, what are the benefits to using each method?
type: AnsweredQuestion

http://stackoverflow.com/a/25054578
downvote count: 0
has body: First, you need to change HTML markup of all elements in your example above, let jQM take care of it. All you have to add is as follows and jQM will enhance them. Back Header next Info Friends Albums Emails However, external widgets such as header and footer should be enhanced manually. $(function () { $("[data-role=header], [data-role=footer]").toolbar(); }); To move to next page programmatically, you need first to retrieve active page and check if a next page exists in DOM. You need to add click or any events listener once to button with id next on pagecontainercreate. The latter event fires on pageContainer and only once. Don't mix between it and pagecreate, as pagecreate fires once per page. $(document).on("pagecontainercreate", function () { $("#next").on("click", function () { var activePage = $.mobile.pageContainer.pagecontainer("getActivePage"), nextPage = activePage.next("[data-role=page]"); /* 0 means there's no page in DOM after current page */ if (nextPage.length != 0) { $.mobile.pageContainer.pagecontainer("change", nextPage); } }); }); Demo
type: Answer
score: 1
answers question: http://stackoverflow.com/q/25050110
accepted answer of: http://stackoverflow.com/q/25050110
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/24909311
tagged with: javascript
has body: When loading external JSON-data in my browser (run it locally), it shows the requested data. When using it in the cloud-based build service of PhoneGap, the page loads but without the JSON-data. Does anyone have the solution to make it work in the PhoneGap app (iOS and Android)? Thanks in advance! Below de code of a.html Test Below de code of the stand.php: <?php header('Access-Control-Allow-Origin: *');//for local browser test $_POST['team'] = 'E3'; $doc = new DOMDocument(); $url = 'http://www.example.org/clubs/teams/embed/bbgz35e/team/'.$_POST['team'].'?layout=stand&stand=1&format=xml'; if (!$doc->load($url)) { exit('Kon stand niet inladen!'); } $xpath = new DOMXPath($doc); //$poulenaam = $xpath->query('/div[@id="teampagina"]/h3')->item(0)->nodeValue; // //$nodes = $xpath->query('//tbody/tr/td[@class="wins"]'); // //$doelpunten = 0; //foreach ($nodes as $node) { // $doelpunten += (int)$node->nodeValue; // //} // //echo "Aantal doelpunten in de poule `{$poulenaam}`: {$doelpunten}"; $tableRows = $xpath->query('//tbody/tr'); $x=1; $stand = Array(); foreach ($tableRows as $row) { $classes = Array(); $cells = $xpath->query('td/@class', $row); foreach ($cells as $cell) { //echo ' class = '; //var_export($cell->nodeValue); $classes[] = $cell->nodeValue; }$x++; } array_unshift($classes, "phoney"); unset($classes[0]); //print_r($classes); //echo " \n"; $z = 1; foreach ($tableRows as $row) { $cells = $xpath->query('td', $row); $i=1; foreach ($cells as $cell) { //echo $z.'value'.$i.' = '; //var_export($cell->nodeValue); //echo " \n"; $stand[$z][$classes[$i]] = $cell->nodeValue; $i++; } $z++; } //array_unshift($stand, "phoney"); //unset($stand[0]); //print_r($stand); echo json_encode($stand); ?> Below de code of the config.xml: Example Example app Example <preference name="phonegap-version" value="3.3.0" /> <gap:plugin name="org.apache.cordova.device" /> <preference name="permissions" value="none"/> <preference name="orientation" value="default" /> <preference name="target-de…
answer count: 3
has answer: http://stackoverflow.com/a/25038152
upvote count: 1
accepted answer: http://stackoverflow.com/a/25038152
has answer: http://stackoverflow.com/a/24909653
favorite count: 0
tagged with: ajax
tagged with: phonegap-build
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/72539989
possible better answer: http://stackoverflow.com/a/24909653
type: Question
has title: Loading JSON with ajax working in local browser, but not in the PhoneGap app

http://stackoverflow.com/a/25005239
downvote count: 0
has body: Try this: $('#topScroll').hide().delay(5000).fadeIn(400); Your div is already visible, so you might as well hide it again for fadeIn() to perform. fadeOut() works because topscroll is already visible. reference: http://api.jquery.com/fadeout/
type: Answer
accepted answer of: http://stackoverflow.com/q/25005222
score: 18
upvote count: 18
answers question: http://stackoverflow.com/q/25005222
type: AcceptedAnswer

jquery-animate
tags question: http://stackoverflow.com/q/25018037
tags question: http://stackoverflow.com/q/24918122
tags question: http://stackoverflow.com/q/24926993
tag name: jquery-animate
tags question: http://stackoverflow.com/q/24944753
tags question: http://stackoverflow.com/q/25001248
tags question: http://stackoverflow.com/q/24978250
tags question: http://stackoverflow.com/q/24965412
tags question: http://stackoverflow.com/q/24955467
tags question: http://stackoverflow.com/q/25057826
tags question: http://stackoverflow.com/q/24975439
type: Tag
tags question: http://stackoverflow.com/q/24967475
tags question: http://stackoverflow.com/q/24960647

http://stackoverflow.com/comment/38737886
comment on: http://stackoverflow.com/q/24929678
type: Comment
type: QuestionComment
has text: ...and now you have two problems ;) What about .info or .name TLDs?
score: 0

http://stackoverflow.com/q/25057622
tagged with: video
answer count: 0
has comment: http://stackoverflow.com/comment/38978887
has body: I am currently working on a project for chromecast and ran into a problem. When I am loading a very short video, the (videoplayer?) screen goes black while loading. All the video's backgrounds are white and I am switching videos quite often. Therefor, it would look a lot nicer with a white loading background. I've tried creating a white and letting it fade out to opacity 0 on event listeners (played, loaded,..). Tried the same with a bit of a delay using setTimeout(..), but there always remains at least a short "pop of black" when switching to the actual video. Also using video's "poster" attribute (by just using a white image..) doesn't prevent this.Furthermore, the natural things like background-color or color attribute's of the video tag are all set to #FFFFFF via css. Is there any actual way to do so, which I didnt think of yet? Basically it only needs to work on Chrome (i think chromecast is using some derivative, webkit thing). &lt;canvas id="whiteoverlay"&gt;&lt;/canvas&gt; &lt;video id="receiverVideoElement" loop poster="white.png"&gt;&lt;/video&gt; I'd love if you have some kind of tipp for me or reason why it will never work.
has comment: http://stackoverflow.com/comment/39315016
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/39022334
has title: Avoid black loading screen html5/javascript
tagged with: html5-video
has comment: http://stackoverflow.com/comment/39009490
score: 0
type: UnansweredQuestion
tagged with: chromecast
tagged with: css

http://stackoverflow.com/comment/38724943
comment on: http://stackoverflow.com/q/24922008
score: 0
type: Comment
type: QuestionComment
has text: Surely if they're defined at the moment the $("slider") function is called they are ok? Are you using the same library versions ?

http://stackoverflow.com/comment/38783531
comment on: http://stackoverflow.com/q/24953697
score: 0
type: Comment
type: QuestionComment
has text: thanks I figured that, I am not really sure how to keep track of all the parents while iterating though

http://stackoverflow.com/q/25010730
tagged with: ipad
tagged with: browser-detection
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25010864
type: Question
tagged with: javascript
tagged with: jquery
has title: jquery hide() method is not working on tablet/mobile
score: 0
accepted answer: http://stackoverflow.com/a/25010864
tagged with: tablet
answer count: 1
has body: I have a JS function which only show one li element and hides all other li elements enclosed an unordered list based on device detection condition. HTML JS function deviceDetectionScript() { var mobileDetection = new MobileDetect(window.navigator.userAgent); if (mobileDetection.mobile()) { if (mobileDetection.os() == 'iOS') { alert('iOS detected'); //alert is working fine on ipad $('ul#menu > li').not('#mainMenuGroup_mobileiOS').hide(); // this is not working show_tab_content('mobileiOS'); // this function makes the selected li active - working fine } else if (mobileDetection.os() == 'AndroidOS') { alert('Android detected'); //alert is working fine on android tab $('ul#menu > li').not('#mainMenuGroup_mobileAndroid').hide(); // this is not working show_tab_content('mobileAndroid'); // this function makes the selected li active - working fine } else if (mobileDetection.os() == 'WindowsMobileOS' || mobileDetection.os() == 'WindowsPhoneOS') { alert('windows detected'); //alert is working fine on windows phone $('ul#menu > li').not('#mainMenuGroup_mobileWinPhone').hide(); // this is not working show_tab_content('mobileWinPhone'); // this function makes the selected li active - working fine } } } I tried using alert inside the loop and the detection is working just fine along with one additional function show_tab_content('listID'); All these seems to be working fine apart from jquery hide() method $('ul#menu > li').not('#listID').hide(); I tried adding the else condition to check if it is not a mobile device and the script works fine on desktop browsers. function deviceDetectionScript() { var mobileDetection = new MobileDetect(window.navigator.userAgent); if (mobileDetection.mobile()) { if (mobileDetection.os() == 'iOS') { // Same as above } else if (mobileDetection.os() == 'AndroidOS') { // Same as above } else if (mobileDetection.os() == 'WindowsMobileOS' || mobileDetection.os() == 'WindowsPhoneOS') { // Same as above } } else { alert('Desktop detected'); //alert is wor…

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

http://stackoverflow.com/a/25051757
has body: Array.prototype.forEach is what you want. Just be mindful of browser support or use a framework that corrects for unsupported browsers: http://kangax.github.io/compat-table/es5/#Array.prototype.forEach for in should be used for iterating over object properties because order is not guaranteed.
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/25051629
score: -1
upvote count: 0

http://stackoverflow.com/comment/38860149
comment on: http://stackoverflow.com/q/24994681
score: 1
has text: Could you narrow down the code to the critical parts, thx.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24943392
upvote count: 1
has body: Because this is a two dimensional Array, you will need a nested for loop. var newArr = [1, 2], counter; for ( var i = 0; i &lt; arr.length; i++ ) { for ( var x = 0; x = arr[i].length; x++ ) { if ( arr[i][x] === newArr[x] { counter++ } if (counter === 2) { alert('new coord!') } } //reset counter counter = 0; }
answers question: http://stackoverflow.com/q/24943200
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/a/25039415
answers question: http://stackoverflow.com/q/25039308
has body: Welcome to the world of async! executeSql is async so use a callback to access the data once that function completes: function getListname(listId, callback) { var query = 'SELECT name FROM Lists WHERE id=(?)'; $scope.db.transaction( function (transaction) { transaction.executeSql(query, [listId], function (tx, results) { // console.log("Result: "+results.rows.item(0).name); // works! callback(results.rows.item(0).name); // returns nothing or not to the sender } ); } ); And then call it! getListName(listId, function(name) { console.log(name); });
downvote count: 0
type: Answer
score: 2
upvote count: 2

http://stackoverflow.com/comment/38914450
type: AnswerComment
has text: the second time the mouse enters `.photo`, `$(this).find('.details')` will return `[]`. Here really, you should have a way to target the inner div other than with the class name you're toggling.
type: Comment
comment on: http://stackoverflow.com/a/25023181
score: 2

http://stackoverflow.com/q/24973186
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/7823801
has comment: http://stackoverflow.com/comment/38820109
type: UnansweredQuestion
tagged with: php
has body: The last few days, I've really been messing with the .php extension. I used mod_rewrite (via .htaccess) to redirect from www.example.com/example.php to www.exmaple.com/example and it works fine. But I found out that I could still enter the url www.example.com/example.php to visit the page rather than show a not found page. How could I do that? This is what I mean: If you try to entered the first link before, it will work fine but the second link is the Forum page from phpacademy it will redirect to a error page. But my page will still work fine too. I want the effect like this. Forum page without .php extension Forum page with .php extension Much appreciate any help
linked to: http://stackoverflow.com/q/9821222
has title: completely remove the .php extension from url
duplicate of: http://stackoverflow.com/q/9821222
score: -1
has answer: http://stackoverflow.com/a/24973241
type: Question
downvote count: 2
upvote count: 1
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38867978
score: 0
comment on: http://stackoverflow.com/q/24998818
type: Comment
type: QuestionComment
has text: as you can see cards (images inside of card) is 180% rotated and when you flip card wrong axis is used (X insted of Y)

http://stackoverflow.com/a/25018705
has body: If we read the ES5 spec §15.4.4.11 Array.prototype.sort, the very second sentence states The sort is not necessarily stable (that is, elements that compare equal do not necessarily remain in their original order) That is to say, in JavaScript, if the comparator says two things are equal (by giving 0), it doesn't matter if they get swapped or not and hence in some environments they may swapped due to some other reason such as their hashes or just the implementation. i.e. The result you experience is a valid result of sort as defined by the spec and repeating the same sort may even give different results each time Hopefully I won't get downvoted too heavily for this, but if you do it as one function then you don't need to iterate through the array as many times and you'll avoid your unexpected result /* list = multiSort(list [, obj, ...]) * where e.g. obj = { * key: "keyToLookAt", * optional comparator: function (a, b) {return a&lt;b || ((a===b)-1);}, * optional ascending: default true * } */ var multiSort = (function () { function generateSorter(key, comparator, ascending) { ascending = 2 * !!ascending - 1; if (comparator) { return function sorter(a, b) { return ascending * comparator(a[key], b[key]); }; } return function sorter(a, b) { a = a[key]; b = b[key]; return ascending * (a &lt; b ? -1 : a &gt; b ? 1 : 0); }; } function sortManager(sorters) { return function (a, b) { var ret, i = 0; for (; i &lt; sorters.length; ++i) { ret = sorters[i](a, b); if (ret !== 0) return ret; } return 0; }; } function multiSort(list) { var i = 1, sorters = []; for (; i &lt; arguments.length; ++i) { sorters.push(generateSorter( arguments[i].key, arguments[i].comparator, 'ascending' in arguments[i] ? arguments[i].ascending : 1 )); } list.sort(sortManager(sorters)); return list; } return multiSort; }()); And then when using it, the "most strict" sort rule goes first multiSort( [ { name: "water", type: "cold" }, { name: "tea", type: "hot" }, { name: "coffee", type: "hot" }, { name: "cho…
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25017580
type: Answer
upvote count: 1

http://stackoverflow.com/a/25021423
has body: The plugin does the heavy lifting for you. From what I can see, the coords are whatever you want... the plug in then calculates the new coords based on the size of the image. These obtuse coordinates are for a complete outline of the powerpfuff girls and the logos... try something simple like a circle or a rectangle.
has comment: http://stackoverflow.com/comment/38911540
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38913374
score: 2
accepted answer of: http://stackoverflow.com/q/25021331
upvote count: 2
answers question: http://stackoverflow.com/q/25021331

http://stackoverflow.com/a/24994153
has comment: http://stackoverflow.com/comment/38859083
has comment: http://stackoverflow.com/comment/38859160
has comment: http://stackoverflow.com/comment/38859063
has comment: http://stackoverflow.com/comment/38859258
has comment: http://stackoverflow.com/comment/38859404
has comment: http://stackoverflow.com/comment/38859163
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38859338
upvote count: 1
downvote count: 1
has body: In the third line of code you have to write post_data[id] = new Array(); So the entire code section looks like var post_data = []; var id = 1; post_data[id] = new Array(); post_data[id]['name'] = 'abc'; post_data[id]['date'] = '01-03-2014'; post_data[id]['country'] = 'India'; console.log(post_data[id]['name']); This should fix it, best of luck :)
answers question: http://stackoverflow.com/q/24994066
has comment: http://stackoverflow.com/comment/38859301

http://stackoverflow.com/a/25036856
has comment: http://stackoverflow.com/comment/39216958
has body: RequireJS doesn't search online for files. It's merely finding javascript files it's pointed to in requireConfig. RequireJS automatically assumes that each file is a JS file, so the .js extensions are left out from the paths when you call require() In this case, all you have is a typo. LightBox should be Lightbox - so rather than looking for LightBox.js you should be looking for Lightbox.js ie: var Lightbox = require(`famous/views/Lightbox`);
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25035660
answers question: http://stackoverflow.com/q/25035660

http://stackoverflow.com/q/25039759
has answer: http://stackoverflow.com/a/25040005
tagged with: authentication
has body: I'm trying to find a way to interact securely with an OAuth (draft v2-23) API completely in the browser. There are obvious security concerns with authenticating in the browser because the auth token and other keys are exposed somewhere in the browser. Is there a secure way to hide those keys, or am I limited to creating a server side solution that keeps track of those keys?
type: Question
has title: How do I securely use a REST API solely from within a web browser?
tagged with: javascript
score: 0
answer count: 1
tagged with: client-side
tagged with: oauth
tagged with: rest
type: UnansweredQuestion

http://stackoverflow.com/a/24958803
has comment: http://stackoverflow.com/comment/38795028
has comment: http://stackoverflow.com/comment/38793923
type: Answer
score: 1
has body: If you want to add height and width dynamically. Something like this should work: function changeSize(){ var colorbox = $("#colorbox"); var initWidth = $("#colorbox").outerWidth(); // get colorbox width var initHeight = $("#colorbox").outerHeight(); // get colorbox height var newWidth = 28; // set your desired width var newHeight = 55; // set your desired height var height = initHeight + newHeight; // add heights together var width = initWidth + newWidth; // add widths together colorbox.css({"height" : height, "width": width}); }changeSize(); Also if you want to insure your code is happens after the colorbox opens you could use .ajaxStop(); Also note, outerWidht() and outerHeight() will get colorbox width plus the padding and borders. To fire function after ajax events are finished: $(document).ajaxStop(function() { changeSize(); }); Update: Okay, it looks the function fires initially. You can see width is null because the colorbox has not opened. What you want to do is fire the function after the colorbox opens. That is where ajaxStop() would come into play. But it might actually be better to use the colorbox callback function: But not after the colorbox opens. So try doing the ajaxStop() approach. Also note, if you do this you will need to remove changeSize(); after function changeSize() For example: $(document).ready(function() { function changeSize(){ // function stuff } $(document).ajaxStop(function() { changeSize(); }); }); Or, Colorbox OnComplete: $(".selector").colorbox({ onComplete:function(){ changeSize(); } }); Update 2: I am not sure where you are calling colorbox exactly. But I see you have this: Found here jQuery(function($){ $('#wpsimplegallery a').colorbox({ maxWidth: '85%', maxHeight: '85%' }); }); So try: jQuery(function($){ $('#wpsimplegallery a').colorbox({ maxWidth: '85%', maxHeight: '85%', onComplete:function(){ changeSize(); } }); });
has comment: http://stackoverflow.com/comment/38795430
upvote count: 1
has comment: http://stackoverflow.com/comment/38795462
has comment: http://stackoverflow.com/comment/38795338
has comment: http://stackoverflow.com/comment/38792851
answers question: http://stackoverflow.com/q/24958660
downvote count: 0
has comment: http://stackoverflow.com/comment/38794799

http://stackoverflow.com/comment/38944099
score: 0
type: QuestionComment
has text: The directionsService.route method is asynchronous, hence the second parameter is a function which will execute when the AJAX call is complete.
type: Comment
comment on: http://stackoverflow.com/q/25039205

http://stackoverflow.com/comment/71126226
type: AnswerComment
comment on: http://stackoverflow.com/a/41892567
has text: Short and to the point. Maybe you could combine it with decycle (https://github.com/douglascrockford/JSON-js ), in order to handle cyclic structures
type: Comment
score: 0

http://stackoverflow.com/q/24909466
has answer: http://stackoverflow.com/a/24910248
type: Question
answer count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/38699461
score: 0
tagged with: excel
accepted answer: http://stackoverflow.com/a/24910248
has title: how to pass the javascript variable in to php in same page
possible better answer: http://stackoverflow.com/a/24909513
tagged with: javascript
has answer: http://stackoverflow.com/a/24909513
has comment: http://stackoverflow.com/comment/38699668
type: AnsweredQuestion
has body: How can i assign the javascript variable in to php. $("button").click(function() { var val = (this.id); $.ajax ({ url: "date.php", //data: { val : val }, data:'q=' + val, type: "GET", success: function(result) { if(result==1) { page = "<?php echo $today;?>"; } else if(result==2) { page = "<?php echo $this_week;?>"; } else if(result==3) { page="<?php echo $this_month;?>"; } else if(result==4) { page="<?php echo $previous_month;?>"; } else { "<?php echo $today;?>"; } } }); }); Here i want to pass the variable 'page' to php,for to assign the export excel filename.I done like this in php <?php $page = (' '); ?> $page variable i want to assign here. But am getting error,otherwise any other method to assign the variable. my date.php <?php $var=$_GET['q']; if($var == 'getToday') { echo "1"; } elseif($var =='getWeek') { echo "2"; } else if($var =='getMonth') { echo "3"; } else if($var =='getpremon') { echo "4"; } else { echo "5"; } ?>
tagged with: jquery
has comment: http://stackoverflow.com/comment/38699472

http://stackoverflow.com/q/24976808
tagged with: node.js
accepted answer: http://stackoverflow.com/a/24976817
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38826700
has body: I'm trying to replace a substring by another one using this code: var body = 'Message: ' + req.query.message.replace('/(?:\r\n|\r|\n)/g', '&lt;br/&gt;'); But, proceeding that way I get this error message on that line: TypeError: Cannot call method 'replace' of undefined I wasn't able to find the solution to fix this using javascript. What I've found is related to only jQuery. Any brilliant idea how to fix that, please?
has title: error: TypeError: Cannot call method 'replace' of undefined
type: Question
answer count: 1
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24976817
has comment: http://stackoverflow.com/comment/65463386

http://stackoverflow.com/comment/38881537
has text: I don't follow. You're demo just shows the same result as mine. Wouldn't the wrapper need to be relative?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25005898
type: Comment

http://stackoverflow.com/comment/38952018
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25042930
has text: @LeBen yes... the images should fit
score: 0

http://stackoverflow.com/comment/38840967
has text: @doniyor No, sorry, it's for an own CMS. Can you help with getting this `.select()` listener working? Thank you very much!!!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24984087

http://stackoverflow.com/q/25051640
accepted answer: http://stackoverflow.com/a/25052277
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/25052100
has answer: http://stackoverflow.com/a/25052100
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/38967943
has comment: http://stackoverflow.com/comment/38968640
has title: Backbone - View not rendering
upvote count: 1
tagged with: jsfiddle
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38968895
has answer: http://stackoverflow.com/a/25052277
score: 1
has comment: http://stackoverflow.com/comment/38967735
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38967792
has comment: http://stackoverflow.com/comment/38967791
downvote count: 0
tagged with: javascript
has body: I'm new to backbone and trying to make a book library app. While running this code, it is not showing the template. This is my index.html Example Name: Author: Keyword: Add This is script.js $(function(){ var bookmodel = Backbone.Model.extend({ defaults: { name:'temp', auth:'meee', keyword:'nonee' }, }); var booklist = Backbone.Collection.extend({ model:bookmodel }); var bookview= Backbone.View.extend({ tagName:'div', className: 'bookContainer', template: _.template( $('#bookTemplate').html()), events:{ 'click .delete':'deleteBook' }, render : function(){ this.$el.html(this.template(this.model.toJSON())); return this; }, deleteBook: function(){ this.model.destroy(); this.remove(); } }); var library = Backbone.View.extend({ model: bookmodel, initialize: function( initialBooks ) { $el='#book_list'; var one=new bookmodel({name:'ankur 1',auth:'asdf 1',keyword:'asdfkasdf 1'}); var two=new bookmodel({name:'ankur 2',auth:'asdf 2',keyword:'asdfkasdf 2'}); var bookcoll= [one,two]; this.collection = new booklist(bookcoll); this.render(); }, render:function(){ this.collection.each(function (item){ var k= new bookview({model:item}); this.$el.append(k.render().el); },this); }, }); var xyz= new library(); }) Also, when i'm trying to code like this: var library = Backbone.View.extend({ model: bookmodel, $el:'#book_list'; ..... //rest of the code )}; var xyz= new library(); Then,it is leading to : Uncaught TypeError: undefined is not a function, at line var xyz= new library();
tagged with: jquery
favorite count: 0

http://stackoverflow.com/comment/38960159
comment on: http://stackoverflow.com/a/25043388
has text: @ Nicolas..Thanks man. Is it possible for you put an example in jsfiddle? Cheers!
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38754253
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24938254
type: AnswerComment
has text: Look at the comments of the OP.

http://stackoverflow.com/comment/38936531
score: 0
has text: @Skittle "Once the page loads completely, (...) they're not clickable anymore" that sounds like a JavaScript issue. Definitely not a PHP / Apache (.htaccess) issue. You are probably loading some JavaScript that is disabling the links.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25035013

http://stackoverflow.com/q/25025905
tagged with: service
tagged with: angularjs
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question
has title: angular service jasmine test can't find $http
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25026039
has body: Following the tutorial here: http://www.benlesh.com/2013/06/angular-js-unit-testing-services.html the following jasmine test should work -- but doesn't. I've reduced the test down to the simplest possible thing to test. Unlike the example test I linked, I can't get this to pass. Any idea what I'm doing wrong? The service under test: var appServices = angular.module('MyApp.services', ['$http', '$rootScope']); appServices.factory('Auth', ['$http', '$rootScope', function ($http, $rootScope) { var accessLevels = routingConfig.accessLevels, userRoles = routingConfig.userRoles, currentUser = { username: '', role: userRoles.public }; function changeUser(user) { angular.extend(currentUser, user); } return { authorize: function (accessLevel, role) { if (role === undefined) { role = currentUser.role; } return accessLevel.bitMask &amp; role.bitMask; }, isLoggedIn: function (user) { if (user === undefined) { user = currentUser; } return user.role.title === userRoles.user.title; }, login: function (user, success, error) { //ignore jslint user.role = userRoles.user; changeUser(user); $rootScope.$broadcast('login'); success(user); }, logout: function (success, error) { //ignore jslint changeUser({ username: '', password: '', role: userRoles.public }); success(); }, accessLevels: accessLevels, userRoles: userRoles, user: currentUser }; }]); The test: describe('services tests', function () { beforeEach(function () { module('MyApp.services'); // get your service, also get $httpBackend // $httpBackend will be a mock, thanks to angular-mocks.js inject(function (_Auth_, $httpBackend) { Auth = _Auth_; httpBackend = $httpBackend; }); }); it('should have an authorize function', function () { expect(angular.isFunction(Auth.authorize)).toBe(true); }); }); The error message: Error: [$injector:modulerr] Failed to instantiate module MyApp.services due to: Error: [$injector:modulerr] Failed to instantiate module $http due to: Error: [$injector:nomod] Module '$http' is not available! You either m…
upvote count: 1
answer count: 1
tagged with: jasmine
has answer: http://stackoverflow.com/a/25026039
favorite count: 0

http://stackoverflow.com/q/24911700
has answer: http://stackoverflow.com/a/48497980
type: Question
has answer: http://stackoverflow.com/a/24912186
accepted answer: http://stackoverflow.com/a/24912186
has answer: http://stackoverflow.com/a/24912581
has comment: http://stackoverflow.com/comment/38704030
downvote count: 0
tagged with: javascript
has body: Maybe some of you know about AOP, in some languages using AOP can lead you to be able to inject code after, before, or while a method is executing,etc. What I want is to apply the same in Javascript, I am currently working on a massive app which has more than 300 ajax calls, and every time I need to do some change on the catch statement on them, I have to modify them one by one which is very tedious. What I want to do is something like : functionName.before("try {") functionName.after("} catch(ex){ //dostuff }") Is it possible? I know there are things like .call, or the arguments object inside every function..which seem pretty meta-function (AOP) functionalities.
tagged with: aop
has comment: http://stackoverflow.com/comment/38704261
tagged with: method-modifier
linked to: http://stackoverflow.com/q/11371993
has comment: http://stackoverflow.com/comment/38704556
has title: Is there a way to inject a try catch inside a function?
has comment: http://stackoverflow.com/comment/38704296
answer count: 4
favorite count: 0
tagged with: function-composition
possible better answer: http://stackoverflow.com/a/24912581
upvote count: 1
has comment: http://stackoverflow.com/comment/38704004
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/48499699
score: 1
linked to: http://stackoverflow.com/q/2136522
has comment: http://stackoverflow.com/comment/130179782

http://stackoverflow.com/comment/38779267
has text: Please double check my answer this is not a rectangle. width and height only defines the size of the ball. Using the string color in the attribute only displays a rectangle. Please double check mine's only a ball falling, no rectangles
comment on: http://stackoverflow.com/a/24949992
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/25033792
has body: you need to use quotes with the array notation: AB["p_r"] = response[0].result; or use the dot notation AB.p_r = response[0].result; Otherwise the parser will think you are trying to use a variable named p_r
has comment: http://stackoverflow.com/comment/38933659
has comment: http://stackoverflow.com/comment/38933684
accepted answer of: http://stackoverflow.com/q/25033680
score: 5
answers question: http://stackoverflow.com/q/25033680
type: Answer
type: AcceptedAnswer
upvote count: 5
downvote count: 0

http://stackoverflow.com/comment/38722774
comment on: http://stackoverflow.com/q/24921281
type: Comment
type: QuestionComment
score: 3
has text: why? this just complicates things.

http://stackoverflow.com/q/25019687
has comment: http://stackoverflow.com/comment/38938644
has comment: http://stackoverflow.com/comment/39020926
type: UnansweredQuestion
tagged with: font-face
score: 2
upvote count: 2
has comment: http://stackoverflow.com/comment/39023072
tagged with: cookies
has body: What I want: I need to add some dynamic CSS styles with fonts from different domain, where authentication is needed, to the page: Problem: Firefox doesn't send cookie in font request (In Chrome everything works fine) Situation: Firefox v.30.0. Source of CSS file and Font are on different domain (in example is foreign domain called "bbb.com"). Foreign domain "bbb" needs authentication. After successful authentication client receive cookie with php session ID, which is using for all others request to "bbb.com" domain. Example: Authentication for domain "bbb.com" has been successful executed By AJAX request to url "https://bbb.com/issue2604dead.css" client receive content of CSS file like a string Javascript create element with content received in previous step CSS styles works fine and style of affected elements is changed; One of definition in the CSS is following FONT reference: @font-face{font-family:dead_3;src:url(https://bbb.com/dead_3.ttf)format("opentype");} Browser trying to get font from url but client receive response status "401 Unauthorized"; EDITED: I made example on jsFiddle: http://jsfiddle.net/RightFiveLeft/Pu4C2/9/ I found Firefox doesn't sent Cookie because reference is set in DOM element. If you load same resource by ajax browser will sent cookie. So in my example on jsFiddle Cookie will be not sent on CSS request created by DOM element link. EDITED 2 I am sorry for I added wrong example in jsFiddle . Now in version 9 it should be finally correct :-D
has comment: http://stackoverflow.com/comment/38932854
has comment: http://stackoverflow.com/comment/38907781
has comment: http://stackoverflow.com/comment/39065948
has comment: http://stackoverflow.com/comment/39028447
has comment: http://stackoverflow.com/comment/38908394
type: Question
has comment: http://stackoverflow.com/comment/39025526
tagged with: javascript
linked to: http://stackoverflow.com/q/2856502
has comment: http://stackoverflow.com/comment/39023423
tagged with: cross-domain
has answer: http://stackoverflow.com/a/25114931
tagged with: firefox
answer count: 1
downvote count: 0
favorite count: 0
has title: Firefox doesn't sent cookie in cross browser request declared in @font-face

http://stackoverflow.com/comment/38859163
comment on: http://stackoverflow.com/a/24994153
score: 1
has text: They DO NOT have the same effect. `new Array()` predefined a length, `[]` does not. When you do `[]`, you are creating an array. When you do `new Array()` you are creating an **object with the functionality of an array**. http://stackoverflow.com/a/1273936/2068709
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25036908
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25036638
score: 0
type: Answer
has body: attachEvent uses the "on" prefix for events, so you need to change your code to, and you need to attach the event to the document instead of window. else if (window.attachEvent){//IE7... alert("IE7 - window.attachEvent: " + wheelEvent); document.attachEvent("on"+wheelEvent, scrollHandler); }
has comment: http://stackoverflow.com/comment/38944333
has comment: http://stackoverflow.com/comment/38950228
accepted answer of: http://stackoverflow.com/q/25036638

http://stackoverflow.com/q/25050714
tagged with: each
has comment: http://stackoverflow.com/comment/38966035
tagged with: prototypejs
has comment: http://stackoverflow.com/comment/38966055
has answer: http://stackoverflow.com/a/25050822
tagged with: this
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25050822
type: AnsweredQuestion
score: 1
has body: I'm trying to find a div element with example selector that also has active selector as denoted in the code. With Prototype JS this returns windows.object rather than an individual div itself. How do I make this to refer to each div element so that I can play with it? $$('.example').each(function() { if(this.hasClassName('active')) { this.previous().setStyle({border:'1px solid #999'}) } });
favorite count: 0
has title: 'this' inside each function in Prototype JS
type: Question
upvote count: 1
answer count: 1

http://stackoverflow.com/q/25068207
tagged with: javascript
downvote count: 0
has body: I have a problem with my application Cordova / Angularjs. I can log me in my api that returns me a cookie : Set-Cookie:token=654vze45ze566ze5; But I can not recover those values ​​and return them when I do a "GET". I tried with ngCookies but apparently cookies do not work on phonegap, How can I read and retrieve the header Set-Cookie ?
favorite count: 0
tagged with: cordova
tagged with: angularjs
answer count: 0
upvote count: 2
type: UnansweredQuestion
score: 2
has title: read header cookie with Angularjs and Cordova/Phonegap
tagged with: cookies
type: Question
tagged with: api

http://stackoverflow.com/comment/47990759
has text: My own implementation
comment on: http://stackoverflow.com/q/25026086
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24985912
has comment: http://stackoverflow.com/comment/38844257
has comment: http://stackoverflow.com/comment/38843828
type: Question
has comment: http://stackoverflow.com/comment/38843901
has comment: http://stackoverflow.com/comment/38843876
has comment: http://stackoverflow.com/comment/38843896
has comment: http://stackoverflow.com/comment/38844175
has body: I'm trying to use variables placed inside a function. I'm not looking to do anything particular with this piece of code, but I want to figure out why bind / apply / call work for objects, and not functions. function another () { this.var = 'another test' } function test (){ this.var = 'test123' console.log('this.first: ',this.var); } var bind = test.bind(another); console.log('bind: ', bind());
tagged with: javascript
has title: .bind() doesn't work for functions
has comment: http://stackoverflow.com/comment/38844263
answer count: 2
accepted answer: http://stackoverflow.com/a/24986245
has comment: http://stackoverflow.com/comment/38843861
downvote count: 0
has comment: http://stackoverflow.com/comment/38843850
favorite count: 0
possible better answer: http://stackoverflow.com/a/24986138
has answer: http://stackoverflow.com/a/24986245
has comment: http://stackoverflow.com/comment/38843899
has answer: http://stackoverflow.com/a/24986138
score: 2
type: AnsweredQuestion
upvote count: 2

http://stackoverflow.com/a/25049725
type: Answer
has comment: http://stackoverflow.com/comment/38965181
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25049699
upvote count: 2
has body: You have two elements with the same id in html. So when you do this $('#search_id').val() only one of them will get evaluated and not both. Ids are supposed to be unique

http://stackoverflow.com/a/24997440
answers question: http://stackoverflow.com/q/24997370
has comment: http://stackoverflow.com/comment/38868398
has comment: http://stackoverflow.com/comment/38866328
upvote count: 1
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38865445
has body: Hold ctrl and click on the elements. It can also be used to make multiple selections.
score: 1

http://stackoverflow.com/a/24987513
has comment: http://stackoverflow.com/comment/43109746
has comment: http://stackoverflow.com/comment/57528005
has comment: http://stackoverflow.com/comment/43345042
downvote count: 1
upvote count: 33
has comment: http://stackoverflow.com/comment/66372790
score: 32
type: Answer
has body: You need to include ui.bootstrap module in your app. var app = angular.module('App', ['ui.router','ui.bootstrap']); and also remove ui-sref from the dropdown trigger. a Plnkr
answers question: http://stackoverflow.com/q/24987000
has comment: http://stackoverflow.com/comment/57202464

http://stackoverflow.com/a/24938002
score: 2
has body: use relative for the children, not fixed.
upvote count: 2
answers question: http://stackoverflow.com/q/24937904
type: Answer
downvote count: 0

http://stackoverflow.com/q/25060154
has comment: http://stackoverflow.com/comment/38984221
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38983885
has comment: http://stackoverflow.com/comment/38984516
has comment: http://stackoverflow.com/comment/38984548
has answer: http://stackoverflow.com/a/25060348
tagged with: javascript
linked to: http://stackoverflow.com/q/6132796
tagged with: ajax
has body: I want to catch cross domain response in pure javascript ajax not using jquery or other external libraries. var xmlhttp, response; try { xmlhttp = new XMLHttpRequest(); } catch(e) { try { xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e2) { try { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState==4) { if(callback != undefined) { console.log(xmlhttp.responseText); } } } url = "http://xxxx.com/layer.php?callback=callRes"; xmlhttp.open("GET", url, false); xmlhttp.setRequestHeader("Content-Type", "application/json,application/javascript,text/javascript"); xmlhttp.send(); spent lots of time and googling but not find any solution suggestions are most welcome but not script method only pure javascript ajax
type: Question
has title: Catch cross domain response in pure javascript ajax
duplicate of: http://stackoverflow.com/q/6132796
has comment: http://stackoverflow.com/comment/38983846
has comment: http://stackoverflow.com/comment/38985227
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38985152

http://stackoverflow.com/comment/38930983
has text: @MatthieuM., absolutely. It was a typo and it has been fixed. Thanks for pointing it out!
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24976098
score: 0

http://stackoverflow.com/q/24989065
score: 2
has answer: http://stackoverflow.com/a/24989191
has comment: http://stackoverflow.com/comment/38850057
downvote count: 0
type: Question
has answer: http://stackoverflow.com/a/24989469
tagged with: javascript
upvote count: 2
has body: I know there are a lot of regex threads out there but I couldn't find anywhere. I have a regex that work well with DD/MM/YYYY format. Here it is: ^((0?[13578]|1[02])[\/.]31[\/.][1-9][0-9]{3})|(([01,1]|0[3-9]|1[1-2])[\/.](29|30)[\/.][1-9][0-9]{3})|((0?[1-9]|1[0-2])[\/.](0?[1-9]|1[0-9]|2[0-8])[\/.][1-9][0-9]{3})|([02,2][\/.]29[\/.](([1-9][0-9](04|08|[2468][048]|[13579][26]))|([2468][0]{3})))$ Example: 29/2/2014,31/4/2014... But when i was trying to validate with YYYY/MM/DD format, i had found this: ^(((19|20)([2468][048]|[13579][26]|0[48])|2000)[\/.]02[\/.]29|((19|20)[0-9]{2}[\/.](0?[469]|11)[\/.](0?[1-9]|[12][0-9]|30)|(19|20)[0-9]{2}[\/.](0?[13578]|1[02])[\/.](0?[1-9]|[12][0-9]|3[01])|(19|20)[0-9]{2}[\/.]02[\/.](0?[1-9]|1[0-9]|2[0-8])))$ This pattern just only works with YYYY from: 19xx -> 20xxx. When i changed it, I expect it can work well with YYYY from: 1xxx ->9xxx. But it did not do well. I'm new in regex, and it's hard to escape it. Thanks a lot and sorry for my bad English.
answer count: 2
favorite count: 0
type: UnansweredQuestion
tagged with: regex
has title: Trying to validate YYYY/MM/dd

http://stackoverflow.com/comment/38716114
has text: The hash is not concatenated with "elem", but with $(elem).closest('table').attr('id')+"_cname", wich is a string. Original code has: " "
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24917339
type: Comment

http://stackoverflow.com/comment/38996112
type: Comment
type: QuestionComment
has text: See http://stackoverflow.com/questions/17410761/how-to-quickly-update-a-large-buffergeometry
comment on: http://stackoverflow.com/q/25066173
score: 0

http://stackoverflow.com/a/25001818
accepted answer of: http://stackoverflow.com/q/24967190
answers question: http://stackoverflow.com/q/24967190
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: It's important to understand that a "key-value array" in Javascript by definition means you're talking about an object. Because objects are key-value, and arrays are index-value. Your piece of code is a little hard to read because I have no idea what input you are giving or what output you are expecting. But if I understand it correctly, you would like to return an object with two attributes: sold and open, so you can refer to it as reply.sold and reply.open. This means that reply should be an object, with two keys: "sold" and "open". The two values for these two keys will both be an array containing orders. These don't need to be an object, because do not need keys. You can actually define object reply, and the two arrays reply.sold and reply.open in one line: var reply = { sold: [], open: [] } which means your response function would look like this: var response = function(sold, open){ reply.sold.push(sold); reply.open.push(open); callback(reply); }; In the end this would be the structure of reply: { sold: [ order1, order2, order3, ... ], open: [ orderA, orderB, orderC, ... ] } Since reply.sold and reply.open are now arrays, you could simply use .join(glue) to convert them into a much more readable string: var soldString = reply.sold.join(", ") // "order1, order2, order3, ..." var openString = reply.open.join(", ") // "orderA, orderB, orderC, ..." Another useful thing about using arrays in this case would be that you could actually give the orders a specific order (no pun intended). With objects, most Javascript engines will run through the attributes in alphabetical order when doing a "for in" loop. However, this is not guarantied. But when calling .forEach() on an array, or when doing a regular for loop. // assuming object "obj", and array "arr" for(var key in obj) { /* order of "key" is not guarantied */ } for(var i = 0; i &lt; arr.length - 1; i ++) { /* "i" is always in ascending order */ } Hope this helps a bit.
type: Answer

http://stackoverflow.com/comment/38872146
comment on: http://stackoverflow.com/a/25000799
type: Comment
has text: just take out the var line... the casper object already exists.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25009295
has comment: http://stackoverflow.com/comment/38887855
type: Question
upvote count: 4
has comment: http://stackoverflow.com/comment/38931294
answer count: 2
has comment: http://stackoverflow.com/comment/38887840
downvote count: 0
has comment: http://stackoverflow.com/comment/38936592
tagged with: javascript
tagged with: jquery
score: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/38930671
has comment: http://stackoverflow.com/comment/38888118
has comment: http://stackoverflow.com/comment/38931116
tagged with: http://stackoverflow.com/tag/csv
has comment: http://stackoverflow.com/comment/38887988
has body: I have large amount of table data (say 22k rows). These 22k rows are populated from a json file. What i want to do now is to export these data to CSV. // json datas here.. ( say , 22k rows Generate File js file : $(document).ready(function() { $('button').click(function() { var data = $('#txt').val(); if (data == '') return; JSONToCSVConvertor(data, "Data Excel", true); }); }); function JSONToCSVConvertor(JSONData, ReportTitle, ShowLabel) { var arrData = typeof JSONData != 'object' ? JSON.parse(JSONData) : JSONData; var CSV = ''; CSV += ReportTitle + '\r\n\n'; if (ShowLabel) { var row = ""; for (var index in arrData[0]) { row += index + ','; } row = row.slice(0, -1); CSV += row + '\r\n'; } for (var i = 0; i < arrData.length; i++) { var row = ""; for (var index in arrData[i]) { row += '"' + arrData[i][index] + '",'; } row.slice(0, row.length - 1); CSV += row + '\r\n'; } if (CSV == '') { alert("Invalid data"); return; } var fileName = "MyReport_"; fileName += ReportTitle.replace(/ /g, "_"); var uri = 'data:text/csv;charset=utf-8,' + escape(CSV); var link = document.createElement("a"); link.href = uri; link.style = "visibility:hidden"; link.download = fileName + ".csv"; document.body.appendChild(link); link.click(); document.body.removeChild(link); } how to write a js file to export all these 22k rows to excel without browser crash ? (it shouldn't show kill pages ).
has comment: http://stackoverflow.com/comment/38932587
has title: how to export large amount of json data to CSV without browser crash?
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/8847766
has comment: http://stackoverflow.com/comment/38887841
has comment: http://stackoverflow.com/comment/38927299
has answer: http://stackoverflow.com/a/48587458
has answer: http://stackoverflow.com/a/25021964
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38887774

http://stackoverflow.com/q/25069249
answer count: 2
tagged with: highcharts
downvote count: 0
score: 1
favorite count: 0
possible better answer: http://stackoverflow.com/a/25069561
has answer: http://stackoverflow.com/a/25069561
type: AnsweredQuestion
upvote count: 1
type: Question
tagged with: charts
has body: This may be more of a scope question than a HighCharts question. I have a function that changes the chart type, please see below: function ChangeChartType(chart, newType) { newType = newType.toLowerCase(); var numberofseries = chart.series.length; var i = 0; if (newType == 'reset') { for (i; i &lt; numberofseries; i++) { if (typeof chart.series[i].defaulttype == 'string') { chart.series[i].update({ type: chart.series[i].defaulttype }); } } } else { for (i; i &lt; numberofseries; i++) { if (typeof chart.series[i].defaulttype != 'string') { chart.series[i].defaulttype = chart.series[i].type; //The new property does not survive } chart.series[i].update({ type: newType }); } } } I am trying to create a new property on the series objects named "defaulttype" in order to save the chart type that was set when the chart was created. When a "Reset" button is clicked I want to change the chart type back to what is stored in the property. The problem is the new property disappears outside of the function. What am I missing? Any help would be appreciated. I created a fiddle to demonstrate the entire issue. http://jsfiddle.net/xeRRS/9/
has answer: http://stackoverflow.com/a/25077556
has comment: http://stackoverflow.com/comment/39020678
tagged with: javascript
has title: Save series chart type for later use
accepted answer: http://stackoverflow.com/a/25077556

http://stackoverflow.com/a/24999732
has body: You can do: $('#tableSectionDetails tbody td').dblclick(function(){ var value = $(this).closest("tr").find("select").val(); });
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24999549
accepted answer of: http://stackoverflow.com/q/24999549
has comment: http://stackoverflow.com/comment/38870031
type: AcceptedAnswer

http://stackoverflow.com/q/24982914
tagged with: jquery
tagged with: css
type: UnansweredQuestion
tagged with: slidetoggle
has answer: http://stackoverflow.com/a/24983011
has body: I have a lot of content that I am using in an FAQ type setup. When a user clicks on any number of links it will expand the section and reveal a list of items which they themselves can be expanded too. What I am trying to accomplish is to have some of these list items expand when the FAQ div is toggled. So the user clicks on the link that expands the list of items and the focus is set to the exact item content that goes with that link. Basically, like a hyperlink anchor would do only all of this content is on one page and there is a slideToggle followed by another slide toggle. I made a fiddle of what I am trying to accomplish here: JSFiddle If you want to know more information about this exact item click here! Info block one Info Block Answer $( "#infoLink" ).click(function() { $( "#contentBlock" ).slideToggle( "slow", function() { }); }); $( "#clicke" ).click(function() { $( "#myHiddenContent" ).slideToggle( "slow", function() { }); });
has title: Expand hidden content in newly expanded div
type: Question
score: 0
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38861802
type: Comment
comment on: http://stackoverflow.com/a/24995574
type: AnswerComment
score: 1
has text: I would add cleaner solution: function myfun(el) { document.getElementById("putpara").innerHTML = el.innerHTML; }, and "

http://stackoverflow.com/q/24997863
has comment: http://stackoverflow.com/comment/38866049
tagged with: jquery
has body: i just use jquery shake effect and that is why i include two jquery file. here is code which shake a div var isShaking = false; $(document).ready(function() { setInterval(function() { if (!isShaking) { if ($('#&lt;% =EnableCookie.ClientID %&gt;').length &gt; 0) { isShaking = true; $('#&lt;% =EnableCookie.ClientID %&gt;').effect('shake', 100, function() { isShaking = false; }); } } }, 3000); }); when i am running the apps then shake effect play again &amp; again but firebug gives a error called b.delegate is not a function which is not clear to me and also i am not being able to understand where i am making the mistake. so please guide me. thanks
favorite count: 0
has comment: http://stackoverflow.com/comment/38866127
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24997982
score: 1
upvote count: 1
type: Question
has title: b.delegate is not a function exception
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24997982
has comment: http://stackoverflow.com/comment/38866138
answer count: 1
downvote count: 0

image
tags question: http://stackoverflow.com/q/25002008
tags question: http://stackoverflow.com/q/25007785
tags question: http://stackoverflow.com/q/25017499
tags question: http://stackoverflow.com/q/25005927
tags question: http://stackoverflow.com/q/24992773
tags question: http://stackoverflow.com/q/24987759
tags question: http://stackoverflow.com/q/24922534
tags question: http://stackoverflow.com/q/25002864
tags question: http://stackoverflow.com/q/25009759
tags question: http://stackoverflow.com/q/25064028
tags question: http://stackoverflow.com/q/25022660
tags question: http://stackoverflow.com/q/24976567
tags question: http://stackoverflow.com/q/24923912
tags question: http://stackoverflow.com/q/24984041
tags question: http://stackoverflow.com/q/24918911
tags question: http://stackoverflow.com/q/24928295
tags question: http://stackoverflow.com/q/24935264
tags question: http://stackoverflow.com/q/25049094
tags question: http://stackoverflow.com/q/24976547
tags question: http://stackoverflow.com/q/24971729
tags question: http://stackoverflow.com/q/24929820
tags question: http://stackoverflow.com/q/25023199
tags question: http://stackoverflow.com/q/24910468
tags question: http://stackoverflow.com/q/24989688
tags question: http://stackoverflow.com/q/25043788
tags question: http://stackoverflow.com/q/25007129
tags question: http://stackoverflow.com/q/25018812
tags question: http://stackoverflow.com/q/25023272
tags question: http://stackoverflow.com/q/24936070
tags question: http://stackoverflow.com/q/25022692
tags question: http://stackoverflow.com/q/24916261
tags question: http://stackoverflow.com/q/24943379
tag name: image
tags question: http://stackoverflow.com/q/24984618
tags question: http://stackoverflow.com/q/24988231
tags question: http://stackoverflow.com/q/25065035
tags question: http://stackoverflow.com/q/24910899
tags question: http://stackoverflow.com/q/24921484
tags question: http://stackoverflow.com/q/25002061
type: Tag
tags question: http://stackoverflow.com/q/24915131

http://stackoverflow.com/a/25065646
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38994732
has comment: http://stackoverflow.com/comment/38994662
accepted answer of: http://stackoverflow.com/q/25065553
upvote count: 3
has comment: http://stackoverflow.com/comment/38994105
answers question: http://stackoverflow.com/q/25065553
has comment: http://stackoverflow.com/comment/38997601
type: Answer
has comment: http://stackoverflow.com/comment/38998719
has comment: http://stackoverflow.com/comment/38994414
has comment: http://stackoverflow.com/comment/38994164
has body: What you can do is select and set all the links to "View Bio" before changing the clicked link to "Hide Bio". $(document).ready(function () { $(".viewbio").click(function() { var $self = $(this); var originalText = $self.text().trim(); $(".viewbio").text("VIEW BIO"); if (originalText == "VIEW BIO") { $self.text("HIDE BIO"); } }); });
score: 3
downvote count: 0

http://stackoverflow.com/a/24979409
has comment: http://stackoverflow.com/comment/38831610
score: 0
has body: You could try: var curHandler = $('#checkout-payment-56').attr("onclick"); $('#checkout-payment-56')[0].onclick = null; $('#checkout-payment-56').click(function () { window.location.href=window.location.href; });
answers question: http://stackoverflow.com/q/24979389
has comment: http://stackoverflow.com/comment/38838978
type: Answer
has comment: http://stackoverflow.com/comment/38844179
has comment: http://stackoverflow.com/comment/38831633
has comment: http://stackoverflow.com/comment/38831518
has comment: http://stackoverflow.com/comment/38831535

http://stackoverflow.com/comment/38940214
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25030985
score: 1
has text: Here http://jsfiddle.net/HvA4s/89/

http://stackoverflow.com/comment/38709381
comment on: http://stackoverflow.com/q/24914217
type: Comment
type: QuestionComment
score: 0
has text: `src='libraries/yui/yourlibrary.js'`?

http://stackoverflow.com/q/25037142
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38940035
has title: Drag and Drop - change background on condition
accepted answer: http://stackoverflow.com/a/25038028
downvote count: 0
answer count: 1
score: 1
favorite count: 0
tagged with: drag-and-drop
has comment: http://stackoverflow.com/comment/38940474
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25038028
upvote count: 1
has body: My aim is a little game, where statements can be dragged and dropped onto two different areas. One is correct, one isn't. Depending on that I would like to change the backgroundcolor. I am struggling with defining the conditions. list item 1 in box 1 - green / list item 1 in box 2 - red, and vice versa Example: http://codepen.io/TheRed/pen/uGKom Many thanks! HTML Box 1 Box 2 Statement 1 Statement 2 CSS #div1 {height:50px; width:400px; border:2px solid black;} #div2 {height:50px; width:400px; border:2px solid black; margin-top: 20px } p {font-weight:bold; width:200px;} and JS: function allowDrop(ev) { ev.preventDefault(); } function drag(ev) { ev.dataTransfer.setData("Text",ev.target.id); } function drop(ev) { ev.preventDefault(); var data=ev.dataTransfer.getData("Text"); if(document.getElementById(data).id == 'drag1'){ document.getElementById('div1').style.background = 'green'; } else if(document.getElementById(data).id == 'drag2'){ document.getElementById('div2').style.background = 'red'; } }

curl
tags question: http://stackoverflow.com/q/24924573
tags question: http://stackoverflow.com/q/24966526
tags question: http://stackoverflow.com/q/25019371
tag name: curl
tags question: http://stackoverflow.com/q/25009217
type: Tag

http://stackoverflow.com/a/25070199
has comment: http://stackoverflow.com/comment/39018322
score: 6
has body: I'm using cssOptimize, I was expecting a single css file in which all the used css files were imported. However I can't find such a file. Is this the way dojo compresses it's css or are my expectations wrong? If so where can I find it in my release folder? When you use cssOptimize, the Dojo build optimizes and flattens CSS files in place. So for example, if you're using Dijit's Claro theme, when you load dijit/themes/claro/claro.css from source, it contains a series of @import statements which in turn load more files. When you load claro.css from a build with cssOptimize, it is one file containing all of the styles previously referenced via those separate files. My test.js contains a function test1() if I call it from my built js it states test1 is not defined. I call that function directly without dojo. I'm assuming that building custom js only works if it is a dojo class using declare? Dojo doesn't expect every JS file to be a "class" using declare but it does expect each file to be a module which doesn't implicitly define globals (since globals should be avoided in modules anyway). When the build process encounters a module that it thinks or knows isn't AMD, it assumes it's a legacy Dojo module and wraps it in a boilerplate to convert it to AMD. This boilerplate ends up encapsulating your globals into a function scope, so they are no longer globals. Given that you're using Dojo 1.7, you should ideally be using the AMD format to define and consume modules. dojotoolkit.org has a tutorial introducing AMD modules, and if you're migrating from Dojo 1.6 or earlier, there's also a tutorial to help you transition. Final question, I needed to include several dojo files in the build manually such as dojo._firebug.firebug since after my initial build it was still using xhr calls to get those files. After including the files manually I still see xhr calls from dojo to specific resources: dojo/nls/dojo_ROOT and dijit/form/nls/validate.js. Those files are created during the bu…
upvote count: 6
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25054253
type: Answer
accepted answer of: http://stackoverflow.com/q/25054253
downvote count: 0

http://stackoverflow.com/a/24960777
accepted answer of: http://stackoverflow.com/q/24960647
downvote count: 0
answers question: http://stackoverflow.com/q/24960647
type: AcceptedAnswer
score: 1
type: Answer
upvote count: 1
has body: Mostly right, though you have an extra click handler. This should work: $(document).ready(function(){ $("#identity").click(function(e){ e.preventDefault(); if ($(this).hasClass("active") ) { $("#fromfrancetoggle").animate({opacity: "1"}, 500 ); $("#lamiettetoggle").animate({opacity: "1"}, 500 ); $(this).removeClass("active"); } else { $("#fromfrancetoggle").animate({opacity: "0"}, 500 ); $("#lamiettetoggle").animate({opacity: "0"}, 500 ); $(this).addClass("active"); } return false; }); $("#identity").trigger("click"); // initial fade }); The trigger() call replaces the initial fade out -- remove that if it's not what you want. As noted by other answers, you can just call toggle directly on the jQuery selector.

http://stackoverflow.com/q/24981969
answer count: 3
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24982005
has answer: http://stackoverflow.com/a/24982005
has title: Table [Row] cannot be deleted using jquery
has comment: http://stackoverflow.com/comment/38836202
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38836155
has answer: http://stackoverflow.com/a/24982052
has answer: http://stackoverflow.com/a/24982048
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38836268
has body: I am having trouble deleting the row off the table using the button. Live: http://jsfiddle.net/Z7fG7/21/ HTML: Choose a Person Bob Kyle First Last Name JS/Jquery: $('.combobox').change(function(e) { var selectedVal = $(this).val(); $('.table').append(' ' + selectedVal + ' '); }); $('table td img.delete').click(function(){ $(this).parent().parent().remove(); }); I am using Bootstrap. Any help would be great!
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24982052
has comment: http://stackoverflow.com/comment/38836105
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38836115
score: 0

http://stackoverflow.com/comment/38923869
score: 0
type: Comment
type: QuestionComment
has text: Yes thats right. Pages is simply an array of JSON objects, so you can iterate over it and get the `name` (or any other) property from each `page` object.
comment on: http://stackoverflow.com/q/25028008

http://stackoverflow.com/q/25009211
tagged with: php
has comment: http://stackoverflow.com/comment/38887601
answer count: 0
score: 0
type: UnansweredQuestion
type: Question
tagged with: magento
has title: Change color and sku at the same time in magento simple configurable product
has comment: http://stackoverflow.com/comment/38900076
has body: I am using colour select plus extension. I want to change SKU of selected product at the same time it swatches its colour. now i am using the function to change SKU. when i call that function colour swatches stops to work. php: <select name="super_attribute[<?php echo $attributeId ?>]" id="attribute<?php echo $attributeId ?>" class="required-entry super-attribute-select<?php if($hide == 1) echo ' swatchSelect' ?>" onchange="return changeSku(<?php echo $_attribute->getAttributeId() ?>, this), 300);"> <?php echo $this->__('Choose an Option...') ?> function changeSku(confAttributeId, sel){ var productMap = <?php echo Mage::helper('core')->jsonEncode($productMap);?>; var selectedAttributeId = sel.options[sel.selectedIndex].value; if (selectedAttributeId) { var options = spConfig.config.attributes[confAttributeId].options; var productId = options.find(function (option) {return option.id == selectedAttributeId}).products[0] $("sku-container").update(" Product SKU: " + productMap[productId])+ " "; } else { $("sku-container").update("<?php echo $_product->getSku() ?>"); } }
tagged with: javascript
tagged with: ajax

http://stackoverflow.com/q/25026086
downvote count: 0
tagged with: meteor
has comment: http://stackoverflow.com/comment/47934663
favorite count: 0
tagged with: jquery-file-upload
type: Question
upvote count: 2
has title: Cloudinary direct upload with upload preset and Meteor.js
tagged with: cloudinary
answer count: 1
has answer: http://stackoverflow.com/a/25027518
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has comment: http://stackoverflow.com/comment/47990759
has body: So I can upload images to Cloudinary via the form-based approach in http://cloudinary.com/blog/direct_upload_made_easy_from_browser_or_mobile_app_to_the_cloud#face_detection_based_thumbnail, but when I attempt to augment a existing file input it gives me progress saying that file is uploading, but errors out stating that the file is missing. {"error":{"message":"Missing required parameter - file"}} The js code is: Template.fileUpload.created = function () { $.cloudinary.config({ cloud_name: "theCloudName" }) }; Template.fileUpload.rendered = function () { var fileUploadCallback = function(err, result){ if(err){ console.log("Error: " + err.reason); }else{ console.log("Success: " + result); } }; $('input').unsigned_cloudinary_upload("discussionAdd", { cloud_name: 'theCloudName', tags: 'discussionAdd' }, { multiple: true }).bind('cloudinarydone', function (e, data) { $('.thumbnails').append($.cloudinary.image(data.result.public_id, { format: 'jpg', width: 150, height: 100, crop: 'thumb', gravity: 'face', effect: 'saturation:50' })) } ).bind('cloudinaryprogress', function (e, data) { console.log("data loaded is : " + data.loaded + " data size: " + data.total); $('.progress_bar').css('width', Math.round((data.loaded * 100.0) / data.total) + '%'); }); }; and markup is: &lt;template name="fileUpload"&gt; &lt;form class='upload_form'&gt; upload an image &lt;input type="file" class='upload_field cloudinary_fileupload'&gt; &lt;div class="progress_bar" style='background-color: red, height: 20px'&gt; &lt;div class='thumbnails'&gt;&lt;/div&gt; &lt;/div&gt; &lt;/form&gt; &lt;/template&gt;
score: 2

http://stackoverflow.com/comment/38946832
has text: I'm sorry now i see, but with post you can send parameter by url and the controller catch them(you can test and work). but i think the best solution is serialize the data. http://stackoverflow.com/questions/15173965/serializing-and-submitting-a-form-with-jquery-post-and-php . Other solution that you can try is assigned the position for every array like: 'array[0] =val2" this may be work too
score: 0
comment on: http://stackoverflow.com/q/25037733
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24916648
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24930143
has comment: http://stackoverflow.com/comment/38714246
has body: I am running Simple Image Gallery Pro 3.0.4 on a Joomla 3.3 website. The gallery creates images correctly, but I am unable to save captions or descriptions. When I view the gallery in SIG Pro, add my captions, and click "Save", nothing happens. When I checked the console in Firebug, I get this error: ReferenceError: submitform is not defined submitform(pressbutton);
upvote count: 2
downvote count: 2
has comment: http://stackoverflow.com/comment/38714156
has comment: http://stackoverflow.com/comment/38715740
type: Question
has comment: http://stackoverflow.com/comment/38713833
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
has title: Simple Image Gallery Pro submitform is not defined
has answer: http://stackoverflow.com/a/40940399
has comment: http://stackoverflow.com/comment/38714278
favorite count: 0
tagged with: joomla3.0

http://stackoverflow.com/comment/38784181
type: Comment
has text: Thank you for your help, this is what I get from AJAX :http://jsfiddle.net/5HPPw/ and this is the missing code : http://jsfiddle.net/U5Ys7/ If you need something else, don't hesitate to tell it to me.
comment on: http://stackoverflow.com/a/24953608
type: AnswerComment
score: 0

http://stackoverflow.com/q/25044848
type: Question
linked to: http://stackoverflow.com/q/17077386
answer count: 1
downvote count: 0
tagged with: powershell
tagged with: javascript
linked to: http://stackoverflow.com/q/1444330
tagged with: serial-port
has title: Powershell script; click javascript link
has comment: http://stackoverflow.com/comment/39149037
favorite count: 0
type: UnansweredQuestion
has body: I'm writing a login script that will sit in the background and pass serial port data to a web page. I've gotten everything working but the last click. Based on these two posts: Powershell click on javascript link Execute javascript trough Internet Explorer's com interface using PowerShell This is my script: # Variables $username = "user" $password = "pass" $item = "" $portnumber = "COM6" #open port and wait for data $port = new-object system.io.ports.serialport $portnumber,9600,none,8,one $port | add-member -membertype "NoteProperty" -name "identifier" -value "Serial" $port.open() $ie = New-Object -com InternetExplorer.Application $ie.visible=$true Function Login($name,$pass){ $ie.navigate2("http://site/login.aspx") while($ie.busy) {start-sleep -s 1} $ie.document.getElementById("LoginName").value= $name sleep -s 1 $ie.document.getElementById("Password").value = $pass sleep -s 1 $ie.document.getElementById("LoginBtn").click() sleep -s 2 } Function Lookup($itemnumber){ $ie.navigate2("http://site/itemLookup.aspx") while($ie.ReadyState -ne 4) {start-sleep -s 1} $ie.document.getElementById("ctl00_PageBody_ItemNumberBox").value = $itemnumber sleep -s 1 $ie.document.getElementById("ctl00_PageBody_RetrieveButton").click() while($ie.ReadyState -ne 4) {start-sleep -s 1} sleep -s 2 $details = @( $ie.document.getelementsbytagname('a')) | where-object {$_.innerText -eq 'Details'} $details.click() } try{ Do{ $itemno = $port.readline() write-host $itemno #check for ie not timed-out if (!($ie.navigate2("http://site/dashboard.aspx"))) { sleep -s 2 Login -name $username -pass $password Lookup -itemnumber $itemno } else { Lookup -itemnumber $itemno } } while ($port.isopen -eq $true) }#end try catch{"$_" ; $ie.quit(); $port.close(); $port.dispose(); exit} In the Lookup function is where I'm having trouble. I can run each line in a console and it works fine, but as a script it fails at assigning the $details variable, and therefore won't load the last page. This is the page element I'm …
upvote count: 1
has answer: http://stackoverflow.com/a/29175482
score: 1

http://stackoverflow.com/a/45464959
has comment: http://stackoverflow.com/comment/94560385
answers question: http://stackoverflow.com/q/24998624
upvote count: 331
has comment: http://stackoverflow.com/comment/94439785
has comment: http://stackoverflow.com/comment/77900456
has comment: http://stackoverflow.com/comment/102655412
downvote count: 0
score: 331
has comment: http://stackoverflow.com/comment/102285517
has comment: http://stackoverflow.com/comment/101223521
type: Answer
has comment: http://stackoverflow.com/comment/101953039
has comment: http://stackoverflow.com/comment/136350701
has comment: http://stackoverflow.com/comment/94484118
has body: Use the methods provided by the standard JavaScript Date class: Getting the day name from a date: function getDayName(dateStr, locale) { var date = new Date(dateStr); return date.toLocaleDateString(locale, { weekday: 'long' }); } var dateStr = '05/23/2014'; var day = getDayName(dateStr, "nl-NL"); // Gives back 'Vrijdag' which is Dutch for Friday. Getting all weekdays in an array: function getWeekDays(locale) { var baseDate = new Date(Date.UTC(2017, 0, 2)); // just a Monday var weekDays = []; for(i = 0; i < 7; i++) { weekDays.push(baseDate.toLocaleDateString(locale, { weekday: 'long' })); baseDate.setDate(baseDate.getDate() + 1); } return weekDays; } var weekDays = getWeekDays('nl-NL'); // Gives back { 'maandag', 'dinsdag', 'woensdag', 'donderdag', 'vrijdag', 'zaterdag', 'zondag'} which are the days of the week in Dutch. For American dates use 'en-US' as locale.
has comment: http://stackoverflow.com/comment/114377370
has comment: http://stackoverflow.com/comment/88455177
has comment: http://stackoverflow.com/comment/88306059

c#
tags question: http://stackoverflow.com/q/24976310
tags question: http://stackoverflow.com/q/25003064
tags question: http://stackoverflow.com/q/25038763
tags question: http://stackoverflow.com/q/25018787
tags question: http://stackoverflow.com/q/24991377
tags question: http://stackoverflow.com/q/24973740
tags question: http://stackoverflow.com/q/25055851
tags question: http://stackoverflow.com/q/25048815
tag name: c#
tags question: http://stackoverflow.com/q/24938921
tags question: http://stackoverflow.com/q/24911611
tags question: http://stackoverflow.com/q/24979195
tags question: http://stackoverflow.com/q/24950528
tags question: http://stackoverflow.com/q/24911166
tags question: http://stackoverflow.com/q/25052891
tags question: http://stackoverflow.com/q/25015555
tags question: http://stackoverflow.com/q/24914237
tags question: http://stackoverflow.com/q/24951419
tags question: http://stackoverflow.com/q/24939518
tags question: http://stackoverflow.com/q/24928269
tags question: http://stackoverflow.com/q/25003332
tags question: http://stackoverflow.com/q/24930601
tags question: http://stackoverflow.com/q/24955862
tags question: http://stackoverflow.com/q/24969866
tags question: http://stackoverflow.com/q/24914679
tags question: http://stackoverflow.com/q/24976843
tags question: http://stackoverflow.com/q/25049267
tags question: http://stackoverflow.com/q/24993724
tags question: http://stackoverflow.com/q/25058515
tags question: http://stackoverflow.com/q/25031440
tags question: http://stackoverflow.com/q/24935930
tags question: http://stackoverflow.com/q/25058553
tags question: http://stackoverflow.com/q/25053065
tags question: http://stackoverflow.com/q/24993706
tags question: http://stackoverflow.com/q/25024255
tags question: http://stackoverflow.com/q/24974018
tags question: http://stackoverflow.com/q/24966568
tags question: http://stackoverflow.com/q/24936749
tags question: http://stackoverflow.com/q/24932938
tags question: http://stackoverflow.com/q/24959210
tags question: http://stackoverflow.com/q/25068210
tags question: http://stackoverflow.com/q/24919397
tags question: http://stackoverflow.com/q/24958762
tags question: http://stackoverflow.com/q/24934655
tags question: http://stackoverflow.com/q/24910300
tags question: http://stackoverflow.com/q/24960483
tags question: http://stackoverflow.com/q/24911028
tags question: http://stackoverflow.com/q/24938957
tags question: http://stackoverflow.com/q/24998781
tags question: http://stackoverflow.com/q/24913658
tags question: http://stackoverflow.com/q/25001680
tags question: http://stackoverflow.com/q/24914886
tags question: http://stackoverflow.com/q/25059449
tags question: http://stackoverflow.com/q/24914956
type: Tag
tags question: http://stackoverflow.com/q/24910614
tags question: http://stackoverflow.com/q/25020261
tags question: http://stackoverflow.com/q/25013942
tags question: http://stackoverflow.com/q/24978198
tags question: http://stackoverflow.com/q/25042509
tags question: http://stackoverflow.com/q/24945979
tags question: http://stackoverflow.com/q/24994719
tags question: http://stackoverflow.com/q/24987296
tags question: http://stackoverflow.com/q/25060397
tags question: http://stackoverflow.com/q/25029673
tags question: http://stackoverflow.com/q/24918895
tags question: http://stackoverflow.com/q/24989570
tags question: http://stackoverflow.com/q/25028061
tags question: http://stackoverflow.com/q/24910301
tags question: http://stackoverflow.com/q/25062294
tags question: http://stackoverflow.com/q/24983566
tags question: http://stackoverflow.com/q/25016481
tags question: http://stackoverflow.com/q/25056004
tags question: http://stackoverflow.com/q/24980393
tags question: http://stackoverflow.com/q/25056856
tags question: http://stackoverflow.com/q/24992812

http://stackoverflow.com/a/25041002
has comment: http://stackoverflow.com/comment/38977018
answers question: http://stackoverflow.com/q/25040701
has comment: http://stackoverflow.com/comment/38970867
has body: If you have problems like this one, then start jconsole and connect to the process. If Eclipse refuses the connection, add -Dcom.sun.management.jmxremote=true after the line -vmargs in eclipse.ini. When Eclipse "hangs", look which threads are active and create a snapshot of the stack trace. That'll give you an idea which methods are busy. Related: Tool for debugging hangs in java application
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38970401

http://stackoverflow.com/q/24947801
has body: Whenever i refresh the page the words shuffle. For example "May I# know# your name?". It shuffle to "know May I your name". I want it the exact correct sentences to print out with your the "#" like" May I know your name?" After clicking the SHUFFLE button it will then shuffle. HTML: .box { width:200px; height:20px; padding:10px; border:1px solid #aaaaaa; display: inline-block; } .mover{ color:red; background-color: yellow; width:auto ; font-size: 30px ; border: 2px; } #id1 { color:black; background-color: #2BFFB6; width:150px ; font-size: 40px ; border: 1px; display: inline; margin: 20px; } #id2 { color:black; background-color: #2BFFB6; width:150px ; font-size: 40px ; border: 1px; display: inline; margin: 20px; } #id3 { color:black; background-color: #2BFFB6; width:150px ; font-size: 40px ; border: 1px; display: inline; margin: 20px; } #id4 { color:black; background-color: #2BFFB6; width:150px ; font-size: 40px ; border: 1px; display: inline; margin: 20px; } #id5 { color:black; background-color: #2BFFB6; width:150px ; font-size: 40px ; border: 1px; display: inline; margin: 20px; } #id6 { color:black; background-color: #2BFFB6; width:150px ; font-size: 40px ; border:1px; display: inline; margin: 20px; } Is this draggable and droppable? <?php $conn = mysql_connect("localhost", "root", "password"); if (!mysql_select_db("login")) { echo "Unable to select go database " . mysql_error(); exit; } $sql = "SELECT table FROM se WHERE id = 1"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { $output = $row["full"]; } mysql_free_result($result); ?> SHUFFLE
downvote count: 0
tagged with: javascript
has title: Shuffle function when on click button
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24950313
favorite count: 0
tagged with: shuffle
type: UnansweredQuestion
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/24948320
score: 1
type: Question
answer count: 2

http://stackoverflow.com/comment/38965083
type: Comment
has text: Ah ya. Forgot about that. Thanks.
comment on: http://stackoverflow.com/q/25049680
score: 0
type: QuestionComment

http://stackoverflow.com/a/24936488
has comment: http://stackoverflow.com/comment/38763096
has body: Try replacing your array: [[{"a":1,"b":0,"c":1}],[{"a":2,"b":1,"c":1}],[{"a":2,"b":1,"c":1}]] with this: [{"a":1,"b":0,"c":1},{"a":2,"b":1,"c":1},{"a":2,"b":1,"c":1}] because each array child is having just one json object, why put it in some array []
has comment: http://stackoverflow.com/comment/38788709
score: 0
has comment: http://stackoverflow.com/comment/38774779
answers question: http://stackoverflow.com/q/24936414
type: Answer

http://stackoverflow.com/comment/38819174
type: Comment
comment on: http://stackoverflow.com/q/24972610
score: 1
has text: Join it, sort it, chunk it into pieces of the original size
type: QuestionComment

http://stackoverflow.com/comment/39024293
comment on: http://stackoverflow.com/a/25080993
type: AnswerComment
has text: I have ` ... ` Is this wrong?
score: 0
type: Comment

http://stackoverflow.com/comment/38846215
type: Comment
type: QuestionComment
has text: Instantly means you have in memory data the you need to return with promise instead of going back to the server?
comment on: http://stackoverflow.com/q/24986974
score: 0

http://stackoverflow.com/comment/72539031
score: 0
has text: `findPeaks([-1, 0, -1])` returns `[]` instead of `[0]`
type: AnswerComment
comment on: http://stackoverflow.com/a/42565092
type: Comment

http://stackoverflow.com/a/24923770
answers question: http://stackoverflow.com/q/24923120
type: Answer
has comment: http://stackoverflow.com/comment/52819582
has comment: http://stackoverflow.com/comment/93013878
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/92881162
accepted answer of: http://stackoverflow.com/q/24923120
type: AcceptedAnswer
downvote count: 0
has body: Using redirection In router.js App.Router.map(function() { this.route('accomodations'); this.route('travel'); }); In routes/travel.js App.TravelRoute = Ember.Route.extend({ redirect: function() { this.transitionTo('accomodations'); }, }); You do not have to put these in separate files (that's just where I would put them). What this does is register two routes with the router. Pick one of them to be the "main" route, and the other the "alias" route. In this case, accomodation is the main route, and travel is its alias. When the user visits /travel, they get redirected to /accomodation. This would be the default/ standard Ember way of accomplishing this, and if this sounds good to you, go for this. Another possible solution If you do not wish to have redirection happen, for some reason, and want the URL seen by the user to stay the same, but still display the same things, and behave in the same way, this is also possible. In this case, you would create two of every single Ember unit (route, controller, view, template). The smart way would be to create a base class route, and have both App.TravelRoute and App.AccomodationRoute trivially extend it; create a base class controller, and have both App.TravelController and App.AccomodationController trivially extend it; same for views, if you have them. Templates, OTOH, are a little trickier, because there is not way to extend them (that I know of). SO what you would need to do, is create either a partial or a component (decided which works better for you), and then reuse that partial/ component in both templates/accomodation.hbs and templates/travel.hbs

http://stackoverflow.com/comment/38915113
has text: That doesn't seem to align with what you wrote in your question. And either way, I'm afraid your question is likely to be closed as "too broad" without some code that you've already tried.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25023436
score: 0

jquery-ui
tags question: http://stackoverflow.com/q/25054379
tags question: http://stackoverflow.com/q/24915610
tags question: http://stackoverflow.com/q/25061577
tags question: http://stackoverflow.com/q/24925435
tags question: http://stackoverflow.com/q/24946413
tags question: http://stackoverflow.com/q/24922313
tags question: http://stackoverflow.com/q/25036446
tags question: http://stackoverflow.com/q/24968675
tags question: http://stackoverflow.com/q/24914746
tags question: http://stackoverflow.com/q/24917984
tags question: http://stackoverflow.com/q/24996320
tags question: http://stackoverflow.com/q/24967668
tags question: http://stackoverflow.com/q/24995785
tags question: http://stackoverflow.com/q/24968586
tags question: http://stackoverflow.com/q/24955722
tags question: http://stackoverflow.com/q/24978441
tags question: http://stackoverflow.com/q/24976793
tags question: http://stackoverflow.com/q/25008063
tags question: http://stackoverflow.com/q/24954130
tags question: http://stackoverflow.com/q/25065667
tags question: http://stackoverflow.com/q/24961561
tags question: http://stackoverflow.com/q/25019149
tags question: http://stackoverflow.com/q/24922008
tags question: http://stackoverflow.com/q/25044287
tags question: http://stackoverflow.com/q/24998107
tags question: http://stackoverflow.com/q/25030789
tags question: http://stackoverflow.com/q/24951484
tags question: http://stackoverflow.com/q/24957373
tags question: http://stackoverflow.com/q/24929890
tags question: http://stackoverflow.com/q/24945422
tags question: http://stackoverflow.com/q/24989909
tags question: http://stackoverflow.com/q/25016675
tags question: http://stackoverflow.com/q/25049168
tags question: http://stackoverflow.com/q/25047622
tags question: http://stackoverflow.com/q/25068740
tags question: http://stackoverflow.com/q/25061698
tags question: http://stackoverflow.com/q/24941999
tags question: http://stackoverflow.com/q/25051713
tags question: http://stackoverflow.com/q/24931135
tags question: http://stackoverflow.com/q/24966684
tags question: http://stackoverflow.com/q/25005923
tags question: http://stackoverflow.com/q/24975439
tags question: http://stackoverflow.com/q/24915422
tags question: http://stackoverflow.com/q/24979353
tags question: http://stackoverflow.com/q/24927467
tags question: http://stackoverflow.com/q/24997370
type: Tag
tags question: http://stackoverflow.com/q/25004203
tag name: jquery-ui
tags question: http://stackoverflow.com/q/24930856
tags question: http://stackoverflow.com/q/24945062
tags question: http://stackoverflow.com/q/24985485
tags question: http://stackoverflow.com/q/24931136
tags question: http://stackoverflow.com/q/25013812

http://stackoverflow.com/comment/38793095
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24958994
type: Comment
has text: In the sense that all arrays are objects, yes, but you are still logging an actual array. [example](http://jsfiddle.net/uU2Tm/) As I said, arrays CAN have properties and still be arrays. (jQuery collections being a widely-known example)

timer
tag name: timer
tags question: http://stackoverflow.com/q/25024233
tags question: http://stackoverflow.com/q/24944420
type: Tag
tags question: http://stackoverflow.com/q/24965363
tags question: http://stackoverflow.com/q/25029882
tags question: http://stackoverflow.com/q/25026062

http://stackoverflow.com/q/24995430
has body: Hello everyone i'm filtering data in SelectList when click on it, data in selectlist loading from DB. So when i click i'm get json format and my problem is correct convert to html. So here is my Controller which is correspond on filter public JsonResult Filter(string category) { var model = from e in db.Errors orderby e.Category where e.Category == category || category == null || category == "" select e; return Json(model, "true",JsonRequestBehavior.AllowGet); } and View Categories @Html.DropDownList("category", new SelectList(ViewBag.Category),new{@class="dropSearch"}) Titles: Select title Severities: Select severity Timestamp Category Title Message Severity @foreach (var item in Model) { @Html.DisplayFor(er=>item.Timestamp) @Html.DisplayFor(er => item.Category) @Html.DisplayFor(er => item.Title) @Html.DisplayFor(er => item.Message) @Html.DisplayFor(er => item.Severity) } and here is my javascript $('.dropSearch').change(function() { var url = '@Url.Action("Filter","Errors")'; $.get(url, { category: $(this).val() }, function(result) { $('.table').html(result); }); });
type: Question
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24995567
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38861602
tagged with: asp.net
has title: Convert Json to HTML MVC
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38861544
has comment: http://stackoverflow.com/comment/38862262

http://stackoverflow.com/comment/38828122
type: QuestionComment
has text: @Cheluis I know that the API is sending it correctly, I need to how to do whatever you said, because that is where my knowledge ends.
comment on: http://stackoverflow.com/q/24977558
score: 0
type: Comment

http://stackoverflow.com/comment/38762558
has text: I've tried this solution but it doesn't work. would you place your json_encode version?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24942316
type: Comment

http://stackoverflow.com/q/25002253
favorite count: 0
has comment: http://stackoverflow.com/comment/38874789
has body: This is my second foray into the world of THREE.js, the first being a short one. I just set up this scene to try some things out. It's a flat box mesh with three box meshes sitting on it. For some reason, the boxes on top are being rendered behind certain polygons of the ground mesh. Anyone have any idea why this is? Does it have something to do with the scale of the scene, or some setting I'm missing? Thanks. While I have you, does anyone know why the meshes aren't casting directional light shadows onto the ground mesh? Fiddle: http://jsfiddle.net/k8E43/1/ var scene, camera, renderer; var material; var player, ground, mesh1, mesh2; var directionalLight, spotLight, ambientLight; init(); animate(); function init() { renderer = new THREE.CanvasRenderer(); renderer.shadowMapEnabled = true; renderer.shadowMapSoft = true; renderer.setSize( window.innerWidth, window.innerHeight ); scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 1, 10000 ); camera.position.x = 0; camera.position.y = 450; camera.position.z = 750; camera.lookAt( new THREE.Vector3( 0, 150, 0 ) ); material = new THREE.MeshLambertMaterial( { color: 0xffffff } ); // Meshes player = new THREE.Mesh( new THREE.BoxGeometry( 70, 160, 70 ), material ); player.position.y = 80; player.castShadow = true; player.receiveShadow = true; scene.add( player ); ground = new THREE.Mesh( new THREE.BoxGeometry( 1000, 10, 600 ), material ); ground.position.y = -5; ground.receiveShadow = true; scene.add( ground ); mesh1 = new THREE.Mesh( new THREE.BoxGeometry( 100, 40, 100 ), material ); mesh1.position.x = -150; mesh1.position.y = 20; mesh1.position.z = 100; mesh1.castShadow = true; mesh1.receiveShadow = true; scene.add( mesh1 ); mesh2 = new THREE.Mesh( new THREE.BoxGeometry( 100, 200, 100 ), material ); mesh2.position.x = 150; mesh2.position.y = 100; mesh2.position.z = -100; mesh2.castShadow = true; mesh2.receiveShadow = true; scene.add( mesh2 ); // Lights directionalLight…
has comment: http://stackoverflow.com/comment/38875166
answer count: 0
type: UnansweredQuestion
tagged with: three.js
upvote count: 1
has title: Strange overlapping rendering in THREE.js (and some shadow issues)
score: 1
has comment: http://stackoverflow.com/comment/38875052
type: Question
downvote count: 0
tagged with: javascript

http://stackoverflow.com/a/25041102
upvote count: 3
answers question: http://stackoverflow.com/q/25041009
type: Answer
score: 3
downvote count: 0
has body: Use preventDefault to prevent the default action. $("#frm").on("submit", function(e) { $( "input[onblur]:visible:enabled" ).each(function(){ $(this).blur(); if (form_valid == 0) e.preventDefault(); }); if ( mode == "ajout" ) $('#mode_').val("ajout"); else $('#mode_').val("modif"); });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25041009

http://stackoverflow.com/comment/38958970
comment on: http://stackoverflow.com/q/25045805
score: 0
type: Comment
has text: But how do I post and then access what I posted, using AJAX, in app.js?
type: QuestionComment

http://stackoverflow.com/q/25034229
downvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/25034430
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25034369
has answer: http://stackoverflow.com/a/25034331
has comment: http://stackoverflow.com/comment/38934434
has title: Disabling input field (submit button) doesnt work with jquery 1.7
type: Question
has comment: http://stackoverflow.com/comment/38934441
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38934468
upvote count: 1
has body: I have html form: &lt;form&gt; &lt;fieldset&gt; &lt;input id="one_click_button" class="global-button" type="submit" value="Send"/&gt; &lt;/fieldset&gt; &lt;/form&gt; And none of the below works: $('input[type=submit]').prop('disabled', true); $("#one_click_button").attr("disabled","disabled"); $(':submit').attr("disabled", true); $('#one_click_button').attr("disabled", true); I have jquery 1.7 on my site, and tried to make it work on http://jsfiddle.net with jquery 1.7.1. Can someone help me to find, what is the problem with this versions (other work properly).

http://stackoverflow.com/comment/38845735
type: Comment
type: QuestionComment
has text: Did you try using `require: true` for your directives? Or did you did you want the `<tree-row>` and `<tree-grid>` elements to be there?
comment on: http://stackoverflow.com/q/24985608
score: 0

http://stackoverflow.com/comment/38788000
type: AnswerComment
comment on: http://stackoverflow.com/a/24921382
type: Comment
has text: Thanks @vittore. This solved the issue: In the view: `@Html.Hidden("hdn_l_asuetos", Html.Raw(Json.Encode(Model.l_asuetosToAvoid)))`. In the JS: `var natDaysJson = $('#hdn_l_asuetos').val(); var natDays = JSON && JSON.parse(natDaysJson) || $.parseJSON(natDaysJson);`
score: 0

http://stackoverflow.com/q/25057963
has comment: http://stackoverflow.com/comment/38979347
upvote count: 2
tagged with: append
type: AnsweredQuestion
has body: I try to use the jQuery Append method but its removing tags (tr, td) of my html code which I want to append. Why is it removing these and how can i force this method just to append and not to analyse my code? Here is an example file Add Row Column1 Column2 Column3 Column4
accepted answer: http://stackoverflow.com/a/25058046
type: Question
has title: jQuery Append removing tags
tagged with: javascript
tagged with: jquery
answer count: 2
score: 2
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
possible better answer: http://stackoverflow.com/a/25058269
favorite count: 0
has answer: http://stackoverflow.com/a/25058269
has answer: http://stackoverflow.com/a/25058046

http://stackoverflow.com/comment/39000741
score: 0
type: Comment
type: QuestionComment
has text: @Alberto: without any code, we can only guess. You aren't even telling us *where* you are attaching the event listener(s) or how the elements `A` and `B` are related. Start with some simplified HTML with the same parent / child relationship and then attach event listeners one at a time until you see the problem reappear.
comment on: http://stackoverflow.com/q/25068855

http://stackoverflow.com/q/24918393
has comment: http://stackoverflow.com/comment/38717242
has answer: http://stackoverflow.com/a/24918544
score: 2
accepted answer: http://stackoverflow.com/a/24918544
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38717335
type: Question
possible better answer: http://stackoverflow.com/a/24918730
linked to: http://stackoverflow.com/q/13088153
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/24918730
has comment: http://stackoverflow.com/comment/38726929
duplicate of: http://stackoverflow.com/q/13088153
has body: i am facing an issue. i have angularjs function which in turn call to another angularjs function which has post request.This post request always fire at last when first function ends..it is not fired sequntially. pseudo code $scope.fun1= function() { $scope.fun2(); console.log("after call to fun2"); // execute before fun2 } $scope.fun2=function() { $http.post(valid request);///this always executed at last..means at end of function 1...no matter at what position i call it } Please someone explain me this behaviour..any workaround for this...i want to execute all http request sequentially. Thanks in advance!
tagged with: javascript
favorite count: 0
has title: post request always executed at last angularjs function (not executing sequentially)
tagged with: angularjs

http://stackoverflow.com/a/27492386
score: 0
has body: If you do not plan to debug using the developer console in Chrome, you can remove this JavaScript source map file 'angular.min.js.map' from your site's markup. It will save you the "unnecessary" 404, however it shouldn't hurt by being there either.
type: Answer
answers question: http://stackoverflow.com/q/24924330

http://stackoverflow.com/comment/38935258
type: QuestionComment
comment on: http://stackoverflow.com/q/25033599
score: 0
has text: This is a documented (if often undesirable) phenomenon. I would highly recommend reading [this](https://github.com/EventedMind/iron-router/issues/265), particularly from Nov 19 downwards. Note that the easiest fix is just to have a loading template.
type: Comment

http://stackoverflow.com/comment/38943504
score: 0
type: QuestionComment
has text: Annop, people don't respond fondly to no-effort questions. Just pasting code here and saying "explain this" will get you downvotes and close votes.
type: Comment
comment on: http://stackoverflow.com/q/25038769

http://stackoverflow.com/a/25035042
has comment: http://stackoverflow.com/comment/38936069
type: Answer
has body: Pluck will work for you data = [{ "category": "burglary", "location_type": "Force", "month": "2014-03" }, { "category": "violence", "location_type": "Force", "month": "2014-03" }] console.log(_.pluck(data,'category')) output [ 'burglary', 'violence' ]
score: 2
has comment: http://stackoverflow.com/comment/38937156
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25034960
answers question: http://stackoverflow.com/q/25034960
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38976783
type: Comment
has text: But what if the browser does not support HTML5 storage?
type: AnswerComment
comment on: http://stackoverflow.com/a/25056586
score: 0

http://stackoverflow.com/comment/38950801
comment on: http://stackoverflow.com/a/25042600
has text: For the current example your answer is correct, but lets think more golabaly. I want to do the same think but with any word or part of word that is close to the text from the span tag. For example `pa` from `span`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38944602
has text: @dfsq If I append it directly to the dom using something like angular.element($document[0].body).append(elem), will it be available when $document is injected elsewhere (i.e. my actual directive code)?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25039243

http://stackoverflow.com/comment/38969165
comment on: http://stackoverflow.com/a/25052410
type: Comment
has text: It would be more helpful if you showed how to use this with the `data-XXX` attributes in his HTML.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38889937
type: Comment
has text: Is there really no other way? I'm using this select in a widget and this would be very inconvenient way of handling it
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25009772

http://stackoverflow.com/q/24939266
linked to: http://stackoverflow.com/q/1676362
duplicate of: http://stackoverflow.com/q/1676362
linked to: http://stackoverflow.com/q/6605640
has title: Return index position from array of anonymous functions
answer count: 1
has comment: http://stackoverflow.com/comment/38756562
has body: I'm trying to figure out why these anonymous functions are returning the last value of my loop iterator as opposed to the iterator's current value when it is set. I thought that values are exempt from pass by reference, but it looks like these return values are pointers to the original i? function myFunctions(n) { var list = []; for (var i = 0; i &lt; n; i++) { list.push(function(){ return i; }); } return list; } var res = []; myFunctions(4).map(function(el){ res.push(el()); }); var p = document.createElement('p'); p.innerHTML = res.join(','); document.body.appendChild(p); //expected result: 0,1,2,3 Reading material: Javascript by reference vs. by value Fiddle: http://jsfiddle.net/ZP2hM/
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/750486
has answer: http://stackoverflow.com/a/24939359
score: 0
duplicate of: http://stackoverflow.com/q/750486
type: Question
has comment: http://stackoverflow.com/comment/38756330
tagged with: javascript

http://stackoverflow.com/comment/38905675
score: 0
type: AnswerComment
has text: yw ;) btw: I included the wrong js snippet before, fixed that. Included fiddle also works like it should
type: Comment
comment on: http://stackoverflow.com/a/25013458

http://stackoverflow.com/comment/38967324
type: Comment
score: 0
has text: thank you for your time and the responses are giving me valuable understanding. This is a difficult problem for me to explain. It seems like no matter what route I go, I am left with a return value corresponding to a secondary function all. What I really have a primary function wrapping all of this up, and the primary function needs to report the result. So, if looking at your last code snippet, imagine a basic higher-up function within which nests all of your code How can I have that code return data.avatar_url? Does what I am asking make sense? I truly appeciate this feedback and...
type: AnswerComment
comment on: http://stackoverflow.com/a/25050811

http://stackoverflow.com/comment/38840856
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24984125
score: 1
has text: @RahilWazir I think the questioner wants it to work the opposite way also. After dragging to create a new rect on canvas then they want the form to reflect the width/height of the dragged rect ;-)

http://stackoverflow.com/q/24916782
tagged with: css
type: Question
has comment: http://stackoverflow.com/comment/38714062
has body: I have a slide out tab that currently shows by default on the left side of my page and hides when the button is clicked, then slides out to be visible again when you click it. How can I set the tab to be hidden by default? Here is my code: HTML: > f t g i CSS: #share-wrapper { float:left; width:40px; height:180px; margin-top:80px; } #share { border:thin solid #333; border-left:0px; border-radius:0px 6px 6px 0px; width:30px; padding:0px 5px; height:170px; } #sharebutton { color:#333; border:thin solid #333; height:30px; width:30px; border-radius:15px; text-align:center; line-height:30px; margin: 0px 0px 10px 5px; -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); -webkit-transition: -webkit-transform 0.6s; -moz-transition: -moz-transform 0.6s; -o-transition: -o-transform 0.6s; transition: transform 0.6s; } #sharebutton:hover { color:#eee; background-color:#333; cursor:pointer; } #sharebutton.open { -webkit-transform: rotate(180deg); -moz-transform: rotate(180deg); -ms-transform: rotate(180deg); -o-transform: rotate(180deg); transform: rotate(180deg); -webkit-transition: -webkit-transform 0.6s; -moz-transition: -moz-transform 0.6s; -o-transition: -o-transform 0.6s; transition: transform 0.6s; } .share-box, .share-box img { width:30px; height:30px; } .facebook-share, .twitter-share, .google-share, .insta-share { width: 100%; height: 100%; line-height: 30px; text-align: center; color:#333; border:thin solid #333; border-radius:15px; margin:10px 0px; background-color:#eee; cursor:pointer;} .facebook-share:hover, .twitter-share:hover, .google-share:hover, .insta-share:hover { background-color:#333; color:#eee; } jQuery: $(document).ready(function () { $("#sharebutton").click(function () { $("#share").toggle("slide"); if ($("#sharebutton").hasClass("open")) { $("#sharebutton").removeClass("open"); } else { $("#sharebutton").addClass("open"); } }); });
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has answer: http://stackoverflow.com/a/26236387
has title: jQuery Slide Out Tab
type: UnansweredQuestion

http://stackoverflow.com/a/24933743
has body: I'm not sure I understand your problem, but I'm gonna try guessing anyways. So you initialized a variable QCC with a timestamp (say 1406204887676). If you now do lastCheck = Date.now() - QCC you get as a result the number of milliseconds that passed since QCC (e.g. 5000 would mean 5 seconds have passed). I hope this helps a bit
downvote count: 0
type: Answer
score: 1
answers question: http://stackoverflow.com/q/24933485
upvote count: 1

http://stackoverflow.com/comment/38998465
comment on: http://stackoverflow.com/q/25067756
score: 0
type: Comment
type: QuestionComment
has text: What browser are you using ? Is it HTML5 compatible ?

http://stackoverflow.com/comment/39008561
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25027990
has text: thanks, but one question: if I dont want the other serverside codes for page_load to be executed , what should I do? I mean, if I check the session in JavaScript in $(document).ready, then it will be run after all codes in "page_load", and I dont want them to be run if the session return "False".its an Overhead for the system.

http://stackoverflow.com/comment/38883071
has text: Ah! But what if that function takes args?
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25006541
type: AnswerComment

http://stackoverflow.com/a/25063388
answers question: http://stackoverflow.com/q/25063324
has body: Loading.... I found this one here https://stackoverflow.com/a/7082403/2630817
type: Answer
score: 0

http://stackoverflow.com/comment/39526535
has text: @Ani Question: Do you want to pick the maximum height from the divs and implement that to the divs? If yes this the solution. If no then can you explain little bit more? If dynamic height isn't the issue then you can implement a fix height to each divs.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24941271

http://stackoverflow.com/a/25048957
accepted answer of: http://stackoverflow.com/q/25007571
has body: Add $('.popup-with-form').magnificPopup('open'); to your stateChanged function as below. Works for me on your example. Changed both results spans and opens the pop up. function StateChanged() { if (XmlHttp.readyState == 4 || XmlHttp.readyState == "complete") { $('.popup-with-form').magnificPopup('open'); document.getElementById("CalcSum").innerHTML = XmlHttp.responseText; document.getElementById("CalcSumPopup").innerHTML = XmlHttp.responseText; } } Update: more documentation here http://dimsemenov.com/plugins/magnific-popup/documentation.html if you need it.
answers question: http://stackoverflow.com/q/25007571
has comment: http://stackoverflow.com/comment/38964294
type: AcceptedAnswer
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38965248
score: 1
upvote count: 1

http://stackoverflow.com/comment/80708565
comment on: http://stackoverflow.com/a/34725928
score: 1
type: AnswerComment
type: Comment
has text: This needs to be updated as the new correct answer. Thank you.

http://stackoverflow.com/a/24973777
has body: I think you might need to have the code inside a document ready. Here using jQuery: &lt;script type="text/javascript"&gt; $(function() { var $info = $('.thumb'); enquire.register("(max-width: 480px)", { match: function() { $info.removeClass('col-xs-6'); $info.addClass('col-xs-12'); }, unmatch: function() { $info.removeClass('col-xs-12'); $info.addClass('col-xs-6'); } }); }); &lt;/script&gt;
upvote count: 3
has comment: http://stackoverflow.com/comment/38821189
answers question: http://stackoverflow.com/q/24971699
has comment: http://stackoverflow.com/comment/38821401
has comment: http://stackoverflow.com/comment/38821362
type: Answer
has comment: http://stackoverflow.com/comment/38821213
downvote count: 0
has comment: http://stackoverflow.com/comment/38821241
score: 3

http://stackoverflow.com/q/25043961
accepted answer: http://stackoverflow.com/a/25044051
has comment: http://stackoverflow.com/comment/38953286
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25044027
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38953376
score: 0
possible better answer: http://stackoverflow.com/a/25044027
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38953333
has comment: http://stackoverflow.com/comment/38953270
has answer: http://stackoverflow.com/a/25044051
tagged with: css
has body: I have a form that adds comment from the user: &lt;textarea name="comment" id="comment_box" placeholder="Share your thoughts" cols="175" rows="9"&gt;&lt;/textarea&gt; &lt;input type="button" name="add_comment" id="add_comment_button" value="Add comment" onclick="add_comment_js('comment_form','{$type}')"&gt; Once I click on the button "Add comment" the textarea disappears (I think using jquery), no css files included. A big functions.js file is linked also, I suspect this method inside the javascript file has to do with the disappearance: function add_comment_js(form_id,type) { var formObjectData = $('#'+form_id).serialize()+'&amp;mode=add_comment'; $.post(page,formObjectData, function(data) { if(!data) alert("No data"); else { if(data.cid) { get_the_comment(data.cid,"#latest_comment_container"); $("#"+form_id).slideUp(); } } },'json'); } Why is the textarea hiding after I post the comment? What's wrong?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38953243
has title: How can I stop the textarea from disappearing?

http://stackoverflow.com/comment/38828226
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24977113
has text: @Malcr001: track by was not the solution here because I din't have any duplicate entries in the JSON data. The mistake I was doing when I was calling the service was that I was wrapping the JSON response in a callback function which while looping through the `$scope.entries` was causing the issue and giving me `undefined` for `console.log(data.entries);`. Thank you:)

http://stackoverflow.com/a/24947685
has body: you can do it with a regex like :- var url = "http://example.com/Apps/Visitor/visitscanner"; var dirName = /\/\/.+?\/Apps\/(.+?)(?=\/)/g.exec(url)[1];
answers question: http://stackoverflow.com/q/24947471
score: 0
type: Answer

http://stackoverflow.com/comment/38780686
has text: It works but an array may also contains undefined (of course this may not be an issue for OP case).
type: AnswerComment
comment on: http://stackoverflow.com/a/24952260
score: 0
type: Comment

http://stackoverflow.com/comment/38730828
comment on: http://stackoverflow.com/a/24925717
type: AnswerComment
has text: Sorry, but i need to go with html() :( because it is used further for other functionality. Can there be any other way?
score: 0
type: Comment

http://stackoverflow.com/q/24913361
answer count: 2
tagged with: javascript
favorite count: 0
upvote count: 3
has title: how to do restart a AudioBufferSourceNode?
tagged with: http://stackoverflow.com/tag/html
tagged with: web-audio-api
accepted answer: http://stackoverflow.com/a/24913730
possible better answer: http://stackoverflow.com/a/37774801
tagged with: html5-audio
has body: I cannot find in the WebAudio API (http://webaudio.github.io/web-audio-api/) a way to restart an AudioBufferSourceNode. The “loop” mode is not appropriate as I need to restart the node before it ends. I have tried to implement it by doing: stop recreate the node from the buffer start But then there is a fraction of second with no sound making the transition not smooth. What is the best way to restart an AudioBufferSourceNode?
has answer: http://stackoverflow.com/a/37774801
has answer: http://stackoverflow.com/a/24913730
type: AnsweredQuestion
score: 3
downvote count: 0
type: Question

http://stackoverflow.com/comment/38827665
score: 1
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24977309
has text: This technique is a great step in the right direction. If you remove the static typing "()" at the end, you can actually instantiate new versions of this object... I'd say this is the most useful answer. var myCar = new car(); alert( myCar.color );

http://stackoverflow.com/q/24944404
has answer: http://stackoverflow.com/a/68893336
score: 22
has answer: http://stackoverflow.com/a/48981618
possible better answer: http://stackoverflow.com/a/48981618
upvote count: 22
answer count: 4
has answer: http://stackoverflow.com/a/25034254
downvote count: 0
has answer: http://stackoverflow.com/a/24968845
tagged with: javascript
linked to: http://stackoverflow.com/q/24986609
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/pdf
has title: Fill pdf form with javascript (client-side only)
favorite count: 0
accepted answer: http://stackoverflow.com/a/25034254
tagged with: angularjs
has body: I need to fill a pdf form automatically in my angularjs webapp. The pdf form is generated outside the app so I can configure it as I want. In my app, I just need to load the pdf, modify the form fields and flatten the file so it doesn't look like a form anymore. Do you know any way to do it? Edit: I've found iText but it's a java library which won't work for my project (the app runs on tablets so I'm looking for something 100% HTML5)

http://stackoverflow.com/comment/38898997
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24994580
has text: I posted a simplified, functional example to show what I *think* you're trying to achieve. Lemme know.
score: 0

http://stackoverflow.com/comment/38881230
type: QuestionComment
comment on: http://stackoverflow.com/q/25005634
score: 0
has text: Thanks for that all. Any suggestions on free img editors?
type: Comment

http://stackoverflow.com/comment/38779695
comment on: http://stackoverflow.com/q/24932643
score: 1
has text: I found a solution too, overridded the original directive of timepicker. But that's a temporary solution, until bootstrap ui gets updated.
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24954043
score: 0
answers question: http://stackoverflow.com/q/24913564
has body: Thanks for the answers so far, though they werent very helpful... BUT I have to admit, I forgot an obviously very important detail in my post. I am getting my list content (a lot of content) from a SOAP envelope, which contains a large JSON string I am parsing later. However the parsing of the XML SOAP envelope was the operation that froze everything to death! $(data).find('json_content').text(); That was the old operation. Now when doing a 'manual' XML traversal I can gain direct access to the JSON string: var jsonString = data[0].documentElement. childNodes[0].childNodes[0].childNodes[0].firstChild.nodeValue; Parsing the string, concatenating it, even pasting the content into DOM takes only seconds now. Its slower than in Chrome and Firefox, but now (finally!) I am talking about seconds. Not. Minutes. I also testet innerHTML and compared it to jQuery.append(). innerHTMLwas hardly faster. :P Greetz from B!
type: Answer

http://stackoverflow.com/q/24934982
has title: AmCharts serial chart trend-line click
tagged with: javascript
tagged with: trending
accepted answer: http://stackoverflow.com/a/24935153
answer count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
tagged with: amcharts
has body: I am using javascript amcharts v3 to generate trend like interface element. I use trendline class to create trend lines that mark certain events. I would like to handle trendline click event but there seems to be no way of doing it. Has anyone come across this type of problem or do you have any idea how to work around this? For trend line example I use this page. There is jsfiddle link in it. Thank you for the time you spend reading my question. Edit: JSfiddle example - > here
score: 1
has answer: http://stackoverflow.com/a/24935153
upvote count: 1
type: Question

http://stackoverflow.com/a/25023352
accepted answer of: http://stackoverflow.com/q/25023202
has body: This should do the trick. $(function(){ var hash = window.location.hash; if(hash != 'undefined'){ $('a[href='+hash+']').parents('div.speaker_container').trigger('click'); } });
upvote count: 1
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38916219
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25023202

http://stackoverflow.com/q/25016170
tagged with: authentication
type: Question
answer count: 2
tagged with: javascript
has answer: http://stackoverflow.com/a/25025723
has body: I'm using the Hot Towel angular library (https://github.com/johnpapa/hottowel-angular-bower) on a project I inherited from a senior developer. I'm also incorporating Auth0's authentication library for Angular. I need to restrict some routes to authenticated users. To do that, I set some route properties. isLogin: true for routes which is restricted to non-authenticated users. requiresLogin: true for routes needing authentication, and the opposite for those who don't. In order to check these properties on each runthrough, I use $rootScope.$on('$routeChangeStart' function()). app.run(function ($rootScope, $location, auth, common, config) { var getLogFn = common.logger.getLogFn, log = getLogFn('auth handle'), events = config.events; $rootScope.$on('$routeChangeSuccess', function (e, nextRoute, currentRoute) { if (nextRoute.$$route &amp;&amp; nextRoute.$$route.settings &amp;&amp; nextRoute.$$route.settings.requiresLogin) { if (!auth.isAuthenticated) { $location.path('/login'); log('User not authenticated'); } } if (nextRoute.$$route &amp;&amp; nextRoute.$$route.settings &amp;&amp; nextRoute.$$route.settings.isLogin) { if (auth.isAuthenticated) { $location.path('/'); log('User is authenticated'); } } }) }); Now, it seems this is interfering with the spinner functionality included with Hot-Towel. In Shell.js I find the following: $rootScope.$on('$routeChangeStart', function (event, next, current) { toggleSpinner(true); } ); $rootScope.$on(events.controllerActivateSuccess, function (data) { toggleSpinner(false); } ); $rootScope.$on(events.spinnerToggle, function (data) { toggleSpinner(data.show); } ); What happens is that the spinner never stops spinning (e.g. vm.isBusy = true because a controller is never activated and resetting this), how would I work around this?
tagged with: hottowel
score: 0
has title: Spinner loading on routechangestart with Authentication library
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/25025723
possible better answer: http://stackoverflow.com/a/25017234
has answer: http://stackoverflow.com/a/25017234
type: AnsweredQuestion

http://stackoverflow.com/q/24917000
score: 0
has answer: http://stackoverflow.com/a/24917329
has comment: http://stackoverflow.com/comment/38715454
has title: Hiding/showing fields conditionally w/ checkboxes
has body: I'm using a conditional fields form from Bootstrap Validator and don't know enough Javascript to make one last thing work. The form as it is now is live here My problem is both "...a brochure to be sent to me" and "...to arrange a field demonstration" need to open the same address fields, however, if you check "...a brochure sent to me," then check "...to arrange a field demonstration" the fields open and then close again. How do I create an if statement to verify if the field is already visible and leave it open if it IS, and open it is it's NOT?
tagged with: javascript
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24917329
has comment: http://stackoverflow.com/comment/38715871
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/38715295
answer count: 1

http://stackoverflow.com/a/24944778
has comment: http://stackoverflow.com/comment/38767828
answers question: http://stackoverflow.com/q/24944271
has comment: http://stackoverflow.com/comment/38767548
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
has body: I wrote this function that takes a JavaScript number and determines if it's in the ISO/IEC 8859-1 codespace. Using this which String.fromCharCode allows you to construct the string you're looking for. function inIsoIec8859_1(code) { if (typeof code !== "number" || code % 1 !== 0) { throw Error("code supplied is not a integer type.") } if (code &gt; 255 || code &lt; 32 || (code &gt; 126 &amp;&amp; code &lt; 160)) { return false; } return true; } var isoLatinCodespace = ""; var code = 0; for (; code &lt; 255; code += 1) { if (inIsoIec8859_1(code)) { var current = String.fromCharCode(code); isoLatinCodespace = isoLatinCodespace + current; } } http://dojo.telerik.com/IGoT/12 Because you accepted my original answer, it is above this line, unedited. I realized something after I posted that could be important. If you plan on getting this value in a loop, this will serve your needs much better. var MyApp = { isoLatinString : (function() { var isoLatinCodespace = ""; return function () { if (!isoLatinCodespace) { function inIsoIec8859_1(code) { if (typeof code !== "number" || code % 1 !== 0) { throw Error("code supplied is not a integer type.") } if (code &gt; 255 || code &lt; 32 || (code &gt; 126 &amp;&amp; code &lt; 160)) { return false; } return true; } var code = 0; for (; code &lt; 255; code += 1) { if (inIsoIec8859_1(code)) { var current = String.fromCharCode(code); isoLatinCodespace = isoLatinCodespace + current; } } } return isoLatinCodespace; } }()) } Then later using MyApp.isoLatinString(). This new code only generates the string once, even if called multiple times. MyApp can be any object you're using to contain your application.
score: 2
has comment: http://stackoverflow.com/comment/38767801
has comment: http://stackoverflow.com/comment/38767910
accepted answer of: http://stackoverflow.com/q/24944271

http://stackoverflow.com/a/25063673
has comment: http://stackoverflow.com/comment/38990728
has comment: http://stackoverflow.com/comment/38990356
has comment: http://stackoverflow.com/comment/38991146
has comment: http://stackoverflow.com/comment/38990918
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38990319
has comment: http://stackoverflow.com/comment/38990623
type: Answer
accepted answer of: http://stackoverflow.com/q/25063521
has body: That behavior is caused by return false stopping the default behavior of the click event who has been propagated by then click on the radio. The default behavior of the radio is, of course, the radio beign checked. Just remove the return false and it work : http://jsfiddle.net/4v9R9/2/
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25063521
upvote count: 2

acrobat
type: Tag
tag name: acrobat
tags question: http://stackoverflow.com/q/25015184

http://stackoverflow.com/a/24924155
upvote count: 9
answers question: http://stackoverflow.com/q/24924052
has comment: http://stackoverflow.com/comment/38727880
has comment: http://stackoverflow.com/comment/38728203
accepted answer of: http://stackoverflow.com/q/24924052
has comment: http://stackoverflow.com/comment/38727851
has comment: http://stackoverflow.com/comment/38728391
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38727831
score: 8
has body: Yes, that is one of the most common uses cases for sinon@2, but I believe that what you are looking for is neither a mock nor a spy, but instead a stub. See: https://sinonjs.org/releases/v2.4.1/stubs/ var stub = sinon.stub(object, "foo"); //do your assertions stub.restore(); //back to normal now. This will allow you to create a default function that replaces object.foo(). From your question, however, it sounds like a no-op stub function is not what you are after, and instead want to override it with a custom function of your own: var stub = sinon.stub(object, "foo", function customFoo() { /* ... */ }); //do your assertions stub.restore(); //back to normal now. HTH! EDIT: How to stub a single function: The following stubs object.sourceAttackTarget() var stub = sinon.stub(object, "sourceAttackTarget", function sourceAttackTargetCustom(gameState, source, target) { //do assertions on gameState, source, and target // ... return customReturn; }); //do any further assertions stub.restore(); //back to normal now. How to stub a function to test for particular parameters var stub = sinon.stub(object, "sourceAttackTarget"); stub.withArgs(1, "foo", "bar").returns("correctTarget"); stub.returns("wrongTarget"); var output = object.sourceAttackTarget(gameState, source, target); equal(output, "correctTarget", 'sourceAttackTarget invoked with the right arguments'); //do any further assertions stub.restore(); //back to normal now. (Update) There is also .calledWith() and .calledWithMatch(), which I just found out about. Could also prove quite useful for these sorts of tests. How to mock just one method for an object: "Mocks come with built-in expectations that may fail your test. Thus, they enforce implementation details. The rule of thumb is: if you wouldn’t add an assertion for some specific call, don’t mock it. Use a stub instead. In general you should never have more than one mock (possibly with several expectations) in a single test." - source ... so for the question asked above…
has comment: http://stackoverflow.com/comment/38728041
has comment: http://stackoverflow.com/comment/38728355
has comment: http://stackoverflow.com/comment/38728119
type: Answer
has comment: http://stackoverflow.com/comment/38845391
has comment: http://stackoverflow.com/comment/93273770
has comment: http://stackoverflow.com/comment/38728331
downvote count: 1
has comment: http://stackoverflow.com/comment/38727902

http://stackoverflow.com/a/24988282
has comment: http://stackoverflow.com/comment/38848686
answers question: http://stackoverflow.com/q/24988203
downvote count: 1
score: 3
has body: It looks like your expression isn't going to work. Your slashes aren't being escaped properly. Try this. function myReplace(){ var X = document.getElementById("demo").innerHTML; var Y = X.replace(/&lt;\/script&gt;/ig, "&lt;\\\/script&gt;"); document.getElementById("demo").innerText = Y; } I also found a good article about how to do this and why. They go to the extent of escaping your &lt; and > sign's, but I believe escaping your your forward slashes is the most important.
upvote count: 4
has comment: http://stackoverflow.com/comment/97915815
has comment: http://stackoverflow.com/comment/38850492
has comment: http://stackoverflow.com/comment/38868063
type: Answer

http://stackoverflow.com/a/25052715
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/39007860
has body: My suggestion would be to set the divs to display: inline-block; vertical-align: baseline;. That way, they'll align as you need no matter what size. http://codepen.io/pageaffairs/pen/ucyIt Edit: second option, mentioned in the note: http://codepen.io/pageaffairs/pen/jBcxk jh jh
has comment: http://stackoverflow.com/comment/39008056
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/39002394
has comment: http://stackoverflow.com/comment/38997167
answers question: http://stackoverflow.com/q/25050608
has comment: http://stackoverflow.com/comment/38975932
has comment: http://stackoverflow.com/comment/38970643

http://stackoverflow.com/comment/38957719
comment on: http://stackoverflow.com/a/25044627
score: 0
type: AnswerComment
type: Comment
has text: Yes, does it matter that I'm using VS2010?

http://stackoverflow.com/comment/38873566
has text: I understand what you mean, but, for some reason it still does not work. :( Could it be that my POST is wrong? I have included it in the main question. Thank you!
comment on: http://stackoverflow.com/a/25001703
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39152726
has text: That should noth happen with your first block of code. Did you perhaps try it with your second block (which already worked)? Either way, I suspect I may have found the answer to your question.
score: 0
comment on: http://stackoverflow.com/q/25042378
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24969465
has body: I have a file that have two sections (#container and #area) and I want to use load() to place them in two different elements on the document. I want to make sure if it's necessary to use two load() to place each of them into separate areas. Can I do it all in one load? jQuery: $('#results').on('click','.category_select',function (e) { var source = $(this).data('source'); $("#results").load(''+source+' #container',function(){ }); $("#featuredtable").load(''+source+' #area',function(){ }); }); File HTML bbbbbbb aaaaaaa Document HTML Click
score: 0
has answer: http://stackoverflow.com/a/24969493
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Is it necessary to use load() twice to append same file to two different elements
accepted answer: http://stackoverflow.com/a/24969493
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38812753
type: Question

http://stackoverflow.com/comment/38998719
has text: Got curious, I felt that the extra contains selector would be slower than selecting all. Created a test here that shows it to be slower indeed! http://jsperf.com/jquery-contains-query-speed
comment on: http://stackoverflow.com/a/25065646
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/65595361
type: Comment
has text: I guess replacing `; i < keys.length;` to `, il = keys.length; i < il;` will improve performance even more.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25053027

http://stackoverflow.com/comment/38806865
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24965232
has text: It may require tweaking, I did that from memory and don't have a dev computer to test on right now.

http://stackoverflow.com/q/25017885
type: Question
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
type: AnsweredQuestion
has title: How to perform search with angularJS inside column nested ng-repeat in order to fill all rows first
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25018262
accepted answer: http://stackoverflow.com/a/25018262
has body: I have this table of rows and columns, but I would like to know how to search the data with angularjs, so it moves into rows, instead of staying in same columns. For example if you search for number 3 it shapes into letter L. I want it to put the data in one row and if that row is 100% filled then move to another column and fill that row and so on... Example on fiddle - http://jsfiddle.net/6aqtj/67/ HTML: {{ day }} AngularJS: window.myApp = this.angular.module('myApp', []); var monthDays = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31]; myApp.controller('MyCtrl', function($scope) { var dates = []; for (var i = 0; i < monthDays.length; i++ ) { if (i % 7 == 0) dates.push([]); dates[dates.length-1].push(monthDays[i]); } return $scope.dates = dates; });

http://stackoverflow.com/comment/38988530
score: 0
type: Comment
type: QuestionComment
has text: How would I capture the array that it's held in?
comment on: http://stackoverflow.com/q/25062672

http://stackoverflow.com/comment/38725580
comment on: http://stackoverflow.com/a/24921700
type: Comment
has text: I implemented it and doesn't do anything. I inserted the jQuery API from google and nothing happens. Did I do something wrong?
score: 0
type: AnswerComment

http://stackoverflow.com/q/24977924
type: Question
tagged with: javascript
upvote count: 2
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38828748
accepted answer: http://stackoverflow.com/a/24977970
possible better answer: http://stackoverflow.com/a/24977940
favorite count: 0
has title: Return a Function within a Function
has comment: http://stackoverflow.com/comment/38828762
has answer: http://stackoverflow.com/a/24977970
type: AnsweredQuestion
score: 2
has body: Here is an example of code I am experimenting with: var hello = function hi(){ function bye(){ console.log(hi); return hi; } bye(); }; hello(); Here is a repl.it link I am trying to return the function hi from my function bye. As you can see, when I console.log(hi) the value appears to present, but my return statement doesn't return the hi function. Why isn't the return statement returning the reference to hi?
has answer: http://stackoverflow.com/a/24977940

http://stackoverflow.com/comment/38895408
type: Comment
comment on: http://stackoverflow.com/q/25013135
type: QuestionComment
has text: I added it on http://nestecha.fr/cropScript. Try it on Chrome, I expect the exact same result. Simply using the slider, the image should resize to get smaller and smaller in the left canvas (that works). Then, clicking on Crop should generate the new resized image on the right (that doesn't work and throws errors quoted above).
score: 0

http://stackoverflow.com/q/24978937
downvote count: 1
type: Question
accepted answer: http://stackoverflow.com/a/24979005
possible better answer: http://stackoverflow.com/a/31792175
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/31792175
tagged with: javascript
linked to: http://stackoverflow.com/q/2233339
has title: Modal error - Uncaught TypeError: undefined is not a function modal
answer count: 2
tagged with: jquery
tagged with: asp.net
favorite count: 0
has answer: http://stackoverflow.com/a/24979005
has body: Im using the following code and I got error in delete in the JS($("#deleteModal").modal("show");),any idea what can be wrong here ? Im using MVC5 project the error is Uncaught TypeError: undefined is not a function &lt;!-- Modal --&gt; &lt;div class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-labelledby="deleteModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="deleteModalLabel"&gt;Delete Item&lt;/h4&gt; &lt;/div&gt; &lt;div id="deleteModalBody" class="modal-body"&gt;&lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; $(function () { $("#deleteModal").modal("hide"); // initially hides the modal pop-up until needed $(".deleteLink").on("click", function () { $.get('@Url.Action("GetDeletePartial")', { id: $(this).prop("id") }, function (data) { $("#deleteModalBody").html(data); $("#deleteModal").modal("show"); // shows the modal pop-up now that we have our partial view }); }); }); &lt;/script&gt; when I try it like following it fail in the begging of the script with the same error @section scripts { &lt;script src="~/Scripts/jquery-2.1.1.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(function () { $("#deleteModal").modal("hide"); // initially hides the modal pop-up until needed $(".deleteLink").on("click", function () { $.get('@Url.Action("GetDeletePartial")', { id: $(this).prop("id") }, function (data) { $("#deleteModalBody").html(data); $("#deleteModal").modal("show"); // shows the modal pop-up now that we have our partial view }); }); }); &lt;/script&gt; }
type: AnsweredQuestion
tagged with: twitter-bootstrap
score: 0
upvote count: 1

http://stackoverflow.com/a/25040005
has comment: http://stackoverflow.com/comment/38946835
has body: I came across this very concern when working with the mobile version of my application (since a normal login auth wouldn't work.) The solution I came up with is to work with 2 keys. When the user logs in, they are initially given their token. The client already has the token saved as a variable in the app (you can make the token whatever string you want, I usually generate a base64 key of 32 length.) So this is the basic play by play of what happens when they call the server from a GET/PUT/etc.. Send request with USER TOKEN and SERVER TOKEN as parameters. SERVER TOKEN is checked against the server token (which is salted and hashed). (If SERVER TOKEN is good, proceed to step 3, else deny request here. USER TOKEN is checked against the user token assigned to said user (which is salted and hashed) and makes sure it exists. If good, proceed to step 4, else deny request here. Execute request (GET/PUT/DEL/POST etc.) Long story short, i keep a salted and hashed version of the user tokens (which are unique to the user) and the server tokens (which is the same for every user) on the server and the de-salting and de-hashing is done on the back end. I hope this kinda makes sense. It might not be the standard or completely right but it's what i understood token auth to be and this works for me. If others see something wrong with my reasoning please chime in and tell me so.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25039759
has comment: http://stackoverflow.com/comment/38947087
has comment: http://stackoverflow.com/comment/38949746

http://stackoverflow.com/comment/38773453
has text: Thanks a ton! This works perfectly! Wow I can't believe I didn't think about injecting $location in my interceptor.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24948167

http://stackoverflow.com/q/24919870
favorite count: 0
accepted answer: http://stackoverflow.com/a/24927753
type: AnsweredQuestion
score: 1
has body: I have a pretty basic donut chart using flot.js. var options = { series: { pie: { innerRadius: 0.85, show: true } }, grid: { hoverable: true }, colors: ["#83a243", "#0d596d"] }; $.plot($("#donut-div"), [4, 6], options); Is it possible to format individual slices? I want to set the innerRadius of one slice to be wider than another. My goal is to have a graph with two data points and to make one of the slices wider to emphasize that information.
upvote count: 1
type: Question
tagged with: graph
tagged with: donut-chart
has answer: http://stackoverflow.com/a/24927753
tagged with: javascript
has title: Flot donut chart- format individual pie slices
tagged with: pie-chart
answer count: 1
tagged with: flot
downvote count: 0

http://stackoverflow.com/q/24963512
score: -4
answer count: 2
downvote count: 4
has comment: http://stackoverflow.com/comment/38802018
tagged with: http://stackoverflow.com/tag/html
has title: How to change border color of an input text on keyup in jquery?
favorite count: 0
has comment: http://stackoverflow.com/comment/38802074
tagged with: css
has answer: http://stackoverflow.com/a/24963532
type: AnsweredQuestion
has body: I have a similar html code like this bellow: &lt;form&gt; &lt;input type='text' id='inputVal'&gt; &lt;/form&gt; and this jquery code: maxVal = 100; $('#inputVal').keyup(function(){ var $this = $(this); var insertedVal = $this.val(); if (insertedVal &gt; maxVal){ $this.css({"color":"red","boder":"1px solid red"}); } }) If I put in a number that is greater than 100 the font color changes to red, just like expected. But, the border color remains unchanged. Why? How to modify my code to make the border color change red too.
accepted answer: http://stackoverflow.com/a/24963532
has answer: http://stackoverflow.com/a/24963667
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/38801976
has comment: http://stackoverflow.com/comment/38801946
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24963667
tagged with: jquery

http://stackoverflow.com/comment/38843630
has text: Is the problem that the code is commented out?
comment on: http://stackoverflow.com/q/24985815
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25043515
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/25044016
tagged with: javascript
score: 0
has title: Testing Audio Input without actually using microphone
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
tagged with: audio
has body: I'm trying to develop a site that uses Annyang.js (https://www.talater.com/annyang/) but I also just got my wisdom teeth taken out. So the problem is, I don't feel like saying words every time I want to test my site. (ouch) Additionally, I anticipate trying to develop in public places or places like libraries. Is there anyway I can force an input in the microphone without speaking into the microphone? I found this chrome flag " --use-fake-device-for-media-stream " exists. But when I put it in the command line in chrome, it did not work. "Syntax error: unexpected error for ". How can I test audio input by just inputting spoken commands instead of actually saying them and/or properly use the chrome flag?

http://stackoverflow.com/q/25036583
tagged with: ajax
has answer: http://stackoverflow.com/a/25036617
has title: Making a AJAX request with jquery and parsing JSON
favorite count: 0
type: UnansweredQuestion
has body: EDIT- I have figured out that the request is working correctly but I don't know what to do with the data once it has been retrieved from the server. I don't know how to access the JSON, how do I do this? I am trying to do a jQuery AJAX request and parse the JSON which is hopefully received. Here is my code: search.onsubmit = function() { $.getJSON("http://www.geocodefarm.com/api/forward/json/d4abb1b19adb13e42eac5a7beac6f4dbeb4b4ba4/" + searchBox.value, function(data) { var rawJSON = $.parseJSON(data); alert(rawJSON.COORDINATES.latitude); }); alert("test"); } I known that the getJSON function is not working because the test alert appears. Why does it not work?
downvote count: 1
has comment: http://stackoverflow.com/comment/38938942
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38938871
score: -1
has comment: http://stackoverflow.com/comment/38938909
has comment: http://stackoverflow.com/comment/38939001
type: Question
upvote count: 0
has comment: http://stackoverflow.com/comment/38938833
answer count: 1
has comment: http://stackoverflow.com/comment/38938880
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38938867

http://stackoverflow.com/q/24914757
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24915613
type: Question
score: 0
answer count: 2
has title: How to undo a radio button selection using JavaScript or preferably jQuery
tagged with: javascript
tagged with: jquery
has body: I am working in a scenario with a group of radio button selections. The requirement is that only 2 can be selected Yes. So, if the third is also selected "Yes", I want to revert it to "No" Additionally I would also like to know if I can just check if a given index of Radio button within a group is checked instead of doing this: "($(this).is(':checked') && $(this).val() == 'Y')" jsFiddle Link: http://jsfiddle.net/pshah331/S8qep/ HTML: Folder A: Yes No Folder B: Yes No Folder C: Yes No JavaScript in "HEAD": function folderSelectedYesCount() { var yesCount = 0; var folderRadioGroups = $("input[name^='folder_']"); folderRadioGroups.each(function () { // TODO: Would like to check by index --> "index 0 is selected/checked" if ($(this).is(':checked') && $(this).val() == 'Y') { yesCount++; } }); return yesCount; } function folderSelectionChanged() { // TODO: If count of Yes is greater than 2, then change the last clicked to "No" /* if (folderSelectedYesCount() > 1){ $(this)[1].prop('checked', true); } */ $('#update').html('Selection count for "Yes" is ' + folderSelectedYesCount() + ' '); }
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24915613
has comment: http://stackoverflow.com/comment/38710573
has answer: http://stackoverflow.com/a/24915072
possible better answer: http://stackoverflow.com/a/24915072

http://stackoverflow.com/comment/38872904
has text: If that doesn't work, let me know I will look at another solution.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25001244

http://stackoverflow.com/q/25035011
upvote count: 2
has body: I am looking into systems for making JavaScript libraries. I have seen most of the libraries using methods such as "Immediately Invoked Function Expression". This method to me makes the code quite unreadable. I want to know what are the advantages of using this method? And what are limitations of using the basic .prototype system for creating a library? For instance, what is wrong with using this pattern to create a library?: function Library(){ this.property = 'val'; } Library.prototype.method = function(){ // a method } //and to use the library var lib = new Library();
linked to: http://stackoverflow.com/q/16063394
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25035589
has comment: http://stackoverflow.com/comment/38936667
has comment: http://stackoverflow.com/comment/38939733
type: Question
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/310870
has title: Using constructor.prototype method for creating a JavaScript library
accepted answer: http://stackoverflow.com/a/25035589
answer count: 1
favorite count: 0

http://stackoverflow.com/comment/38759129
has text: Thanks @Kevkong ! The media query example is the last example in the OP, unless you mean something else.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24939114

http://stackoverflow.com/comment/38780306
has text: The preventDefault method - is the jquery method. I do not use jquery in my project at all. I use AngularJS
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24951644

http://stackoverflow.com/q/25044520
has answer: http://stackoverflow.com/a/25045253
score: 0
has answer: http://stackoverflow.com/a/25044646
answer count: 3
has answer: http://stackoverflow.com/a/25044585
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
has body: Is there a way to run a script that check's if #username-input is empty then run this script: document.getElementById('login-button').addEventListener('click', function () { var name = document.getElementById('username-input').value; document.getElementById('username').innerHTML = 'Welcome ' + name; document.getElementById('username-input').remove(); document.getElementById('password-input').remove(); document.getElementById('login-button').remove(); }, false); EDIT And if #username-input and #password-input is empty an alert is popping up and say that instead of running the script alert('username or password can't be blank')
tagged with: http://stackoverflow.com/tag/html
type: Question
has title: Check empty input and then run script

http://stackoverflow.com/comment/38939124
has text: You can, however, check out `window.devicePixelRatio` as a multiplier to convert between device-independent pixels and screen pixels.
score: 0
comment on: http://stackoverflow.com/q/25034279
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24929296
has comment: http://stackoverflow.com/comment/38739272
has answer: http://stackoverflow.com/a/25037910
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/40527948
has title: Error: [ng:areq] Argument 'MyCtrl' is not a function, got undefined
has answer: http://stackoverflow.com/a/28853472
has answer: http://stackoverflow.com/a/36342185
upvote count: 10
has answer: http://stackoverflow.com/a/37133636
type: Question
has comment: http://stackoverflow.com/comment/38737074
has comment: http://stackoverflow.com/comment/38738943
has answer: http://stackoverflow.com/a/35703271
has comment: http://stackoverflow.com/comment/38737283
tagged with: asp.net-mvc
has answer: http://stackoverflow.com/a/26757701
has answer: http://stackoverflow.com/a/34559272
score: 10
tagged with: javascript
has comment: http://stackoverflow.com/comment/38737439
accepted answer: http://stackoverflow.com/a/25037910
possible better answer: http://stackoverflow.com/a/35703271
answer count: 11
has answer: http://stackoverflow.com/a/35043697
has answer: http://stackoverflow.com/a/30429331
downvote count: 0
has body: I am new to Angularjs and I was following a tutorial but I got the error in the title. HTML code: ID Name Surname House Address Locality Contact Contact 2 Contact 3 Reply Edit {{person.ID}} {{person.Name}} {{person.Surname}} {{person.House}} {{person.Address}} API COntroller: public class DataController : ApiController { //GET api/data public IEnumerable<CommonLayer.Telesales> GetPeople() { return new BusinessLayer.Telesales().getUserSession(User.Identity.Name).AsEnumerable(); } More error details: magicplayer:init: set version: 1.0.1 adme: onDOMStart: got code: user_key=f52009a2292c2b524ac9af2801caef4c443d7cdc7697dff171f77b3c81cd26fa gender=1 age=4 Error: [ng:areq] Argument 'MyCtrl' is not a function, got undefined http://errors.angularjs.org/1.2.18/ng/areq?p0=MyCtrl&p1=not%20a%20function%2C%20got%20undefined at http://localhost:12570/Scripts/angular.js:78:12 at assertArg (http://localhost:12570/Scripts/angular.js:1475:11) at assertArgFn (http://localhost:12570/Scripts/angular.js:1485:3) at http://localhost:12570/Scripts/angular.js:7198:9 at http://localhost:12570/Scripts/angular.js:6592:34 at forEach (http://localhost:12570/Scripts/angular.js:327:20) at nodeLinkFn (http://localhost:12570/Scripts/angular.js:6579:11) at compositeLinkFn (http://localhost:12570/Scripts/angular.js:6028:13) at compositeLinkFn (http://localhost:12570/Scripts/angular.js:6031:13) at compositeLinkFn (http://localhost:12570/Scripts/angular.js:6031:13) Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:12570/Images/accent.png onMessageFromBackground: method=statPixel what am I doing wrong? I search other solutions but it seems like my problem is a bit different.
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/38427639
linked to: http://stackoverflow.com/q/26797756
has comment: http://stackoverflow.com/comment/38739562
has comment: http://stackoverflow.com/comment/42393830

http://stackoverflow.com/a/24918730
has body: What you're looking for is a synchronous call. While that is possible with the XmlHttpRequest object, angular $http doesn't support that currently and it is considered poor programming practice to freeze the web page while waiting for a response from the server. If you want the console log to execute after the post, you can return the result of the call to .post() and use the .success() method to do something after it is complete (PLNKR): var app = angular.module("MyApp", []); var ctrl = app.controller("MyCtrl", function($scope, $http) { $scope.fun1 = function() { $scope.fun2().success(function(data) { console.log('after call to fun2'); }); }; $scope.fun2 = function() { var result = $http.get('data.json').success(function(data) { console.log('fun2 got', JSON.stringify(data)); }); return result; // still has .success() and .error() functions on it }; })
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24918393

http://stackoverflow.com/a/24909527
has comment: http://stackoverflow.com/comment/38699761
has comment: http://stackoverflow.com/comment/38700498
has comment: http://stackoverflow.com/comment/38700859
upvote count: 1
has body: As suggested here by rich.okelly you could try this: (function() { var runMyCode = function($) { // jquery-dependent code here $("#foo").data('bar', true); }; var timer = function() { if (window.jQuery &amp;&amp; window.jQuery.ui) { runMyCode(window.jQuery); } else { window.setTimeout(timer, 100); } }; timer(); })(); I also found a more complex solution, but I personally prefer the above solution over this solution. Update without timeout: &lt;script&gt; var runMyCode = function($) { // jquery-dependent code here $("#foo").data('bar', true); }; &lt;/script&gt; ... &lt;script src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; $(function(){ runMyCode(window.jQuery); }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38700517
downvote count: 1
answers question: http://stackoverflow.com/q/24909230
score: 0
has comment: http://stackoverflow.com/comment/38699776
has comment: http://stackoverflow.com/comment/38700287
type: Answer

http://stackoverflow.com/q/24925112
tagged with: angularjs
answer count: 5
type: AnsweredQuestion
has title: AngularJS issue with getting external JSON
has answer: http://stackoverflow.com/a/24925273
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/3076414
type: Question
tagged with: jsonp
has answer: http://stackoverflow.com/a/24925519
has body: Okay so I am new to AngularJS, and am trying to get data from an external API. The end result of this is basically going to help me understand angularjs, using external data, some more as well as getting some stats for Call Of Duty Ghosts for my account or others that I search for. I know that $http.jsonp is the way to go, but the API doesn't really support it as well as CORS... I have accounted for that. I have been able to use jquery to test to make sure I can do it, but am unable to figure it out with AngularJS. One issue I am having using whateverorigin and anyorigin from https://stackoverflow.com/a/7910570/1888585 and https://stackoverflow.com/a/6104416/1888585 is that I am getting http error 500 (Internal server error) Without them I am getting an error regarding the json I am getting (which is valid json, checked with json linter) -> 'Uncaught SyntaxError: Unexpected token : ' So here is what I have: Data from site: {{getGhostData()}} Data from site: {{info}} And for my jquery code that works just fine: $.getJSON('http://anyorigin.com/dev/get?url=api.codcp.com/user_stats%3Fucdid%3D3f0feb1229202d84b125bab79f7af503ce62057d499ecc0c%26network%3Dxbl&callback=?', function(data){ $.each(data.contents.user, function(val, idx) { $("#text span").append(val+" "); }) console.log(data.contents.user); }); The json that comes back is as follows: {"user":{"profile":{"ucdid":"3f0feb1229202d84b125bab79f7af503ce62057d499ecc0c","gamertag":"xNF6xVENGE","network":"xbl","image":"http://avatar.xboxlive.com/avatar/xNF6xVENGE/avatarpic-l.png","kdr":1.109316019930545,"winr":2.7632311977715878,"kill":14694,"deaths":13246,"wins":992,"losses":359,"hoursPlayed":147.32049180327868,"currentStreak":0,"preferredWeapon":"weapon.iw6_arx160"},"squadMember":{"gamertag":"Erskine","xp":1031872,"background":20,"patchbacking":0,"patch":"patch_590","level":57,"nextLevelXp":1070000,"nextLevel":58,"prevLevel":56,"prevLevelXp":1030000,"progress":0.0468,"prestige":6},"careerHistory":{"blackops2prestige":3,…
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/26147931
score: 0
possible better answer: http://stackoverflow.com/a/24925519
accepted answer: http://stackoverflow.com/a/24925273
has answer: http://stackoverflow.com/a/24925320
has answer: http://stackoverflow.com/a/24925250

http://stackoverflow.com/q/24999058
answer count: 3
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
score: 0
has answer: http://stackoverflow.com/a/24999116
has title: How to check if the HTML selection option contains any values in it
has comment: http://stackoverflow.com/comment/38868369
has body: In Order to stop multiple requests to server incase if the HTML Selection option is not empty Could anybody please let me know how to check if the HTML Select is not empty This is my HTML Select Screen var json = { "employees": [ { "firstName": "John", "lastName": "Doe" }, { "firstName": "Anna", "lastName": "Smith" }, { "firstName": "Peter", "lastName": "Jones" } ] }; var html = ''; for (var i = 0; i < json.employees.length; i++) { var firstName = json.employees[i].firstName; var lastName = json.employees[i].lastName; html += ' '+lastName+' '; } $('#SCname').append(html); $('#SCname').show(); Could anybody please tell me how to check if this is empty or not ?? This is my jsfiddle.
has answer: http://stackoverflow.com/a/24999331
type: Question
has answer: http://stackoverflow.com/a/24999119
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38951351
score: 0
has text: What is content of $('.port2') after function execution? did you get anything in html? Try to use inspect feature in browser.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25042890

http://stackoverflow.com/comment/38985946
type: Comment
comment on: http://stackoverflow.com/a/25060725
type: AnswerComment
has text: @user2814794 instead of your document ready function change your load function to the one I suggested above
score: 0

http://stackoverflow.com/comment/38702303
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24910770
has text: Just bounding the input fields with an ng-model to something that has data

http://stackoverflow.com/a/25462846
score: -1
has body: Are you sure that the files inside are correct? What does console.log(require('./errors/Error132')) show? What are the contents of the Error132 and Error133 files?
type: AcceptedAnswer
type: Answer
downvote count: 2
accepted answer of: http://stackoverflow.com/q/25063868
upvote count: 1
answers question: http://stackoverflow.com/q/25063868

http://stackoverflow.com/comment/38729728
type: Comment
comment on: http://stackoverflow.com/a/24923635
score: 0
type: AnswerComment
has text: Yes this is almost what I needed: http://plnkr.co/edit/aCQ3SV5uAimuU0F3ITSr?p=preview. But how to make `admin` to redirect to `admin.dashboard` though? Basically parent to a child of it. Right now I had to modify the `Admin`

http://stackoverflow.com/a/24947887
score: 10
accepted answer of: http://stackoverflow.com/q/24947837
answers question: http://stackoverflow.com/q/24947837
type: AcceptedAnswer
upvote count: 10
type: Answer
has body: You can check the document.readyState property. From MDN: Returns "loading" while the document is loading, "interactive" once it is finished parsing but still loading sub-resources, and "complete" once it has loaded.
downvote count: 0

http://stackoverflow.com/comment/38828461
comment on: http://stackoverflow.com/a/24977573
score: 0
type: AnswerComment
type: Comment
has text: I suppose an alternative could be: http://jsfiddle.net/gdLP5/1 No comment on any "performance hit".

http://stackoverflow.com/comment/38840715
has text: http://pastebin.com/RzcxMH1u Okay, I got rid of the error, but how would I get the number value from the accounts.txt? (Not the bank number, the account balance)
type: AnswerComment
comment on: http://stackoverflow.com/a/24978339
score: 0
type: Comment

http://stackoverflow.com/q/25020479
downvote count: 1
accepted answer: http://stackoverflow.com/a/25021668
type: AnsweredQuestion
has title: Input Latitude and Longitude to plot polygon from textarea
score: -1
type: Question
tagged with: google-maps
upvote count: 0
has comment: http://stackoverflow.com/comment/38909293
tagged with: javascript
has comment: http://stackoverflow.com/comment/38909527
favorite count: 0
tagged with: google-maps-api-3
answer count: 1
has comment: http://stackoverflow.com/comment/38909818
has comment: http://stackoverflow.com/comment/38910710
has answer: http://stackoverflow.com/a/25021668
has comment: http://stackoverflow.com/comment/38910596
has body: I'm trying to make a javascript function where you have to input coordinates of 3 point minimum and them you see it (plotted) on a google map. The script has some problems. It doesn't print space between coords and doesn't plot the area on the map. Here is HTML code which I think doesn't have any problem. Plot area And here is JS code where I think the problem is located. var map; var infoWindow; function initialize() { var mapOptions = { zoom: 5, center: new google.maps.LatLng(24.886436412, -70.2685546875), mapTypeId: google.maps.MapTypeId.TERRAIN }; var bermudaTriangle; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); // Define the LatLng coordinates for the polygon. var triangleCoords = latlng; // Construct the polygon. bermudaTriangle = new google.maps.Polygon({ paths: triangleCoords, strokeColor: '#FF0000', strokeOpacity: 0.8, strokeWeight: 3, fillColor: '#FF0000', fillOpacity: 0.35 }); bermudaTriangle.setMap(map); // Add a listener for the click event. google.maps.event.addListener(bermudaTriangle, 'click', showArrays); infoWindow = new google.maps.InfoWindow(); } //plot area function codeLatLng() { var input = document.getElementById('latlng').value; var latlngStr = input.split(',', 2); var lat = parseFloat(latlngStr[0]); var lng = parseFloat(latlngStr[1]); var latlng = new google.maps.LatLng(lat, lng); geocoder.geocode({'latLng': latlng}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { if (results[1]) { map.setZoom(11); marker = new google.maps.Marker({ position: latlng, map: map }); infowindow.setContent(results[1].formatted_address); infowindow.open(map, marker); } else { alert('No results found'); } } else { alert('Geocoder failed due to: ' + status); } }); } /** @this {google.maps.Polygon} */ function showArrays(event) { // Since this polygon has only one path, we can call getPath() // to return the MVCArray of LatLngs. var vertices = this.getPath(); var contentString = 'Bermuda Triangle polygon ' +…

http://stackoverflow.com/a/24977042
answers question: http://stackoverflow.com/q/24977008
has body: You misunderstoud, the testing is the variable and "what" is the value inside the variable, when you do testing = "this works"; you just assign the value "this works" to the variable testing, not to the value "what"
score: 0
type: Answer

http://stackoverflow.com/comment/38952438
score: 0
type: QuestionComment
type: Comment
has text: It depends what client-side technology you are using. You've only mentioned Javascript so far. Are you using plain Javascript, or something like AngularJS, JQuery, Knockout, ...?
comment on: http://stackoverflow.com/q/25041700

http://stackoverflow.com/comment/38786566
has text: @muffin: to be able to access your data we need 1.(to create the mapsEngineLayer) the Asset-ID of the layer or the Asset-ID of the map + the layer key of the layer 2.(to access the vector table...required to search for particula features): the Asset-ID of the vector table. All mentioned assets must be public available(publish version).
comment on: http://stackoverflow.com/q/24946635
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25053829
answer count: 2
has title: I want to read data from store for Extjs 4 but it shows [object object]
possible better answer: http://stackoverflow.com/a/25092288
has body: This is my model: data: i 0: i data: Object events: Object hasListeners: k id: "region-ext-record-344" index: 0 internalId: "ext-record-344" modified: Object phantom: false raw: Array[2] // i want to get those two elements one displayField, another valueField 0: "01" 1: "Region 1" length: 2 __proto__: Array[0] store: i stores: Array[1] __proto__: Object 1: i 2: i 3: i length: 4 __proto__: Array[0] I can post the code if you want to! I tried to read store like: store: regionStore, but it is showing me an empty box with 4 empty lines equal to item count in my store, then I tried to do like store: regionStore.data.items and now it shows me [object object] lines, I totally get it why, but can't find solution for that. I am new to all ExtJs stuff, I am using ExtJs 4 though. My model looks like that : Ext.regModel('region', { fields: [ {name: 'id', type: 'integer'}, {name: 'name', type: 'String'} }); and my store looks like that: var regionStore = new Ext.data.ArrayStore({ id: 'regionStore', model: 'region', data: MyDesktop.GridWindow.getRegionData() //that is data from ajax response }); My combobox: { xtype: 'combobox', value: "region", store: regionStore, width: 135, id: 'regionCombo' editable: false }
tagged with: store
tagged with: combobox
type: AnsweredQuestion
tagged with: extjs4.2
has comment: http://stackoverflow.com/comment/39009658
type: Question
has answer: http://stackoverflow.com/a/25073995
accepted answer: http://stackoverflow.com/a/25073995
has comment: http://stackoverflow.com/comment/38972155
has comment: http://stackoverflow.com/comment/38971906
tagged with: javascript
has comment: http://stackoverflow.com/comment/39015962
has answer: http://stackoverflow.com/a/25092288
score: 0

http://stackoverflow.com/comment/56388858
comment on: http://stackoverflow.com/q/24970405
type: Comment
type: QuestionComment
has text: If you are using TinyMCE, I have found a solution [http://stackoverflow.com/a/34310270/915591](http://stackoverflow.com/a/34310270/915591) Maybe you can adapt it for CKE also.
score: 0

http://stackoverflow.com/q/24917577
tagged with: javascript
has body: I know there are lots of questions about this problem, but mine is a bit different. I have nodejs installed on Windows , at c:\program files\nodejs I installed all desired modules in the folder above, using these commands : npm install grunt --save-dev npm install grunt-contrib-uglify --save-dev npm install grunt-contrib-cssmin npm install grunt-contrib-imagemin --save-dev If i go inside my app folder and try to execute grunt, i get this error : Fatal error: Unable to find local grunt Grunt will run only if i reinstall all modules INSIDE the folder of my app. My question is : i have to install the modules inside EVERY app folder ? The same modules already installed on nodejs folder arent'enough ? Thanks !
tagged with: gruntjs
has title: Error running Grunt on Windows : Fatal error: Unable to find local grunt
has answer: http://stackoverflow.com/a/24919735
score: 0
answer count: 1
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/43970443
accepted answer: http://stackoverflow.com/a/24919735
type: Question

http://stackoverflow.com/q/24955918
has body: I realize that JavaScript allows both dot notation and bracket notation to create and access object properties. Other than when the property name contains a space or other reserved character or when the property name is a variable in which brackets are required for both scenarios, when should one approach be used over the other? Difference between using bracket (`[]`) and dot (`.`) notation indicates that dot notation should always be used unless there is a specific reason not to. Is this true, and if so, why? var person={firstname:'John', 'last name':'Doe'}; console.log(person); person.firstname='Jane'; var nameType='middlename'; //No person.nameType='Sunshine'; person[nameType]='Sunshine'; person['last name']='DoeBo'; console.log(person); Results: Object { firstname="John", last name="Doe"} Object { firstname="Jane", last name="DoeBo", middlename="Sunshine"}
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38797519
type: Question
has comment: http://stackoverflow.com/comment/38797555
tagged with: object
linked to: http://stackoverflow.com/q/4968406
has comment: http://stackoverflow.com/comment/38787120
linked to: http://stackoverflow.com/q/17189642
has title: JavaScript object dot notation or bracket notation
has comment: http://stackoverflow.com/comment/38788573
tagged with: javascript
has comment: http://stackoverflow.com/comment/38787115
score: 0
duplicate of: http://stackoverflow.com/q/4968406
has comment: http://stackoverflow.com/comment/38787122
has comment: http://stackoverflow.com/comment/38787254
answer count: 0

http://stackoverflow.com/comment/38852825
has text: Thanks, I did wrap it but apparently this is what was breaking it }));, one bracket to many. Was not giving an error for this. Thanks guys, such a silly mistake.
comment on: http://stackoverflow.com/q/24990704
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/q/24915024
tagged with: css
has title: 2 CSS divs: Allow sortable items in (right) div to create new sortable row instead of (right) div clearing other (left) div
score: 2
has body: I have a container with 2 divs inside: One is a small fixed width left div that is floated to the left (like a side menu). The second is a fluid div that also floats left (to be able to stack alongside the fixed div). The second div has sortable icons that float left. When the window is shrunk, I would like the icons to shift to the left and form a new row. For example, if "X" is an icon inside of the window and I have 6 icons.. My sortable items look just like the example here (http://jqueryui.com/sortable/) except that they float and stack to the left instead of vertically, like in the example. Before window shift (all stacked in one row because they fit the browser): X X X X X X After window shift (when only 4 can fit the shrunken browser, the other two should make a new row): X X X X X X You can see the code here: jsfiddle.net/6ZWq6/18 My problem is that the right fluid column will clear the left fixed column and end up completely beneath it, then only after they are stacked on top of each other, will it start to form new sortable rows. I do not want the right column to clear the left one at all, I just would like for the sortable items to make a new row. I tried setting clear to none on the second fluid div and it did not change this behavior. I also tried floating the fixed column left and the fluid column right and it did not change it either. Is there some way to make the sortable JS function occur before the clearing one or to completely prevent it from clearing? Here is the code: CSS: .container { background: transparent; overflow: hidden; clear: none; } .left-fixed { background: #ccc; padding: 10px; width: 160px; float: left; min-height:500px; } .right-fluid { list-style: none; padding: 10px; width: auto; float: left; overflow: auto; } .sortable-item { cursor: move; display: block; font-weight: bold; color:#CC0033; margin: 5px; float: left; HTML: Item Name Here Item Name Here JS: $(document).ready(function () { $('.right-fluid, .left-fixed').sortable({ co…
downvote count: 0
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/24915656
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24940956
answer count: 3
has answer: http://stackoverflow.com/a/24917370
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/25016083
answer count: 2
tagged with: javascript
favorite count: 0
has body: I'm making a simple webpage that allows a user to pick a t-shirt and its colour. I want the code to—if possible—display the back image for every colour of tshirt with one statement, and in a second statement, be able to rotate it back to the front. For example, something along the lines of this: # = colour of tshirt if (n[n.selectedIndex].value == # + "Front.jpg"){ show_image(# + 'Back.jpg','back'); } if (n[n.selectedIndex].value == # + "Back.jpg"){ show_image(# + 'Front.jpg','front'); } Is this possible, or should I just make one if-statement for each colour (back and front)? I'm sure there must be a better, more compact way. Here's what I have so far: (Which only rotates one way) function reverseTee() { var n = document.getElementById('shirt'); var image; if (n[n.selectedIndex].value == "redFront.jpg"){ show_image('redBack.jpg','back'); } if (n[n.selectedIndex].value == "blackFront.jpg"){ show_image('blackBack.jpg','back'); } if (n[n.selectedIndex].value == "whiteFront.jpg"){ show_image('whiteBack.jpg','back'); } if (n[n.selectedIndex].value == "lemonFront.jpg"){ show_image('lemonBack.jpg','back'); } }
has comment: http://stackoverflow.com/comment/38900892
has answer: http://stackoverflow.com/a/25017356
has comment: http://stackoverflow.com/comment/38903465
has answer: http://stackoverflow.com/a/25017087
upvote count: 1
downvote count: 1
has title: JavaScript: Function to display backside image of multiple tshirt colours
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25017356
possible better answer: http://stackoverflow.com/a/25017087
score: 0

http://stackoverflow.com/a/25053530
score: 16
upvote count: 21
has comment: http://stackoverflow.com/comment/64259289
has comment: http://stackoverflow.com/comment/39160870
downvote count: 5
has body: $scope.triggerClick = function () { $timeout(function() { angular.element('#foo').trigger('click'); }, 100); }; The $timeout will run an $apply to the cycle if necessary.
has comment: http://stackoverflow.com/comment/52671255
answers question: http://stackoverflow.com/q/25053374
type: Answer

http://stackoverflow.com/a/35445766
answers question: http://stackoverflow.com/q/25012185
upvote count: 23
has body: You can get the amount of connection using a built in function of NodeJS. Check getConnections. Bellow an example how to use it: var server = http.createServer(app); server.getConnections(function(error, count) { console.log(count); }); I hope this is what you were looking for :)
score: 23
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38945316
comment on: http://stackoverflow.com/a/25039538
type: AnswerComment
score: 0
type: Comment
has text: Are the different parameters (Language_fr, Standard_fr, ...) supposed to be text or they are variables declared sooner in your script ?

http://stackoverflow.com/q/25029575
accepted answer: http://stackoverflow.com/a/25062890
type: Question
downvote count: 0
tagged with: javascript
has title: Render span tag inside Ace Editor
has body: I am using Ace to display some JavaScript code, and loading it as per the embedding guide: editor = ace.edit("jsField"); editor.getSession().setMode("ace/mode/javascript"); editor.getSession().setUseWrapMode(true); The div and its contents are as follows: var x = 0; var y = 10; Currently, the Ace editor will display both the HTML and the JavaScript together as plain text. Is there a simple way to render the HTML such that only the JavaScript text is displayed, and the span is styled according to CSS? For example: I should note that the span is usually added dynamically by calling editor.setValue(). I have been looking into creating custom modes/syntax highlighters for Ace, but it seems like overkill for such a simple task. I am curious if there is another way.
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25062890
tagged with: ace-editor
upvote count: 2
type: AnsweredQuestion
score: 2

http://stackoverflow.com/q/24949372
has comment: http://stackoverflow.com/comment/38775727
type: UnansweredQuestion
has body: Well i am trying to pass an observable array via ajax call to my controller but i get every value there except date . i get something like '01-01-01' etc . I found the issue but unable to fix that as i dont know how to replace / with - . My ObservableArray have around 10 list items each list item holds a many properties out of those startDate holds the date like ("23/10/2014") . i just need something like ("23-10-2014") . Tought of posting my function's and more i hope thats not required in this case i believe . Let me explain with bit of code and sample data : function myarray() { var self=this; self.startDate=ko.observable(""); self.name=ko.observable(""); self.place=ko.observable(""); } MyObservableArray : self.Main= ko.observableArray(); In between i do some stuff to load Data into self.Main and i am sending self.Main to controller having data like below : self.Main[0] holds : startDate() --&gt;gives you "23/10/2014" //individual observables inside onservable array name() --&gt; "jhon" place()--&gt; "croatia" Likely self.Main[9] holds : startDate() --&gt; "29/05/2012" name() --&gt; "pop" place()--&gt; "usa" I am trying like i want to alter the self.Main() and replace the startDate and use the same self.Main to send to my controller . Once after replacing in self.Main when i check date the / should be replaced with - . Possible solution : i can use a different observable array and push all the VM's of Main into it but i am trying to do on self.Main without using other . If someone can show some light it is much appreciated .
has answer: http://stackoverflow.com/a/24949534
has answer: http://stackoverflow.com/a/24949459
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/24949422
tagged with: javascript
has comment: http://stackoverflow.com/comment/38775666
has title: How to replace ' / ' with '-' inside ObservableArray ? Knockout js
has comment: http://stackoverflow.com/comment/38775647
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38775670
has comment: http://stackoverflow.com/comment/38775604

http://stackoverflow.com/q/24994782
answer count: 1
tagged with: jsp
has answer: http://stackoverflow.com/a/25041137
favorite count: 0
has title: window.location.href minimising popup
type: UnansweredQuestion
tagged with: popup
downvote count: 0
score: 1
type: Question
has body: I'm new to jsps/javascript so please bear if Question is silly.I have goggled but could not found the answer. I have to open popup on one button click which displays the report and parent page gets refreshed. But now pop gets minimized and parent page comes to front. below is the code. function bustOut() { window.location.href="&lt;%=request.getContextPath()%&gt;/viewer/faces/faults/logViewer.jsf"; var sessionId = "LR&lt;%=session.getId()%&gt;"; var url="&lt;%=request.getContextPath()%&gt;/viewer/faces/faults/logReport_popup.jsf"; popupwindow=window.open(url,sessionId,"height=730,width=745,scrollbars=1,resizable=1,top=500"); popupwindow.focus(); } when I removes window.location.href, my popup comes to front but parent page becomes blank. I want popup window should not get minimized.Thanks
tagged with: javascript
upvote count: 1

http://stackoverflow.com/q/25044316
downvote count: 0
tagged with: ember-app-kit
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25051154
upvote count: 1
has comment: http://stackoverflow.com/comment/38960129
has body: I'm trying to create a model having embedded data using Ember AppKit and the ES6 syntax but I'm a bit confused. I found this article explaining the way to embedded data into a model: https://github.com/emberjs/data/blob/master/TRANSITION.md#rest-adapter-and-serializer-configuration But I don't know how to apply this to my scope. I should add the "map" into the adapter to specify that my attribute will be embedded, but I don't know how. This is what I have: adapters/item.js export default DS.RESTAdapter.extend({ namespace: 'path/to/api/json' }); How to add the map here?? models/item.js var attr = DS.attr, belongsTo = DS.belongsTo; export default DS.Model.extend({ name: attr('string') width: belongsTo('valueUnit'), height: belongsTo('valueUnit'), weight: belongsTo('valueUnit') }); I think here it should look something like this: export default DS.Model.extend({ name: attr('string') width: belongsTo('valueUnit', {embedded: 'always'}), height: belongsTo('valueUnit', {embedded: 'always'}), weight: belongsTo('valueUnit', {embedded: 'always'}) }); models/value-unit.js var attr = DS.attr; export default DS.Model.extend({ value: attr('number') unit: attr('string') }); And this is what I get from the server: { "items": [ { "id": "123456789", "width": { "value": 150, "unit": "m" }, "height": { "value": 5.3, "unit": "ft" }, "weight": { "value": 12, "unit": "lb" } } ] } Thanks
score: 1
type: Question
has title: Ember AppKit and embedded object using ember data
tagged with: ember-data
tagged with: javascript
tagged with: ember.js

http://stackoverflow.com/q/24910850
has answer: http://stackoverflow.com/a/24911015
has body: I want to create a website with 3 different jquery sliders. All the three sliders contain different pictures. I tried to use if and else but it didn't work. This is my code. js Html
type: Question
downvote count: 4
answer count: 2
upvote count: 0
has title: jQuery media queries for responsive site
tagged with: javascript
tagged with: jquery
tagged with: slider
tagged with: media
favorite count: 0
type: UnansweredQuestion
score: -4
has answer: http://stackoverflow.com/a/24910945
has comment: http://stackoverflow.com/comment/38702260

http://stackoverflow.com/q/24993012
tagged with: http://stackoverflow.com/tag/html
possible better answer: http://stackoverflow.com/a/24993239
accepted answer: http://stackoverflow.com/a/24994154
has body: I have this function that modify my existing object by ID : var updateUser = function () { var id = $("#userId").val(); var user = findObjectById(id); user.username = $('#username').val(); user.level = $('#level').val(); user.regstatus = $('#regstatus').val(); user.regdate = $('#regdate').val(); $(".table").show(); $("#newUser").show(); $("#userForm").hide(); $("#updateUser").hide(); }; How can i replace my curent data from HTML with modified data ? This is my function for creating rows : var buildRow = function (data) { var html = ' ' + ' ' + data.username + ' ' + ' ' + data.level + ' ' + ' ' + data.regstatus + ' ' + ' ' + data.regdate + ' ' + ' ' + ' Edit ' + ' ' + ' Delete ' + ' ' + ' '; $("#users").append(html); }; P.S i want to update in the same place and my id should be the same.
has comment: http://stackoverflow.com/comment/38857144
has answer: http://stackoverflow.com/a/24994154
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38856978
has comment: http://stackoverflow.com/comment/38857032
linked to: http://stackoverflow.com/q/3160277
has answer: http://stackoverflow.com/a/24993239
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38858149
has comment: http://stackoverflow.com/comment/38856916
score: 0
answer count: 2
linked to: http://stackoverflow.com/q/2160890
has title: How can i update data in html after modify the object?

http://stackoverflow.com/a/24924445
answers question: http://stackoverflow.com/q/24924249
has body: If your controls are in a form, you can do something really simple like: &lt;form&gt; &lt;textarea name="ta"&gt;&lt;/textarea&gt; &lt;input type="checkbox" onclick=" this.form.ta.value = this.checked? 'Hello':'Goodbye'; "&gt; &lt;/form&gt; Note that using the change event with a checkbox means that in some browsers, the event won't be dispatched until the checkbox loses focus, so better to use the click event.
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/25019558
possible better answer: http://stackoverflow.com/a/25261502
has body: I am doing this: Yii::app()-&gt;user-&gt;setState('name','john_peter'); I am getting the output: Yii::app()-&gt;user-&gt;getState('name'); #john_peter Actually I am calling action from my ajax and in that action setting some value like this: Yii::app()-&gt;user-&gt;setState('name','john_peter'); to set data in yii session. After that I am using window.location in java-script(After setting value in session) to redirect url on another action. But there I am getting empty attribute value from this Yii::app()-&gt;user-&gt;getState('name'); It is working fine on apache server but when I set yii code on nginx. it is not working.? What am I doing wrong with Nginx server?
has title: Yii::app()->user->getState not working on after redirect url from javascript
tagged with: php
score: 2
type: AnsweredQuestion
downvote count: 0
has answer: http://stackoverflow.com/a/25036146
accepted answer: http://stackoverflow.com/a/25036146
type: Question
tagged with: nginx
has comment: http://stackoverflow.com/comment/38944624
tagged with: session
tagged with: yii
tagged with: javascript
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/25261502
favorite count: 0

http://stackoverflow.com/q/24972848
tagged with: web-services
type: Question
has body: i have wind data in csv format like lat and long, wind speed, direction, temperature, i want to show this data in back ground of Google map and it should be like if i click at a given point on the map, it should popup the data of wind speed, direction etc, i can give an example link of the image how really it looks, please help me, i have all the wind data, to produce this data from nasa it took one year, but i am not able to complete this task.. http://wpcore.wpe.s3.amazonaws.com/wp-content/uploads/2012/03/wind-navigator.png
score: -2
has answer: http://stackoverflow.com/a/24973251
tagged with: javascript
tagged with: google-maps-api-3
has title: Displaying wind data from csv in back ground at point in Google map
upvote count: 0
answer count: 1
favorite count: 0
tagged with: google-api
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/xml
downvote count: 2

http://stackoverflow.com/q/25056556
type: UnansweredQuestion
tagged with: cross-browser
has answer: http://stackoverflow.com/a/25056866
tagged with: cookies
has comment: http://stackoverflow.com/comment/38976824
has title: Alternative option for cookie
type: Question
has body: I have been working on front end framework call "BackboneJs", I have used the cookie to store data in browser. But in some case i need to store more data which does not supported by cookie. Is anyone know the best option for storing considerable large data which cookie does not support. Please suggest your ideas. And yes it must be cross browser supported
has answer: http://stackoverflow.com/a/25056637
tagged with: javascript
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38976967
has answer: http://stackoverflow.com/a/25056586

http://stackoverflow.com/q/25031782
has title: How can I add a user keyword to the VS2013 TypeScript language text editor?
answer count: 4
tagged with: visual-studio
tagged with: visual-studio-2013
has answer: http://stackoverflow.com/a/25032081
type: Question
tagged with: typescript
has comment: http://stackoverflow.com/comment/38930505
has answer: http://stackoverflow.com/a/25037050
has answer: http://stackoverflow.com/a/25139228
tagged with: javascript
has comment: http://stackoverflow.com/comment/39088526
score: 4
linked to: http://stackoverflow.com/q/14471975
has comment: http://stackoverflow.com/comment/39045422
upvote count: 4
has comment: http://stackoverflow.com/comment/38930323
has body: I need to add "self" as a "user keyword" but I cannot see to do this in VS2013. I would like it to be a user keyword for the TypeScript editor window. I am making frequent use of "self" in my code. Is there a way that I can add the word "self." as a keyword and have it appear in a different color in my TypeScript text editing window? Here's an example of where I would use self and would like to have it highlighted: class X { abc=1; static $inject = ['$http']; constructor(private $http: ng.IHttpService) {} doTask = () =&gt; { var self = this; this.$http({ xx }) .success((data) =&gt; { self.abc = data }) } } Update: I have added a few lines to the question to more closely match the way I am using self.
has comment: http://stackoverflow.com/comment/38930366
has comment: http://stackoverflow.com/comment/71093471
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/39281403
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25167077

http://stackoverflow.com/comment/38892340
type: Comment
score: 1
type: AnswerComment
has text: thanks! actually I did manage to solve this issue using jquery I've updated the question with the solution
comment on: http://stackoverflow.com/a/24996973

object
tags question: http://stackoverflow.com/q/25045531
tags question: http://stackoverflow.com/q/25066815
tag name: object
tags question: http://stackoverflow.com/q/24919307
tags question: http://stackoverflow.com/q/25050137
tags question: http://stackoverflow.com/q/25068936
tags question: http://stackoverflow.com/q/24974161
tags question: http://stackoverflow.com/q/24913179
tags question: http://stackoverflow.com/q/25051629
tags question: http://stackoverflow.com/q/24993799
tags question: http://stackoverflow.com/q/25041864
tags question: http://stackoverflow.com/q/24911341
tags question: http://stackoverflow.com/q/25039353
tags question: http://stackoverflow.com/q/25062579
tags question: http://stackoverflow.com/q/25053584
tags question: http://stackoverflow.com/q/24913733
tags question: http://stackoverflow.com/q/25047463
tags question: http://stackoverflow.com/q/25064317
tags question: http://stackoverflow.com/q/24995674
tags question: http://stackoverflow.com/q/24916902
tags question: http://stackoverflow.com/q/25055086
tags question: http://stackoverflow.com/q/25006454
tags question: http://stackoverflow.com/q/25040604
tags question: http://stackoverflow.com/q/25068366
tags question: http://stackoverflow.com/q/24952759
tags question: http://stackoverflow.com/q/25020059
tags question: http://stackoverflow.com/q/25020672
tags question: http://stackoverflow.com/q/25013602
tags question: http://stackoverflow.com/q/24977827
tags question: http://stackoverflow.com/q/24947586
tags question: http://stackoverflow.com/q/25041361
tags question: http://stackoverflow.com/q/24981694
tags question: http://stackoverflow.com/q/25008024
tags question: http://stackoverflow.com/q/25068238
tags question: http://stackoverflow.com/q/24927783
tags question: http://stackoverflow.com/q/24949689
tags question: http://stackoverflow.com/q/24958011
tags question: http://stackoverflow.com/q/25067035
tags question: http://stackoverflow.com/q/25015153
tags question: http://stackoverflow.com/q/24938160
tags question: http://stackoverflow.com/q/24985649
tags question: http://stackoverflow.com/q/24967190
tags question: http://stackoverflow.com/q/25009258
tags question: http://stackoverflow.com/q/25025629
tags question: http://stackoverflow.com/q/24955918
tags question: http://stackoverflow.com/q/25033680
tags question: http://stackoverflow.com/q/24958816
tags question: http://stackoverflow.com/q/24947425
type: Tag
tags question: http://stackoverflow.com/q/24968764
tags question: http://stackoverflow.com/q/25005275
tags question: http://stackoverflow.com/q/24933963

http://stackoverflow.com/comment/88168320
type: AnswerComment
has text: I think the answer is wrong. I have a DeadObject and it returns true
type: Comment
comment on: http://stackoverflow.com/a/25041987
score: 0

http://stackoverflow.com/comment/112878120
type: AnswerComment
comment on: http://stackoverflow.com/a/44249053
type: Comment
has text: `console.log(pickPeaks([1, 2, NaN, 3, 1])) //{pos:[],peaks:[]}` -> dont you think this output is wrong
score: 0

http://stackoverflow.com/comment/38811092
type: Comment
type: QuestionComment
has text: Yes, I am made ​​changes in two files. like this assets / stylesheets / new_design / new_template_styles.css.scss it connects through assets / stylesheets / new_design / new_base.css.scss in new_desig
score: 1
comment on: http://stackoverflow.com/q/24968352

http://stackoverflow.com/a/41345397
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24927969
answers question: http://stackoverflow.com/q/24927969
has body: Angular JS can't use Client Side certificates. Here is why. Client side certificates are used to ensure that the client is one of those limited set of client that have access to the server, hence the access to the client side certificate is limited to certain clients only. Providing it the Angular JS script to any one requesting it defies the purpose. If you use a self signed certificate (even though there is no mechanism in Angular JS to specify it), it won't help in using it for authentication as the server can't trust a self signed certificate. I may be clear it up a bit more if you provide the purpose of the action you are trying to perform.
score: 0

http://stackoverflow.com/q/25060935
has answer: http://stackoverflow.com/a/76427197
linked to: http://stackoverflow.com/q/14321414
type: Question
type: AnsweredQuestion
score: 10
has body: In our application we want the filter on a date column to prompt the user for a start date and an end date, with the filter returning rows where the field in question falls between (or on) those two dates. Initial Approach Our initial approach was to restrict date types to use gte and lte operators, and add the "extra : true" filterable option on the column. This came close, but presented the following problems: A) Each date input could use either the gte (Start) or lte (End) operator, providing undesired flexibility and the option for the user to create a filter that would never return results, and B) Presented a logical comparison (And / Or) that we don't want. Better Approach This question has an answer by Matthew Erwin that gets us very close: it allows us to completely re-style the filter entirely, so we can present simply a Start Date input and an End date input. However, what I can't get working is associating the right filter operation with the right input (gte for the Start date, lte for the End date). My custom filter is as follows: $scope.dateFilter = { extra: true, operators: {}, ui: function (element) { var parent = element.parent(); while (parent.children().length > 1) $(parent.children()[0]).remove(); parent.prepend( "Start Date: " + "" + " " + "" + "select" + " End Date: " + "" + " " + "" + "select" ); } }; With this approach, the Odata filter option is generated for each of the dates, however it uses the eq Equal To operator, so no values are ever returned. We aren't building filters specifically on the data source. Is there a simple way I can associate each of those date inputs with a specific filter operator? Is there a better way to approach this subject? It seems like filtering dates based on a Start - End range would be commonly desired. Other Details We are using AngularJS, and WebAPI with Odata.
tagged with: kendo-grid
answer count: 3
tagged with: javascript
possible better answer: http://stackoverflow.com/a/33998276
favorite count: 0
tagged with: filter
has answer: http://stackoverflow.com/a/25183160
accepted answer: http://stackoverflow.com/a/25183160
upvote count: 10
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/33998276
has title: How to define a Kendo grid Column filter between two dates?
tagged with: angularjs
downvote count: 0
linked to: http://stackoverflow.com/q/33627336

http://stackoverflow.com/comment/38824755
comment on: http://stackoverflow.com/q/24931003
score: 0
type: Comment
type: QuestionComment
has text: in that case, the Network tab is probably going to give you the most accurate information (just make sure you have it open before you open your target page). I dont think its possible to always find the page size before you download it - when you deal with dynamic pages there might be situations where the server itself doesnt know the size before it sends the page back...

http://stackoverflow.com/a/24964668
type: Answer
answers question: http://stackoverflow.com/q/24954238
has body: Yep, I think you'll find that GSAP (GreenSock Animation Platform) works much better. It's literally up to 20x faster than jQuery. Plus I'd recommend animating x/y instead of top/left/right since transforms don't affect document flow and can therefore be rendered much faster. Also, try adding force3D:true to your GSAP animations which will put the elements onto their own compositor layer(s). With GSAP, you can loop/yoyo animations, nest them, seek() to a certain spot, reverse(), alter the timeScale, and lots more. jQuery just wasn't built for serious animation. Oh, and I'd avoid doing lots of setTimeout() calls if you can. Those can get costly when they're stacked up. GSAP has a delayedCall() method that ties into its single central ticker and is more efficient under pressure. You may also want to read this article: http://css-tricks.com/myth-busting-css-animations-vs-javascript/ If you need help with GSAP, there are dedicated forums at http://forums.greensock.com Happy tweening!
upvote count: 1
score: 1
downvote count: 0

http://stackoverflow.com/comment/38882036
score: 0
has text: Do you need to support older IE? This can be done very easily and reliably using flexbox. Any other method is going to be hacky and it gives me a headache just thinking about it.
comment on: http://stackoverflow.com/q/25005569
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25090691
score: 3
upvote count: 3
type: Answer
downvote count: 0
has body: isMounted() is actually an easy way to solve most problems, however, I don't think this is an ideal solution for concurrency issues. Now imagine that the user clicks very fastly on many buttons, or maybe he has a very poor mobile connection. It may happen that finally 2 concurrent requests are pending, and on completion will update the state. If you fire request 1 and then request 2, then you would expect the result of request 2 to be added to your state. Now imagine for some reason request 2 ends up before request 1, this will probably make your app unconsistent because it will show request2 results and then request 1, while your last "interest" was actually in request 1 answer. To solve this kind of issue, you should rather use some kind of Compare And Swap algorithm. Basically, this means before issuing the request, you put some object node in state, and on request completion, you compare with reference equality if the node to swap is still be node you are interested in when the request completes. Something like this: var self = this; var resultNode = {}; this.setState({result: resultNode}); this.getResult().then(function(someResult) { if ( self.state.result === resultNode ) { self.setState({result: someResult}) } }): With something like that, you will not have concurrency issue in case the user clicks to fast on the buttons leading to current requests inside the same component.
answers question: http://stackoverflow.com/q/25067364

http://stackoverflow.com/a/24974400
downvote count: 0
has body: In phpwithCasperJS.php where you execute the CasperJS script, you need to look at the output returned from the command and based on that send the e-mail: &lt;?php $output = exec("/usr/local/bin/casperjs /path/to/script/casperJSscript.js"); if (strpos($output, 'Fail: 0') === FALSE) { mail($to, $subject, $message); } echo $output; ?&gt; You might want to send the e-mail via Mail_smtp, if your server is blocked by spamhaus.
has comment: http://stackoverflow.com/comment/38825388
type: Answer
has comment: http://stackoverflow.com/comment/38823183
has comment: http://stackoverflow.com/comment/38837052
upvote count: 2
has comment: http://stackoverflow.com/comment/38833085
has comment: http://stackoverflow.com/comment/38823530
has comment: http://stackoverflow.com/comment/38823107
accepted answer of: http://stackoverflow.com/q/24973485
has comment: http://stackoverflow.com/comment/38823483
score: 2
answers question: http://stackoverflow.com/q/24973485
type: AcceptedAnswer

http://stackoverflow.com/comment/38927891
type: Comment
has text: now sorts strings as case-insensitive while preserving numbers and other types
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25030191

http://stackoverflow.com/a/24940506
accepted answer of: http://stackoverflow.com/q/24940414
answers question: http://stackoverflow.com/q/24940414
downvote count: 0
has comment: http://stackoverflow.com/comment/38759066
score: 2
type: AcceptedAnswer
has body: I hope this should help you &lt;style&gt; p {z-index: 99} &lt;/style&gt; $(document).ready(function() { var $p = $("&lt;p&gt;&lt;/p&gt;").hide().appendTo("body"); alert($p.css("z-index")); $p.remove(); }); You can even get CSS property without adding element to the DOM $('&lt;p/&gt;').css('z-index')
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/38759183

http://stackoverflow.com/comment/40731359
has text: Without the HTML, it is difficult to determine what the error may be.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25067974

http://stackoverflow.com/a/24924521
has body: Let me elaborate a bit more on the Lars' answer... erm.. I mean comment. Your range will be divided into n bands each of width (size of range / number of bands = n) where n is the number of datum within the given data set. So if you have 100px and 10 datum you'll have that 100px/10 datum = 10px wide bars. That's why "You can't have bands with uneven width" - Lars &lt;3 You can read more about rangeBands and rangeRoundBands here: https://github.com/mbostock/d3/wiki/Ordinal-Scales#ordinal_rangeBands
downvote count: 0
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24918221
score: 1

http://stackoverflow.com/q/24958041
upvote count: 1
downvote count: 1
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/25203926
has comment: http://stackoverflow.com/comment/38793833
answer count: 1
tagged with: javascript
tagged with: module-pattern
has body: I'm searching for the best way to implement a module function, regarding memory consumption as well as execution time/steps. To present my approaches I created three examples. My suggestions are as follows: 1. Simple way function module(newId) { //private vars var settings = { id: newId, name: '' }; //module object including large amount of code return { getId: function() { return settings.id; }, getName: function() { return settings.name; }, setName: function(newName) { //[...] large amount of code [...] settings.name = newName; } }; } 2. Sub functions in module function module(newId) { //private vars var settings = { id: newId, name: '' }; //put large amount of code here too keep it outside returned object function getIdFunc() { return settings.id; } function getNameFunc() { return settings.name; } function setNameFunc(newName) { //[...] large amount of code [...] settings.name = newName; } //returned module object: looks smaller - does it consume less memory? return { getId: getIdFunc, getName: getNameFunc, setName: setNameFunc }; } 3. Sub functions outside module //put large amount of code here too keep it outside module function var moduleFunc = { getId: function(settings) { return settings.id; }, getName: function(settings) { return settings.name; }, setName: function(settings) { //[...] large amount of code [...] settings.name = newName; } }; function module(newId) { var settings = { id: newId, name: '' }; //returned module object: should be very small in memory // - but what about performance? return { getId: function() { moduleFunc.getId(settings); }, getName: function() { moduleFunc.getName(settings); }, setName: function() { moduleFunc.setName(settings); } }; } Assume that a huge amount of modules is created and stored in memory, like this: //will myModules be small in memory? var myModules = []; for (var i = 0; i &lt; 10000; i++) { myModules.push(module('test'+i)); //does the call to setName perform well? myModules[myModules.length-1].setName('just a tes…
favorite count: 0
tagged with: optimization
score: 0
has comment: http://stackoverflow.com/comment/38792388
has comment: http://stackoverflow.com/comment/38791134
has comment: http://stackoverflow.com/comment/38792825
has title: Optimal way to implement a module pattern function in JavaScript?
has answer: http://stackoverflow.com/a/25203926

http://stackoverflow.com/comment/38881325
comment on: http://stackoverflow.com/q/25005750
has text: @user2853450 Can you upload your code to a server then give us the link?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25041032
score: 3
has comment: http://stackoverflow.com/comment/38947860
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25040861
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25040861
type: Answer
has comment: http://stackoverflow.com/comment/38947994
has comment: http://stackoverflow.com/comment/38947472
has comment: http://stackoverflow.com/comment/38947798
has body: Just use something like this: var loading = false; var postLoader = function() { if (loading == false) { loading = true; $.ajax({ // ajax options... }).always(function() { loading = false; }); } }
upvote count: 3

http://stackoverflow.com/comment/38776084
type: AnswerComment
score: 0
type: Comment
has text: I think you miss understood my question, what I ask is once is drop how can i get the start and end date, I didnt ask how to create a droppable!
comment on: http://stackoverflow.com/a/24949395

http://stackoverflow.com/a/24977202
has comment: http://stackoverflow.com/comment/38827382
has body: You're getting NaN because you're trying to parse an empty string, so either you add a special case to your code where you check if the string is empty before doing formatting (and default to [not set] or something), or you set 0 as a default value, so it can be parsed back and you get $0, makes sense?
score: 0
has comment: http://stackoverflow.com/comment/38827448
answers question: http://stackoverflow.com/q/24977068
has comment: http://stackoverflow.com/comment/38827510
type: Answer

http://stackoverflow.com/comment/38996624
comment on: http://stackoverflow.com/q/25066501
score: 0
has text: @Evan I will check that
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25005406
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25005335
has body: In JavaScript, you can use string.replace() to achieve the same. For example: var string = '&lt;h1&gt; Hello &lt;/h1&gt;' console.log(string.replace(/&lt;/g, '&amp;lt;').replace(/&gt;/g, '&amp;gt;')); // "&amp;lt;h1&amp;gt; Hello &amp;lt;/h1&amp;gt;"

http://stackoverflow.com/comment/38990663
type: AnswerComment
type: Comment
score: 2
has text: Sorry, this doesn't work. It throws me an Uncaught InvalidCharacterError. Thanks for downvoting both the question and the answer above anyway
comment on: http://stackoverflow.com/a/25063893

http://stackoverflow.com/q/25010211
accepted answer: http://stackoverflow.com/a/25036116
has body: I think I got a very simple question. With Pixijs I create multiple objects with the same constructor. For every object I define the same mouseover effect. How can this be simplifyed? Constructor: function thinarrow(divid,rotation,rendwidth,rendheight,spritewidth,spriteheight){ var that = this; //renderer &amp; stage this.rendererstage = new rendererstage("",divid,rendwidth,rendheight) //Creating Elements this.arrowblurFilter = new blurfilter(0,0); this.arrow = new DisplayObjectContainer(spriteheight,spritewidth,true) this.arrowimg = new SpriteFromImage("resources/img/layout/arrowthin.png",0,0,0.5,0.5,125,58,rotation); this.arrowblur = new SpriteFromImage("resources/img/layout/arrowthinblur.png",0,0,0.5,0.5,250,116,rotation,true,true); this.rendererstage.stage.addChild(this.arrow); this.arrow.addChild(this.arrowblur); this.arrow.addChild(this.arrowimg); //Animate this.animate = function(){ that.rendererstage.renderer.render(that.rendererstage.stage); requestAnimationFrame(that.animate); } } init.js (called on body-load) peoplearrowleft = new thinarrow("peoplearrowleft",Math.PI/2,116,250,125,58); peoplearrowright = new thinarrow("peoplearrowright",-Math.PI/2,116,250,125,58); requestAnimationFrame(peoplearrowleft.animate); requestAnimationFrame(peoplearrowright.animate); peoplearrowright.arrow.mouseover = function(mouseData){ peoplearrowright.arrowblur.filters = [peoplearrowright.arrowblurFilter.blurfilter]; TweenMax.to(peoplearrowright.arrowblurFilter.blurfilter, 0.8, {blurX:70, blurY:70, repeat: -1, yoyo:true}); } peoplearrowright.arrow.mouseout = function(mouseData){ TweenMax.to(peoplearrowright.arrowblurFilter.blurfilter, 0.8, {blurX:0, blurY:0, onComplete:function(){ peoplearrowright.arrowblur.filters = null; }}); } peoplearrowleft.arrow.mouseover = function(mouseData){ peoplearrowleft.arrowblur.filters = [peoplearrowleft.arrowblurFilter.blurfilter]; TweenMax.to(peoplearrowleft.arrowblurFilter.blurfilter, 0.8, {blurX:70, blurY:70, repeat: -1, yoyo:true}); } peopl…
score: 0
answer count: 1
tagged with: javascript
type: AnsweredQuestion
has title: define hover effect in constructor
tagged with: pixi.js
type: Question
has answer: http://stackoverflow.com/a/25036116

http://stackoverflow.com/a/24985942
accepted answer of: http://stackoverflow.com/q/24985785
has body: There is no else after the if statement thus the .html() function is being called twice. Updated : [http://jsfiddle.net/4bRBV/10/][1] var second = 0; function counter(i,n){ if( i &lt; n-1 ) { return ++i; } else { return 0; } } function secondinc(){ second = counter(second,60); if( second &lt; 9 ){ var sec = '0'+second; console.log(sec); $('.sec').html(sec); }else { $('.sec').html(second); } } var secondfunc = setInterval(secondinc, 1000);
answers question: http://stackoverflow.com/q/24985785
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
score: 1

list
type: Tag
tags question: http://stackoverflow.com/q/25049389
tag name: list
tags question: http://stackoverflow.com/q/25030958
tags question: http://stackoverflow.com/q/24958028

http://stackoverflow.com/comment/38959581
type: QuestionComment
type: Comment
has text: This does not really answer your question, but is it really necessary to have them in separate svg elements? I'd suggest using `transform="translate(x, y)"` to replace the CSS `left` and `top`, and put them in one to get the 'native' `pointer-events`, if possible, as that seems to work like a charm in your jsfiddle.
comment on: http://stackoverflow.com/q/25046999
score: 0

http://stackoverflow.com/comment/38757164
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24924249
has text: Thanks for the answers everyone. They actually all work; I guess there are a lot of ways to do this in Javascript.

http://stackoverflow.com/comment/38897646
has text: @RobSchmuecker In both example the `$` variable is a safe reference to the `jQuery` variable. However, your example using `jQuery(someFunction)` is a synonym of `$(document).ready(someFunction)` and it's the unique difference with it's original code: in your case, the function execution gets delayed until the page load event, which sounds better in his case because he don't know where the script is injected and so the code need to be runt only when the article is loaded in the DOM.
type: Comment
score: 0
comment on: http://stackoverflow.com/a/25013159
type: AnswerComment

http://stackoverflow.com/a/24982640
has body: To do the 4th section First what you want to do is make a PNG of an IPad with a transparent center. This can be done by googling "IPad" and finding an image that you like, then go into your favorite image editing program and mask and delete out the center part of the IPad(Where the content would go). The next thing you have to do is center the image of an IPad on a webpage. This can be done by puting the picture in a &lt;img&gt; tag like so &lt;img src="pathToIpadPicture" id="mainPic"&gt; then add some css #mainPic { display: block; margin: auto; margin-top: calc(50% - heightOfYourPictureHere); } That should center the picture vertically and horizontally in your page. Now you want to add in the interactive scroll part. This is why we made a IPad with a IPad with a transparent center. Now you have make some content. Make this content as big as the center of your IPad. Than add these pictures of content to your web page and center them the same way we did for the IPad picture. Make sure to hide them with display: none until they are needed. Then when the user scrolls at certain points animate the content pictures up. A good library for animating with Jquery is JS Transit. With the proper animation it should look just like the Nexus 5 page. If you want little text bubbles saying what the content is (like "HDR") just do the same thing but put them above the IPad frame(Layer wise) and animate them up the same way.
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24953210
type: Answer

http://stackoverflow.com/q/24957280
tagged with: sharepoint
has body: I have some js code that that makes a button export 2 views to excel (from the main view). When i click the button everything works fine but it opens the files one at a time and after i open the first file i get a pop-up thats generated from excel (see the pic). I've been trying to find a function that would do what that pop-up does. I'm trying to have both views open in the same workbook. Is it possible? Js code.. &lt;script type="text/javascript"&gt; function itsa() { window.open("http://*********/***/*******/******/_vti_bin/owssvr.dll?CS=109&amp;Using=_layouts/query.iqy&amp;List={******************************&amp;View={***************************}&amp;CacheControl=1"); } function other() { window.open("http://*********/***/*******/******/_vti_bin/owssvr.dll?CS=109&amp;Using=_layouts/query.iqy&amp;List={******************************}&amp;View={******************************}&amp;CacheControl=1"); } &lt;/script&gt; &lt;div class="wrapper"&gt; &lt;input type="button" style="width:180px; height: 75px; background:gray; color:white;font-size:larger; font-weight:bold; left: 214px;"onclick="itsa();other();" value ="Generate Excel report"/&gt; &lt;/div&gt;
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/25040503
has comment: http://stackoverflow.com/comment/38798519
accepted answer: http://stackoverflow.com/a/25040503
tagged with: sharepoint-2010
tagged with: excel
type: AnsweredQuestion
type: Question
has title: Is it posiblie to open 2 or more SP list views in one excel book?
tagged with: javascript

dreamweaver
type: Tag
tag name: dreamweaver
tags question: http://stackoverflow.com/q/24973522

http://stackoverflow.com/a/24958194
accepted answer of: http://stackoverflow.com/q/24957429
has body: Add a checkbox for Select All / Deselect All &lt;input type="checkbox" id="selectAll" name="selectAll" /&gt; Add a css class named "checkBoxClass" foreach (var item in Model) { &lt;tr id="@item.RouterID"&gt; &lt;td&gt; &lt;input class='checkBoxClass' type="checkbox" name="CheckBoxSelection" value="@item.RouterID.ToString()" /&gt; @Html.ActionLink("Edit", "Edit","Router", new { id=item.RouterID },null) } In jquery $(document).ready(function () { $("#selectAll").click(function () { $(".checkBoxClass").prop('checked', $(this).prop('checked')); }); });
type: Answer
answers question: http://stackoverflow.com/q/24957429
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/a/61641493
answers question: http://stackoverflow.com/q/25046301
score: 8
downvote count: 0
upvote count: 8
has body: Here is my code using async awaits and promises const getBlobFromUrl = (myImageUrl) =&gt; { return new Promise((resolve, reject) =&gt; { let request = new XMLHttpRequest(); request.open('GET', myImageUrl, true); request.responseType = 'blob'; request.onload = () =&gt; { resolve(request.response); }; request.onerror = reject; request.send(); }) } const getDataFromBlob = (myBlob) =&gt; { return new Promise((resolve, reject) =&gt; { let reader = new FileReader(); reader.onload = () =&gt; { resolve(reader.result); }; reader.onerror = reject; reader.readAsDataURL(myBlob); }) } const convertUrlToImageData = async (myImageUrl) =&gt; { try { let myBlob = await getBlobFromUrl(myImageUrl); console.log(myBlob) let myImageData = await getDataFromBlob(myBlob); console.log(myImageData) return myImageData; } catch (err) { console.log(err); return null; } } export default convertUrlToImageData;
type: Answer

http://stackoverflow.com/q/24959862
answer count: 1
upvote count: 16
tagged with: javascript
tagged with: inheritance
has comment: http://stackoverflow.com/comment/38794838
has answer: http://stackoverflow.com/a/24960101
accepted answer: http://stackoverflow.com/a/24960101
favorite count: 0
has body: I'm using John Resig's Simple Inheritance Class to define some classes, say: var MyClass = Class.extend({}); var MyOtherClass = Class.extend({}); then I have some instances var instanceA = new MyClass(); var instanceB = new MyClass(); var instancec = new MyOtherClass(); How can I determine if instanceA is of the same "type" as instanceB? Note: I'm not asking to check if they are both a MyClass, I need to determine the class of one, and then see if the other is the same, regardless of whether they are MyClasss, MyOtherClasss or any other type.
downvote count: 0
has title: How to tell if two JavaScript instances are of the same class type?
score: 16
linked to: http://stackoverflow.com/q/1249531
type: AnsweredQuestion
type: Question

http://stackoverflow.com/q/24929584
has comment: http://stackoverflow.com/comment/38738587
has comment: http://stackoverflow.com/comment/38737988
has comment: http://stackoverflow.com/comment/38737981
has title: AngularJS directive modify loaded template in link or compile function
tagged with: javascript
has comment: http://stackoverflow.com/comment/38737892
score: 0
answer count: 1
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38737796
has answer: http://stackoverflow.com/a/24990348
accepted answer: http://stackoverflow.com/a/24990348
has body: I'm loading a template inside my directive and I'd like to modify it based on some given attributes. How can I do that ? Here is my directive : directives.directive("myDirective", function($http, $compile){ return { restrict: 'E', scope : { }, templateUrl: 'lib/directives/myTemplate.html', link : function(scope, element, attrs) { // I need template to contain myTemplate.html code, how can I do that ? var trThead = template.find("thead").find("tr"); var headers = scope.attrs["headers"]; for (var i = 0; i &lt; headers.length; i++) { trThead.append('&lt;th&gt;&lt;span class="th-sort"&gt;' + headers[i] + '&lt;/span&gt;&lt;/th&gt;'); } element.append(template); } }; }); I don't want to define the HTML code directly in my directive since it's too big.
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38737714
type: Question

http://stackoverflow.com/a/25080231
has body: If your just using pure javascript see this fiddle: var VArray = ["tree", "chocolate", "bird", "candle", "apple"]; see the code for yourself there but its easier to put everything you want to validate into an array and loop through that array.
answers question: http://stackoverflow.com/q/25064009
accepted answer of: http://stackoverflow.com/q/25064009
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39048422

http://stackoverflow.com/a/41900481
downvote count: 0
score: 4
type: Answer
has body: drag events are used on the elements that are being dragged. dragover can be used on other elements that stay stationary such that something is dragged over them. If you ask for clientX or clientY on drag events, you will get zeros. If you drag that element over an element with dragover, and ask that event for coordinates, you will get x and y relative to the dragover listening element. Easiest example to see it in action is to apply dragover to the document object, then drag something over it and print the x and y.
answers question: http://stackoverflow.com/q/24942438
upvote count: 4

http://stackoverflow.com/a/25061412
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25061186
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25061186
type: Answer
has body: You are adding extraneous whitespace when you embed the data. Instead of: &lt;pre id="csvdata"&gt; zeit,count,total,avg 5:30,0,0,0 6:00,14,41.1, $2.94 6:30,19,52, $2.74 7:00,21,74, $3.52 7:30,28,143.25, $5.12 8:00,30,141.3, $4.71 8:30,32,124.28, $3.88 9:00,24,74.8, $3.12 9:30,47,172.35, $3.67 10:00,27,119.77, $4.44 10:30,40,210.44, $5.26 11:00,29,150.95, $5.21 11:30,14,80.3, $5.74 &lt;/pre&gt; Try: &lt;pre id="csvdata"&gt; zeit,count,total,avg 5:30,0,0,0 6:00,14,41.1, $2.94 6:30,19,52, $2.74 7:00,21,74, $3.52 7:30,28,143.25, $5.12 8:00,30,141.3, $4.71 8:30,32,124.28, $3.88 9:00,24,74.8, $3.12 9:30,47,172.35, $3.67 10:00,27,119.77, $4.44 10:30,40,210.44, $5.26 11:00,29,150.95, $5.21 11:30,14,80.3, $5.74 &lt;/pre&gt;
score: 1

http://stackoverflow.com/comment/91194720
comment on: http://stackoverflow.com/a/34202248
type: AnswerComment
score: 0
type: Comment
has text: In firefox: "Because Firefox saves state objects to the user's disk so they can be restored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object."

http://stackoverflow.com/a/24917906
upvote count: 3
has body: The correct answer is simply to remove the var in the declaration statement of the variable you wish to export. http://docs.meteor.com/#namespacing Also, make sure the load order is correct by following these rules : http://docs.meteor.com/#structuringyourapp
score: 3
accepted answer of: http://stackoverflow.com/q/24917466
answers question: http://stackoverflow.com/q/24917466
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/q/25039497
tagged with: javascript
tagged with: jquery
has title: Upload functionality on single click in IE9 without Flash
has comment: http://stackoverflow.com/comment/38978763
favorite count: 0
has comment: http://stackoverflow.com/comment/38996760
tagged with: jquery-file-upload
has comment: http://stackoverflow.com/comment/38955748
tagged with: http://stackoverflow.com/tag/html
tagged with: file-upload
answer count: 0
downvote count: 0
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/210643
has body: I want to achieve gmail like upload functionality which is upload on click/event, which works well on all browsers. For IE8 and below gmail is using Flash to upload file, but for IE9 + they are using single click upload without Flash. On click of div gmail is calling browse popup and on select of image or file in browse popup, submit gets triggered programmatically. I have working sample of my code, which works well in Chrome, Firefox and IE 10 + browsers, but it does not work in IE9. I am not looking for IE8 solution as that can be managed with Flash. I am aware that because of security reasons IE restricts programmatic form submit on File input. I have seen many solutions for upload at single click in which browse button is hidden and overlapped on another anchor and on click of that anchor, browse gets open and upload is done but that is not what I am looking for. I want to do it programmatically. My Question is how gmail achieve this in IE9 which works, but my code does not work. Can anybody help me in achieving same functionality which works well in IE9. Here is jsFiddle output: http://jsfiddle.net/vikramkute/nnJ8q/show/ For FireFox, Chrome and IE10+ Step1: Select a file from drop down browse popup gets open. Step2: Select Image or any file. Output: You will get redirected to "http://jsfiddle.net/vikramkute/nnJ8q/show/upload_file.php" (That means server side script gets called and file uploaded) For IE9 Step1: Select a file from drop down browse popup gets open. Step2: Select Image or any file. Output: You will not get redirected (That means form submit dose not get called.) Here is jsFiddle code: http://jsfiddle.net/vikramkute/nnJ8q Try gmail upload in IE9. It works. Here is my code: $(function() { $("#files").on("change", function(){ var selected = $(this).val(); $('input[type=file]').trigger('click'); }) $('input[type=file]').on("change", function(){ $("#uploadForm").trigger('submit'); }) }); HTML: (blank) File1 File2 File3 File4
score: 1
has comment: http://stackoverflow.com/comment/39016304
type: Question
upvote count: 1

http://stackoverflow.com/q/25047935
has answer: http://stackoverflow.com/a/25074151
tagged with: javascript
tagged with: extjs
has title: controller not get a reference of a view
has body: I make a simple MVC application, have one 'app.js' Ext.application({ name: 'ImpPdf', extend: 'ImpPdf.Application', autoCreateViewport: true }); have one 'application.js' Ext.define('ImpPdf.Application', { name: 'ImpPdf', extend: 'Ext.app.Application', views: [ 'Main' ], controllers: [ 'Main' ], stores: [] }); Have a 'viewport.js' Ext.define('ImpPdf.view.Viewport', { extend: 'Ext.container.Viewport', requires:[ 'Ext.layout.container.Fit', 'ImpPdf.view.Main' ], layout: { type: 'fit' }, items: [{ xtype: 'app-main' }] }); Have a controller 'Main.js' Ext.define('ImpPdf.controller.Main', { extend: 'Ext.app.Controller', views: 'Main', refs: [ { ref: 'appMain', selector: 'appmain', xtype: 'app-main' } ], init: function() { console.log('Main.Controle'); console.log(this.getAppMain()); this.control({ 'appmain tabpanel': { click: this.onTabChange } }); }, onTabChange: function(tabPanel, newCard, oldCard, eOpts) { console.log('tabchange'); } }); Have a view 'Main.js' Ext.define('ImpPdf.view.Main', { extend: 'Ext.container.Container', requires:[ 'Ext.tab.Panel', 'Ext.layout.*', 'Ext.ux.GroupTabPanel' ], alias: 'widget.appmain', xtype: 'app-main', layout: { type: 'border' }, defaults: { bodyBorde: false, split: true, bodyPadding: 0 }, items: [ header, west, contentPanel ] }); The problem is, I cannot get the reference to a view in controller. Console show me undefined. console.log(this.getAppMain()); I need to get a tabpanel' to get a 'tabchange' event.
tagged with: extjs4.2
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25048377
type: Question
score: 0
answer count: 2

http://stackoverflow.com/q/24953515
has comment: http://stackoverflow.com/comment/38943662
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/39162942
tagged with: jquery
has title: Set parent div height to content that is not overflowing
favorite count: 0
accepted answer: http://stackoverflow.com/a/25038944
possible better answer: http://stackoverflow.com/a/25141029
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25038944
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38943802
has comment: http://stackoverflow.com/comment/38943209
type: Question
has answer: http://stackoverflow.com/a/25141029
has comment: http://stackoverflow.com/comment/38962403
has body: I have a slider that's in place on my website. The basic way that it works is depicted in this jsfiddle - http://jsfiddle.net/6h7q9/15/ I've written code to set the parent's height to the height of the content div. This worked fine, until I introduced some content that did not have a fixed height and whose height might increase while it was being shown on the page. Is there a way, I can dynamically change the height of this parent div whenever content inside it increases or decreases it's height. HTML - Has content that might increase the height of the div.... Has content that might increase the height of the div.... Has content that might increase the height of the div.... I appear after the largest container, irrespective of which one is present.... JavaScript - var currSlider = 1; $('#btnNext').click(function(){ debugger; var margin = $('#slider').css('margin-left'); if(parseInt(margin) <= -400) { return; } currSlider++; // Moving the slider $('#slider').css('margin-left', parseInt(margin) - 200 + 'px'); // Resetting the height... $('#slider').height($('#slide' + currSlider).height()); }); $('#btnPrev').click(function(){ debugger; var margin = $('#slider').css('margin-left'); if(parseInt(margin) >= 0) { return; } currSlider--; // Moving to the previous slider $('#slider').css('margin-left', parseInt(margin) + 200 + 'px'); // Resetting the height... $('#slider').height($('#slide' + currSlider).height()); }); $('#btnAddText').click(function() { $('#slide' + currSlider).text('Hello World'.repeat(100)); }); String.prototype.repeat = function(times) { return (new Array(times + 1)).join(this); };
tagged with: javascript

http://stackoverflow.com/comment/38821567
score: 0
type: Comment
has text: K i managed to make it work, i think i had to add ` `before the ` ` tag, its weird because it was somewhere else on the page and i didn't want to make it redundant.
comment on: http://stackoverflow.com/a/24972597
type: AnswerComment

http://stackoverflow.com/comment/38918286
type: QuestionComment
has text: Just make an div with a border-radius: 100%
score: 0
comment on: http://stackoverflow.com/q/25025153
type: Comment

http://stackoverflow.com/q/24974417
tagged with: content-editor
score: 0
answer count: 1
tagged with: javascript
tagged with: sharepoint-2010
has answer: http://stackoverflow.com/a/24974814
accepted answer: http://stackoverflow.com/a/24974814
has title: parsley 2.0.3 not working with boostrap 3
has body: i am trying to use parsely.js on my html page to validate input box. currently this html page contains one input box and one submit button. the structure is created using bootstrap 3 and this page does not contain Form tag. Full Name i am calling parsley.js like function validateInput() { var handle = $("input[name='fullName']").parsley({ successClass: "has-success", errorClass: "has-error", classHandler: function (el) { return $(el).closest('.form-group');//not working }, errorsWrapper: "", errorTemplate: "", }); return handle.isValid(); } on click of Submit button. it returns true/false correctly and create span tag also. but error classes are not applied. even data-parsley-required-message'Please insert your name' is not working. when i put alert($(el)) or alert(el) it gives [object Object]. i think el should be the input object on which i am calling parsley function. but i am not able to get el.attr('id') or any other attribute. it returns undefined. i have also tried //return el.closest('.form-group');//not working //return el.$element.closest('.form-group)//not working //return $(el).$element.closest('.form-group')//not working I can not use Form tag as i am using this html structure in sharepoint content edtior web part.
tagged with: twitter-bootstrap-3
type: AnsweredQuestion
tagged with: parsley.js
type: Question

http://stackoverflow.com/q/24965592
has title: Lightbox not loading dynamic selector
tagged with: http://stackoverflow.com/tag/html
has body: Could really do with some assistance with this: So I am using a lightbox called featherlight. I have a form in there, the form has a few input fields but the two I need help with are a country selection, so you select either Us or UK and whichever one you select the next options list change accordingly. Now, It works perfectly fine outside the lightbox so directly onto the body, yet as soon as I place it in the form within the lightbox it fails. Here is my script for the dynamic selectors. Here is the form: UK US Here is a demo of it in action: Demo fiddle so the primary issue is that it will not work in the lightbox, I am obviously missing something.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24965832
tagged with: forms
type: Question
score: 0
tagged with: lightbox
answer count: 1
has comment: http://stackoverflow.com/comment/38805875
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24980345
has title: JS popup message when adding item to cart.php
tagged with: javascript
has comment: http://stackoverflow.com/comment/38833158
score: 0
has comment: http://stackoverflow.com/comment/38833239
accepted answer: http://stackoverflow.com/a/24980455
answer count: 1
has comment: http://stackoverflow.com/comment/38833247
tagged with: jquery
tagged with: ajax
has body: I have this line of code: &lt;form name="addtocart" method="post" action="cart.php"&gt; &lt;input type="text" size="3" name="qty" value=""&gt;&lt;input type="hidden" name="action" value="add_item"&gt;&lt;input type="hidden" name="id" value="&lt;?php echo $record-&gt;itemId; ?&gt;"&gt;&lt;input type="image" src="../css/images/cart.png" align=absmiddle &gt; &lt;a href="favorites.php?action=setFavorite&amp;itemnr=&lt;?php echo $record-&gt;itemId; ?&gt;"&gt;&lt;img src="../css/images/favorite.png" align="absmiddle" alt="Toevoegen aan favorieten" title="Toevoegen aan favorieten" border="0"&gt;&lt;/a&gt; &lt;/form&gt; Now I want to display a popup when a item is added to cart.php. I have tried a simple onclick event, this works, but then the item is not added to the cart. It just displays the popup. So I just want something you see on most modern webshops, but I am completely new to JS, so except for onclick I have no more knowledge left on how to get this done. I have google'd for ever, so i thought maybe someone here might give a little tip or example on how to get this done. Thanks a bunch!
tagged with: php
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24980455
tagged with: cart
type: Question

http://stackoverflow.com/comment/38924996
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25028610
has text: Which is the problem: is the form not submitting at all, or is the form submitting but the image data not being passed to `upload.php` as hoped?

http://stackoverflow.com/q/24950734
tagged with: jquery
has title: Round Values pushed from a JSON with JS
has answer: http://stackoverflow.com/a/24950903
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38781200
accepted answer: http://stackoverflow.com/a/24950903
type: Question
has body: I'm absoluteley new to JS and i cant figuere out how i should proceed to round the values (Counter1 & Counter2) which come from the external File IOCounter.html with a Json-Structure. I tried to put the math.round() to different places within the code which seemed to be logical for me- but nothing worked. Do i have to define Var's, round these and write the the result to the label? Thanks for your help. 0 0
tagged with: rounding
has comment: http://stackoverflow.com/comment/38778116
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/a/25200175
has comment: http://stackoverflow.com/comment/39248946
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/39248712
has comment: http://stackoverflow.com/comment/39249083
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25010236
answers question: http://stackoverflow.com/q/25010236
has comment: http://stackoverflow.com/comment/39258809
has body: Add new validation method right after the ready function $.validator.addMethod("valueNotEquals", function(t, n, r) { return t != r }, $.validator.format("Invalid val is supplied.")); Validation rules should look like rules: { firstname: { minlength: 3, maxlength: 15, required: true }, lastname: { minlength: 3, maxlength: 15, required: true }, mySelect: { valueNotEquals: 0 } }, And of course do not forget to add name attribute to your select like in the rules declared above + placeholder option's value should be the value provided in rules (in this case 0) &lt;select id="lstColors" name="mySelect" class="lstColors required"&gt; &lt;option value="0"&gt;&lt;/option&gt; UPDATE I noticed that if the value of placeholder option is changed the placeholder disappears, so I searched for another solution and found one: $(".lstColors").on('select2-removed', function () { if ($('form').hasClass('submitted')) $('form').valid(); }); Checkout the fiddle
score: 4
has comment: http://stackoverflow.com/comment/39251439
type: AcceptedAnswer

http://stackoverflow.com/q/25017690
has comment: http://stackoverflow.com/comment/38903687
tagged with: javascript
tagged with: jquery
score: 0
has title: Run function once both input fields have a value with jQuery
has body: On my page I have 2 input fields, a start and an end. I have a function that runs on keyup in my second input field - this runs regardless if the first field is empty or not. I also have to buttons that populate either or my input fields. What I'm asking is, is there a way to add a listener of some sort so that once both fields contain a value my function will run? Heres a fiddle to hopefully explain better... http://jsfiddle.net/Zn6UR/1/ Code var timer; function CalculateRoutes(){ alert('Done!'); } $( '.end' ).keyup(keyup); function keyup() { clearTimeout(timer); timer = setTimeout(CalculateRoutes,500); } $('.first').click(function(e){ $('.start').val('Location1'); e,preventDefault(); }); $('.second').click(function(e){ $('.end').val('Location1'); e,preventDefault(); });
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25017798
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38903654
has answer: http://stackoverflow.com/a/25017798
type: Question
answer count: 1

http://stackoverflow.com/a/25036553
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25036497
type: Answer
has comment: http://stackoverflow.com/comment/38939102
answers question: http://stackoverflow.com/q/25036497
has comment: http://stackoverflow.com/comment/38939292
upvote count: 1
score: 1
has body: Try using getAttribute instead: Obj.getAttribute("FailureCodeId") Or if you want to use attributes property don't use it as a method. It's a NamedNodeMap. For example: Obj.attributes["FailureCodeId"] But be aware that this no longer supported on Firefox > 22 and many modern browsers. Read more about this at MDN
type: AcceptedAnswer

http://stackoverflow.com/q/25069436
linked to: http://stackoverflow.com/q/23175761
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25089148
has comment: http://stackoverflow.com/comment/39001681
score: 0
answer count: 1
tagged with: jquery
has body: How can jQuery in a custom directive respond to a $scope change? Hello this is a test note: $timeout is only inside the directive to push .scrollTop() to the end of the update cycle as per this thread Angular & jQuery:horizontal scrolling a div from a controller or directive myapp.directive('scrolldirective', function($timeout) { return { restrict: 'A', link: function(scope, element, attrs) { $timeout(function() { $(element).scrollTop( scope.mytop ); }, 1); } }; }); and finally some $scope code that I want the directive to react to $scope.mytop = 500; $timeout(function(){ $scope.setPosition(50); },1000); $scope.setPosition = function(arg){ $log.log('===> ',arg); $scope.mytop = arg; $scope.$apply(); // ??? } edit: here is a jsFiddle with all the minimal code to get this running. Unfortunately jsFiddle's UI adds its own scrollbars to the panels which interferes with this! Grr. But at leas all the code is there if you feel like copying it out. http://jsfiddle.net/PrimeLens/CV5L8/
has answer: http://stackoverflow.com/a/25089148
tagged with: angularjs
has comment: http://stackoverflow.com/comment/39001651
type: AnsweredQuestion
has title: angular - How can jQuery inside a custom directive respond to a $scope change?
has comment: http://stackoverflow.com/comment/39001796
type: Question

http://stackoverflow.com/q/24951505
type: UnansweredQuestion
has body: I'm trying to use traversal neo4j api rest in order to solve a problem like in the image https://drive.google.com/file/d/0B3i9KFQXzB89YXl0VkEzaDZDMHc/edit?usp=sharing I need to make a prune evaluetor based on a sum of precedent traversed node properties It's possible to do with traversal api rest? I'm searching for documentation but it's very poor in neo4j ufficial site. I see only a couple of example that use position object ex:position.endNode() but without explainations. My traversal is: uniqueness: node_path max_depth: 6 prune_evaluator: (position.endNode().hasProperty('start') &amp;&amp; position.endNode().getProperty('start') != '****'); return_filter: (position.endNode().hasProperty('name') &amp;&amp; position.endNode().getProperty('name') == '***'); I'm searching to do something like this. NB: This syntax is completely invented: prune_evaluator: var a = (int)position.endNode().getProperty('start'); var b = (int)position.endNode()-&gt;getParent().getProperty('start'); if( a &gt; (b +10)){ true; }else{ false; }
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/38934679
upvote count: 1
has comment: http://stackoverflow.com/comment/39024217
type: Question
has title: Neo4j traversal javascript api
tagged with: traversal
has comment: http://stackoverflow.com/comment/39218755
tagged with: javascript
has comment: http://stackoverflow.com/comment/38934724
downvote count: 0
tagged with: neo4j
favorite count: 0
has comment: http://stackoverflow.com/comment/39018326

http://stackoverflow.com/q/25036682
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38939065
score: 0
has body: I have never wrote javascript on the below syntax. What I want to do is simply declare a variable outside the function "showUrlLink", what is the correct way to do it? //File test.js var Test = { //Declare variable here to be used in showUrlLink var test = "something";//This gives syntax error showUrlLink: function() { if (test === "something") { //Do something } } }; Thanks in advance.
type: Question
linked to: http://stackoverflow.com/q/2752868
accepted answer: http://stackoverflow.com/a/25036714
tagged with: javascript
has answer: http://stackoverflow.com/a/25036828
has title: Syntax error (declare "class" variable)
has answer: http://stackoverflow.com/a/25036710
possible better answer: http://stackoverflow.com/a/25036828
answer count: 4
has answer: http://stackoverflow.com/a/25037088
has answer: http://stackoverflow.com/a/25036714

http://stackoverflow.com/comment/38780921
comment on: http://stackoverflow.com/a/24952232
score: 0
type: Comment
has text: When not *exposed* to the caller, I don't see any real problem with that. ;)
type: AnswerComment

http://stackoverflow.com/comment/38775622
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24949293
has text: Can you fill in more details of how you manipulate element heights and what is the wanted outcome?

http://stackoverflow.com/q/25020086
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25021177
has title: Is it possible to use a different modules in AngularJS based on a config change?
upvote count: 1
type: Question
score: 1
has body: I kind of understand how DI works with modules in AngularJS and I was hoping to take advantage of that to be able to use a different module depending on the environment of the application. For example, I want to make something that can run on both a mobile device (using Phonegap) as well as in a regular desktop browser. There is service function that I want to use for data access. On the device, I just want it to query the local database on the device. For the desktop browser version, I want it to query a web service. So for example, I want 2 services that can be interchanged: angular.module('myDataServiceLocalStorage', []) .factory('dataSrv', [function () { return { getOrders: function () { //get from database } }; } ]) ; angular.module('myDataServiceWebService', []) .factory('dataSrv', [function () { return { getOrders: function () { //get from web service } }; } ]) ; In my angular controllers, I could inject either myDataServiceLocalStorage or myDataServiceWebService to get access to the getOrders function, but how can I configure this better to use one or the other among all of my controllers? I don't necessarily need it to detect the environment automatically, but is there a way I can do this so that I don't have to globally search and replace each module reference everytime I prepare to deploy the project? I was thinking about doing something with providers, but I am confused and I don't think that is their main purpose (looks like Angular providers just modify a single existing service before it is instantiated) Is something like this even possible?
tagged with: javascript
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38908497
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25021177

http://stackoverflow.com/comment/38746684
comment on: http://stackoverflow.com/a/24930491
score: 0
type: Comment
has text: your answer was right, the bug was vicious and came from elsewhere
type: AnswerComment

http://stackoverflow.com/q/24909235
has comment: http://stackoverflow.com/comment/38699151
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38703179
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24909349
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/2716468
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38699075
tagged with: css
has body: I'm trying to get some JSON data from a file on my server and for some reason it's not working but throughs an error. But if I log error.responseText I can see my data there!? I'm using this function function getJson(url) { var result; $.getJSON(url, function(data){ console.log('success'); }).error(function(error){ result = error.responseText; console.log("Error: " + result); return result; }); } Does anyone know why?
has title: Getting JSON data back in error.responeText

http://stackoverflow.com/comment/38789040
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24956918
has text: Unless you want `a` and `b` to be global, you should `var` them.
type: QuestionComment

http://stackoverflow.com/q/24999549
has comment: http://stackoverflow.com/comment/38869382
has comment: http://stackoverflow.com/comment/38869780
accepted answer: http://stackoverflow.com/a/24999732
score: 0
has body: I have a basic bootstrap table of 3 columns with multiple rows. The 3rd column is a select box with values in it. Now when the user clicks on a table row, I want the id of this select box value that is selected. I have this so far.. JSP <c:forEach var="subSection" items="${section.subSectionList}"> ${section.sectionName} ${subSection.subSectionName} <c:forEach var="scase" items="${subSecction.SCaseList}"> ${scase.caseName} </c:forEach> </c:forEach> JS function selectTableRowData(){ $('#tableSectionDetails tbody td').dblclick(function(){ var rowIndex = $(this).parent().index(); alert(rowIndex); //shows the correct row index but it alerts the same index for all the rows table has instead of the selected row and just one time alert($("select.caseName[rowIndex]").text()); //empty...does not return the correct value and again alerts me multiple times (row times) instead of just one time selected row.. }); }
has comment: http://stackoverflow.com/comment/38869706
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24999732
has comment: http://stackoverflow.com/comment/38869658
type: Question
has comment: http://stackoverflow.com/comment/38869460
has comment: http://stackoverflow.com/comment/38869337
answer count: 1
tagged with: javascript
tagged with: jquery
has title: Getting the id for the select element in a table

http://stackoverflow.com/q/25022663
possible better answer: http://stackoverflow.com/a/32867086
linked to: http://stackoverflow.com/q/15219717
tagged with: jasmine
favorite count: 0
has answer: http://stackoverflow.com/a/32867086
tagged with: angularjs
has title: How to unit test angularjs form?
has answer: http://stackoverflow.com/a/35949890
has answer: http://stackoverflow.com/a/42772877
answer count: 4
has answer: http://stackoverflow.com/a/25024441
has body: I have been learning AngularJS and things have been going pretty smoothly regarding unit testing, but I've reached a bit of a tricky spot. Suppose I have a simple form, for example: &lt;form name="form"&gt; &lt;input type="text" name="number" ng-pattern="/^d+$/"&gt; &lt;/form&gt; If I was testing something like a controller, I know that I would write it something like this (using Jasmine + Karma): beforeEach(module('some.module')); beforeEach(inject(/* services */) { /* inject necessary services */ }); it('should be invalid when given bad input', function () { form.number = 'Not a number'; expect(form.number.$valid).toBeFalsy(); expect(form.$valid).toBeFalsy(); }); But I don't know which services I need to inject, and I haven't had any luck finding documentation on unit testing in either the forms guide or the ng-form documentation. How does one unit test a form in Angular?
has comment: http://stackoverflow.com/comment/38913652
type: AnsweredQuestion
upvote count: 19
tagged with: karma-runner
has comment: http://stackoverflow.com/comment/38913382
score: 19
tagged with: unit-testing
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25024441
has comment: http://stackoverflow.com/comment/38916447
has comment: http://stackoverflow.com/comment/38916365
downvote count: 0

http://stackoverflow.com/comment/38892257
has text: `I need to append the value of the checklist li to the list of the append-checklist once the checklist li has the class active and remove the value once active class is removed from the checklist li.` Full Confused. Can you explain little brief?
score: 1
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25011615

onclick
tags question: http://stackoverflow.com/q/24976748
tags question: http://stackoverflow.com/q/24953662
tags question: http://stackoverflow.com/q/24979389
tags question: http://stackoverflow.com/q/25061436
tags question: http://stackoverflow.com/q/25014911
tags question: http://stackoverflow.com/q/25033969
tags question: http://stackoverflow.com/q/25006768
tags question: http://stackoverflow.com/q/24959836
tags question: http://stackoverflow.com/q/25019926
tags question: http://stackoverflow.com/q/24924666
tags question: http://stackoverflow.com/q/25057945
tags question: http://stackoverflow.com/q/25007811
type: Tag
tags question: http://stackoverflow.com/q/24995501
tags question: http://stackoverflow.com/q/25003775
tags question: http://stackoverflow.com/q/24954355
tags question: http://stackoverflow.com/q/24977159
tags question: http://stackoverflow.com/q/24994580
tags question: http://stackoverflow.com/q/25048944
tags question: http://stackoverflow.com/q/24943247
tag name: onclick
tags question: http://stackoverflow.com/q/24996470
tags question: http://stackoverflow.com/q/24967105
tags question: http://stackoverflow.com/q/24986942
tags question: http://stackoverflow.com/q/25035261
tags question: http://stackoverflow.com/q/25040167
tags question: http://stackoverflow.com/q/25063121

http://stackoverflow.com/a/50537634
answers question: http://stackoverflow.com/q/24947262
type: Answer
score: 0
has body: If for some reason the browserify command has not been installed at all (can happen for example if you're running Homebrew on old unsupported Mac OS X versions), an alternative is to call it via node, for example: export NODE_PATH=/usr/local/share/npm/lib/node_modules node -e 'require("browserify")("input.js").bundle().pipe(fs.createWriteStream("output.js"))'

http://stackoverflow.com/q/25063949
has comment: http://stackoverflow.com/comment/38990879
has comment: http://stackoverflow.com/comment/38990810
score: 2
tagged with: http://stackoverflow.com/tag/html
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 2
tagged with: css
has answer: http://stackoverflow.com/a/25064142
type: AnsweredQuestion
has body: Before you mark this as a duplicate, I've been browsing for hours looking for a solution, but none of them work for me. I have an absolutely positioned div (#hero-img) acting as a background container with an img in it (using a real background is not an option, as I'm using a jQuery cycle with fading). Here's what I've finally settled on that almost works: html: &lt;div id="hero-img"&gt; &lt;img src="img/heros/hero-img.jpg" /&gt; &lt;/div&gt; CSS: #hero-img { position: absolute; margin: 0 auto; top: 0; left: 0; bottom: 0; right: 0; height: 100%; width: 100%; overflow: hidden; } #hero-img img { width: 100%; height: auto; position: absolute; margin: 0 auto; top: 0; left: 0; bottom: 0; right: 0; } JS: var w = window.innerWidth; var h = window.innerHeight; if( w / h &lt; 1650 / 1050 ) { $('#hero-img img').css("height", "100%"); $('#hero-img img').css("width", "auto"); } else { $('#hero-img img').css("width", "100%"); $('#hero-img img').css("height", "auto"); } This seems to work when the window is wide but not when mobile sized. You can check it out at kylebashour.com/carlex to see what I mean. I tried the left: 50%; margin-left: (half of image width); but it pushes it left too far at some sizes (I think because the width is auto perhaps..) Any help would be much appreciated!
has title: Centering absolute img in absolute div responsively, feels like I tried everything
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25064142
tagged with: jquery

http://stackoverflow.com/q/25049422
has body: I'm new to Ember, here is a simple code to let arrow button to increase and decrease the value of amount property: export default Ember.View.extend({ afterRenderEvent: function() { $('.spinner .increase').on('click', function() { this.incrementProperty('amount'); }); $('.spinner .decrese').on('click', function() { this.decrementProperty('amount'); }); }, template: ProductView }); The problem is the this not refer to the Ember.View Object, but the scope of the function, How to solve this problem? Plus I think use jQuery to manipulate the element is not the ember way. Should I create view for each arrow button?
type: AnsweredQuestion
type: Question
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
tagged with: scope
has answer: http://stackoverflow.com/a/25049548
accepted answer: http://stackoverflow.com/a/25049548
tagged with: ember.js
has title: How to refer to the parent scope in Ember View

http://stackoverflow.com/comment/38831096
has text: What modal are you using? jQuery dialog?
type: Comment
comment on: http://stackoverflow.com/q/24978998
score: 0
type: QuestionComment

http://stackoverflow.com/comment/39115573
type: Comment
comment on: http://stackoverflow.com/a/24981433
has text: Finally I've done with it, thanks for your answer rcarvalho :)
score: 0
type: AnswerComment

http://stackoverflow.com/q/25017588
has comment: http://stackoverflow.com/comment/38905417
tagged with: facebook-login
has comment: http://stackoverflow.com/comment/38905338
has comment: http://stackoverflow.com/comment/38904201
has body: tried a bit but unable to detect the error, what i want is when a user visits my site and logs in using facebook login, his user data must be added to my site's database. Below is the client js side code, this works correctly and obtains data from Facebook, i verified by printing the obtained details. but after adding AJAX to post to php file, even the "thanks for loging in" message is also not printed function testAPI() { console.log('Welcome! Fetching your information.... '); var url = '/me?fields=name,email'; FB.api(url, function (response) { //over here i used this to obtain email explicitly var fbname=response.name; var mail=response.email; $.ajax({ type: "POST", url: "http://kumarindia.byethost24.com/addguestbook.php", data: "name="+fbname+"&amp;email="+mail, }); document.getElementById('status').innerHTML = 'Thanks for logging in, ' + response.name +"," + response.email + '!'; }); } now the server side php file is below, $name = mysqli_real_escape_string($con, $_POST['name']); $email = mysqli_real_escape_string($con, $_POST['email']); $comment = mysqli_real_escape_string($con, $_POST['comment']); $sql="INSERT INTO questbook (name, email, comment, datetime) VALUES ('$name', '$email', '$comment', '$datetime')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con)); }
type: UnansweredQuestion
has title: unable to update sql server using data obtained from facebook login, using php and js
tagged with: php
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/38903889
type: Question
has comment: http://stackoverflow.com/comment/38905265
has comment: http://stackoverflow.com/comment/38904714
has comment: http://stackoverflow.com/comment/38904079
tagged with: javascript

http://stackoverflow.com/comment/109957295
type: AnswerComment
score: 0
type: Comment
has text: From Review: Hi, please don't answer just with source code. Try to provide a nice description about how your solution works. See: [How do I write a good answer?](https://stackoverflow.com/help/how-to-answer). Thanks
comment on: http://stackoverflow.com/a/62169167

http://stackoverflow.com/comment/60960823
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25035728
has text: @OnaBai please have look my code and give solution. I'm waiting for your reply. Thanks...
score: 0

http://stackoverflow.com/q/24913150
tagged with: javascript
duplicate of: http://stackoverflow.com/q/2530228
favorite count: 0
has title: javascript RAM memory usage
has comment: http://stackoverflow.com/comment/38707810
has body: I have website which can upload images. I do CROP from client side before upload then in server side new optimize... On Mobile devices when no Free RAM fails. How I can get RAM memory usage from JavaScript to skip CROP if there no memory? I am looking only JavaScript solution!. PLEASE I do not have LEAK OF MEMORY!!! if I open many apps and no much RAM left my strategy not working I need CODE by JavaScript get the free RAM and if is it bellow some amount I skip the CROP ------------ OK define Fail: -------------- From mobile devices people take photo and upload it... from JavaScript I perform CROP 1. around 2MB image goes to 300kb 2. I upload only 300kb then from server side 300kb --> 30kb that I save If there is no RAM this FAILs I do not want to say "try again" I would like to Skip the CROP Thank you very much for comments. I handle the errors but I would like to avoid client to wait 40-60 sec and then message If I go with NO CROP IS IT OK but saving near 1.7MB per image bandwidth... GREEDY :-) window.performance good I will used thanks. I will do research to have round trip from SERVER SIDE what I can do can I find it for Mobile devices
has comment: http://stackoverflow.com/comment/38707271
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2530228
downvote count: 1
has comment: http://stackoverflow.com/comment/38707991
type: Question
score: 3
has answer: http://stackoverflow.com/a/24913221
accepted answer: http://stackoverflow.com/a/24913221
upvote count: 4
answer count: 1

http://stackoverflow.com/a/24970432
has body: You can use $("div[id*='item']").next(); or $("div[id*='item']").prev(); Or iterate through $("div[id*='item']") using .eq() $("div[id*='item']") selects the elements that have an id attribute containing the word item in it.
score: 0
answers question: http://stackoverflow.com/q/24970324
type: Answer

http://stackoverflow.com/q/25054285
has comment: http://stackoverflow.com/comment/38975907
has answer: http://stackoverflow.com/a/25056351
answer count: 1
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38977699
has comment: http://stackoverflow.com/comment/38977560
has comment: http://stackoverflow.com/comment/38978350
has comment: http://stackoverflow.com/comment/38972714
has title: loading the php file on node
has comment: http://stackoverflow.com/comment/38977593
tagged with: node.js
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38975460
tagged with: php
has body: Hi I'm trying to develop a chat system using socket.io, express.io and node.js everything is going smoothly, and I have been following the documentation from them. The problem is as soon as I'm trying to integrate the design to the skeleton app that I have developed, it wont load correctly. It only gives me a popup notifying me to either download or open the PHP file. here is my index.js var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); app.get('/', function(req, res){ res.sendfile('message.php'); }); io.on('connection', function(socket){ socket.on('chat message', function(msg){ console.log('message: ' + msg); }); }); io.on('connection', function(socket){ socket.on('chat message', function(msg){ io.emit('chat message', msg); }); }); http.listen(3000, function(){ console.log('listening on *:3000'); }); Am I doing something wrong here?
has comment: http://stackoverflow.com/comment/38978868
has comment: http://stackoverflow.com/comment/38972572
score: 3
linked to: http://stackoverflow.com/q/13024801
upvote count: 3
has comment: http://stackoverflow.com/comment/38975954
has comment: http://stackoverflow.com/comment/38976251
type: Question

http://stackoverflow.com/q/24987536
tagged with: jquery
has comment: http://stackoverflow.com/comment/38847248
favorite count: 0
possible better answer: http://stackoverflow.com/a/24987583
has answer: http://stackoverflow.com/a/24987583
answer count: 4
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38847116
has title: All Checkbox Selected
has comment: http://stackoverflow.com/comment/38847190
has answer: http://stackoverflow.com/a/24987624
type: Question
accepted answer: http://stackoverflow.com/a/24987673
score: 1
has body: I'm wondering how to see if all checkboxes are selected using jQuery. Basically when all three options are selected I want to display only the mobile number. If only the last option is selected show the home number. If all three are selected show mobile and keep home hidden. I've managed to get the case where if the user clicks on the last option show the home number but not if all three are selected. See my jQuery below... DEMO var form = { init: function() { form.selection(); form.showHomeNumber(); }, selection: function() { var option = $('.checkbox'); option.on('click', function(e){ e.preventDefault(); $(this).toggleClass('active'); $(this).children().prop( 'checked', !$(this).children().prop('checked') ); }); }, //If I select only the last option show home number showHomeNumber: function() { var homeNumber = $('.home-number'), lastOption = $('.last-option'), mobileNumber = $('.mobile-number'); lastOption.on('click', function(e){ e.preventDefault(); //If all three are selected show mobile, hide home if ($("form input:checkbox:checked").length === 3) { mobileNumber.css('display', 'block'); homeNumber.hide(); } //If select last option only show home homeNumber.toggleClass('home-active'); //If select last option only hide mobile mobileNumber.toggleClass('mobile-inactive'); }); } } $(function(){ form.init(); });
has answer: http://stackoverflow.com/a/24987668
has comment: http://stackoverflow.com/comment/38847297
has answer: http://stackoverflow.com/a/24987673
upvote count: 1
tagged with: javascript

http://stackoverflow.com/comment/38981832
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25058463
has text: @mainguy, you're right about th and td, it was a typo. I'm in fact loading that content via a PHP loop.

http://stackoverflow.com/a/25044378
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25042930
answers question: http://stackoverflow.com/q/25042930
type: Answer
score: 2
downvote count: 1
has body: Look i don't know too much about fullpage.js But i don know about resizing image according to your window size..... first of all download any image and i named it sa.jpg In above code we kept image within #box div. and we also added responsive named class to img element.Assign it a max-width value of 100%. This allows the width to adjust to the browser width changes. Next, add a dynamic height property to the class. Above code is responsive for img element.. Now if you want to use background image css property and resize your image according to screen size

http://stackoverflow.com/a/24925660
answers question: http://stackoverflow.com/q/24925502
type: Answer
has body: Well that turned out to be a lot more obvious than I thought... a little trial and error showed that a directive can actually require itself as well. The proper way to inherit parent + local controllers seems to be: app.directive('screen', function() { return { scope: true, controller: function() { this.doSomething = function() { }; } } }); app.directive('widget', function() { return { scope: true, require: ['^screen','widget'], controller: function($scope) { this.widgetDoSomething = function() { }; }, link: function($scope, el, attrs, ctrl) { // ctrl[0] contains the `screen` controller // ctrl[1] contains the local `widget` controller } } });
has comment: http://stackoverflow.com/comment/60305973
has comment: http://stackoverflow.com/comment/52884479
upvote count: 37
has comment: http://stackoverflow.com/comment/47029793
score: 37
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24925502

safari
tags question: http://stackoverflow.com/q/25066941
tags question: http://stackoverflow.com/q/25032905
tags question: http://stackoverflow.com/q/24942499
tags question: http://stackoverflow.com/q/24917282
tags question: http://stackoverflow.com/q/24916960
tags question: http://stackoverflow.com/q/24918767
tags question: http://stackoverflow.com/q/25064619
tags question: http://stackoverflow.com/q/25059764
tags question: http://stackoverflow.com/q/24924330
tags question: http://stackoverflow.com/q/24987965
type: Tag
tags question: http://stackoverflow.com/q/24993051
tags question: http://stackoverflow.com/q/25023761
tags question: http://stackoverflow.com/q/24939392
tags question: http://stackoverflow.com/q/25062516
tags question: http://stackoverflow.com/q/25042009
tags question: http://stackoverflow.com/q/25014121
tags question: http://stackoverflow.com/q/25059353
tags question: http://stackoverflow.com/q/25054030
tag name: safari

http://stackoverflow.com/a/25014523
downvote count: 0
answers question: http://stackoverflow.com/q/25014207
type: Answer
upvote count: 1
score: 1
has body: You can place any number of scripts in an HTML document. Scripts can be placed in the body or in the head section of HTML, and/or in both. Often you will see scripts at the bottom of the body section of a web page. This can reduce display time. Sometimes you will see all JavaScript functions in the head section. Anyway, separating HTML and JavaScript, by putting all the code in one place, is always a good habit. It is a good idea to place scripts at the bottom of the body element. This improves page load, because HTML loading is not blocked by scripts loading. Note : You can place an external script reference in head or body as you like.The script will behave as if it was located exactly where you put the reference in the HTML document.

http://stackoverflow.com/comment/38700396
type: Comment
type: QuestionComment
has text: @alexeypalamar It is returning a number.
score: 0
comment on: http://stackoverflow.com/q/24909377

http://stackoverflow.com/q/24997234
tagged with: ember-data
has title: How to use Ember listView to lazy load filtered data?
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
favorite count: 0
tagged with: listview
type: Question
tagged with: ember.js
score: 1
upvote count: 1
has body: I recently found out about this: http://emberjs.com/list-view/ Which is pretty amazing - as long as it can load from the Data Store. I'm relatively new to Ember, but I am currently implementing a searchBar component, which will be fetching results from the data store depending on a searchKey. I set up a model to make things easier, as I will be pulling from several different tables. For simplicity's sake, let's assume I only have to pull data from Users and Locations. Now, the model i have set up is this: App.SearchResult = DS.Model.extend({ searchResultID: DS.attr('number'), entityID: DS.attr('number'), entityTypeID: DS.attr('number'), entityType: DS.attr('string'), resultText: DS.attr('string'), secondaryText: DS.attr('string'), }); On the server side, I have a if block that determines what data to send as what. For example, "SELECT userID as entityID,'user' as entityType, concat(firstName,' ', lastName) as resultText, email as secondaryText FROM users WHERE concat(firstName,' ', lastName) like ?" would be the SQL equivalent for users. Because I am essentially only getting searchResults, I don't want it to grab everything from the database (that matches the searchCriteria). Because we may have 100 John Smiths, I only want it to load the first ten Results on the first call. Then when the user scrolls through the div with the results and reaches the end, then it fetches and appends the next ten and so on. Think Facebook's friend search bar - the implementation front end is very similar. Posting that would make this a very long question. However, the example shows static data, and I have not found any guide or such to use this Component to fetch data from the store - a fixed number of results at a time. I wonder if anyone could give an example of this? I have read that listView can do this, but I have yet to see an example that features the data itself. To sum, How do I fetch data from the store, filtered by a parameter using Ember ListView How do I fetch this data t…

http://stackoverflow.com/comment/38786737
type: Comment
comment on: http://stackoverflow.com/a/24919694
has text: Thank you for helping me out Jayesh. I unfortunately did not see this comment until this morning. I found the answer to my problem on another forum and the code works great. Thanks for trying to help me out!
type: AnswerComment
score: 0

http://stackoverflow.com/a/25039990
score: 1
has body: function getListname(listId) { var query = 'SELECT name FROM Lists WHERE id=(?)'; var deferred = $q.defer(); transaction.executeSql(query, [listId], function (tx, results) { deferred.resolve(results.rows.item(0).name); } ); return deferred.promise; } Can use like this getListname(listId).then(function(name){ $scope.db.transaction = name; });
has comment: http://stackoverflow.com/comment/38945604
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25039308
answers question: http://stackoverflow.com/q/25039308

http://stackoverflow.com/a/25021858
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25001644
type: Answer
score: 1
upvote count: 1
has body: gui.add(params, 'text').name('Your Worker ID:').listen().onFinishChange(function (value) { if (confirm('Is" '+ value + ' "your worker id?') === true) { workerId = value; } else { params.text=""; } });
accepted answer of: http://stackoverflow.com/q/25001644

google-chrome
tags question: http://stackoverflow.com/q/24966176
tags question: http://stackoverflow.com/q/24932239
tags question: http://stackoverflow.com/q/24930054
tags question: http://stackoverflow.com/q/24913940
tags question: http://stackoverflow.com/q/25021015
tags question: http://stackoverflow.com/q/24937015
tags question: http://stackoverflow.com/q/25030355
tags question: http://stackoverflow.com/q/25035338
tags question: http://stackoverflow.com/q/25034150
tags question: http://stackoverflow.com/q/25068936
tags question: http://stackoverflow.com/q/25059586
tags question: http://stackoverflow.com/q/24990129
tags question: http://stackoverflow.com/q/25006396
tags question: http://stackoverflow.com/q/25003219
tags question: http://stackoverflow.com/q/24990017
tags question: http://stackoverflow.com/q/25036333
tags question: http://stackoverflow.com/q/24966759
tags question: http://stackoverflow.com/q/24930403
tags question: http://stackoverflow.com/q/25010619
tags question: http://stackoverflow.com/q/24963166
tags question: http://stackoverflow.com/q/24952848
tags question: http://stackoverflow.com/q/24930271
tags question: http://stackoverflow.com/q/24997992
tags question: http://stackoverflow.com/q/24992162
tags question: http://stackoverflow.com/q/24921768
tags question: http://stackoverflow.com/q/25020287
tags question: http://stackoverflow.com/q/24965610
tags question: http://stackoverflow.com/q/25059121
tags question: http://stackoverflow.com/q/24975256
tags question: http://stackoverflow.com/q/25066941
tags question: http://stackoverflow.com/q/25038705
tags question: http://stackoverflow.com/q/25050530
tags question: http://stackoverflow.com/q/24923773
tags question: http://stackoverflow.com/q/24939945
tags question: http://stackoverflow.com/q/24947993
tags question: http://stackoverflow.com/q/24980850
tags question: http://stackoverflow.com/q/24945060
tags question: http://stackoverflow.com/q/25064898
tags question: http://stackoverflow.com/q/25051321
tags question: http://stackoverflow.com/q/25021224
tags question: http://stackoverflow.com/q/24979262
tags question: http://stackoverflow.com/q/25010986
tags question: http://stackoverflow.com/q/25009508
tags question: http://stackoverflow.com/q/24984677
tags question: http://stackoverflow.com/q/24983029
tags question: http://stackoverflow.com/q/24945340
tags question: http://stackoverflow.com/q/24945216
tags question: http://stackoverflow.com/q/24921584
tags question: http://stackoverflow.com/q/24944635
tags question: http://stackoverflow.com/q/24918773
tags question: http://stackoverflow.com/q/24918491
tags question: http://stackoverflow.com/q/25023365
tags question: http://stackoverflow.com/q/24978473
tags question: http://stackoverflow.com/q/25040168
tags question: http://stackoverflow.com/q/25022327
tags question: http://stackoverflow.com/q/25064921
tags question: http://stackoverflow.com/q/25017580
tags question: http://stackoverflow.com/q/24912659
tags question: http://stackoverflow.com/q/24971526
tags question: http://stackoverflow.com/q/24997102
tags question: http://stackoverflow.com/q/25025433
tags question: http://stackoverflow.com/q/25045917
tags question: http://stackoverflow.com/q/24968085
tags question: http://stackoverflow.com/q/24957437
tags question: http://stackoverflow.com/q/25043515
type: Tag
tags question: http://stackoverflow.com/q/25052396
tags question: http://stackoverflow.com/q/25032058
tags question: http://stackoverflow.com/q/24970772
tags question: http://stackoverflow.com/q/24990128
tags question: http://stackoverflow.com/q/24933680
tags question: http://stackoverflow.com/q/24974491
tags question: http://stackoverflow.com/q/24974262
tags question: http://stackoverflow.com/q/25059601
tags question: http://stackoverflow.com/q/24986049
tag name: google-chrome
tags question: http://stackoverflow.com/q/25005279
tags question: http://stackoverflow.com/q/24956424
tags question: http://stackoverflow.com/q/25005126
tags question: http://stackoverflow.com/q/25069040

http://stackoverflow.com/a/25002480
upvote count: 6
answers question: http://stackoverflow.com/q/25001216
has body: Using touch-events itself is pretty straightforward. However, recognizing gestures will require custom code. Simple example of adding touch events to the window: window.addEventListener("touchstart", touchStart, false) window.addEventListener("touchmove", touchMove, false) window.addEventListener("touchend", touchEnd, false) window.addEventListener("touchcancel", touchCancel, false) window.addEventListener("touchleave", touchLeave, false) // these functions will run when the events are triggered: function touchStart(e) { var x = e.touches[0].pageX var y = e.touches[0].pageY // do more stuff... } function touchEnd(e) { // ... } // etc. ... Recognizing a very simple horizontal swipe might like look something like this: // (don't forget the event listeners) var xStart, yStart function touchStart(e) { xStart = e.touches[0].pageX yStart = e.touches[0].pageY } function touchEnd(e) { var xEnd = e.touches[0].pageX, yEnd = e.touches[0].pageY // store the pageX and pageY in variables for readability if(Math.abs(yStart - yEnd) &lt; 100) // if there was not a lot of vertical movement { if(xEnd - xStart &gt; 200) // at least 200 pixels horizontal swipe (to the right) { swipeLeftToRight() // swipe recognized } else if(xEnd - xStart &lt; -200) // at least -200 pixels of horizontal swipe (to the left) { swipeRightToLeft() // swipe recognized } } } function swipeLeftToRight() { alert("You swiped from the left to the right!") } function swipeRightToLeft() { alert("You swiped from the right to the left!") } Keep in mind that this very simple example does NOT take into account what the user's finger did in between the starting point and the end point. So in this case the functions would be triggered wether the used drew a straight line across, or drew a half circle for example. Any more complex or more accurate gesture recognitions should keep track of the finger during the whole drag (touchmove).
type: Answer
score: 6
has comment: http://stackoverflow.com/comment/38875323
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25001216
type: AcceptedAnswer

date
tags question: http://stackoverflow.com/q/25032333
tags question: http://stackoverflow.com/q/24980827
tags question: http://stackoverflow.com/q/25027222
tag name: date
tags question: http://stackoverflow.com/q/25046337
tags question: http://stackoverflow.com/q/24939436
tags question: http://stackoverflow.com/q/24965776
tags question: http://stackoverflow.com/q/25041384
tags question: http://stackoverflow.com/q/25031365
tags question: http://stackoverflow.com/q/24956486
tags question: http://stackoverflow.com/q/24946413
tags question: http://stackoverflow.com/q/25004723
tags question: http://stackoverflow.com/q/24968384
tags question: http://stackoverflow.com/q/24952677
type: Tag
tags question: http://stackoverflow.com/q/25015524
tags question: http://stackoverflow.com/q/25027813
tags question: http://stackoverflow.com/q/25060186
tags question: http://stackoverflow.com/q/24989984
tags question: http://stackoverflow.com/q/25012920
tags question: http://stackoverflow.com/q/24996205
tags question: http://stackoverflow.com/q/25006781
tags question: http://stackoverflow.com/q/24993037
tags question: http://stackoverflow.com/q/25001451
tags question: http://stackoverflow.com/q/24984889
tags question: http://stackoverflow.com/q/25023793

http://stackoverflow.com/comment/38987407
comment on: http://stackoverflow.com/a/25061872
score: 0
type: AnswerComment
type: Comment
has text: You had `disable` which isn't a command - and you were quoting your booleans which converted them to strings.

http://stackoverflow.com/comment/38877729
type: Comment
type: QuestionComment
has text: Well now that I see it working on that page, I am completely lost as to why it doesn't work. If I switch around the two `$.plot()` calls, then it says `x vote/votes` for both of them.
comment on: http://stackoverflow.com/q/25002733
score: 0

http://stackoverflow.com/q/25018013
has title: Getting img element from html string
score: 0
has comment: http://stackoverflow.com/comment/38904788
answer count: 2
has comment: http://stackoverflow.com/comment/38904475
has answer: http://stackoverflow.com/a/25018082
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25018077
has body: I have the following html string: Is there a way to get only the img element? So in this case I want a string like this . More specific example: $wikiDOM = $(" "+ wikiHTML+ " "); var infobox = $wikiDOM.find('.infobox').html(); if(infobox != 'undefined' && infobox !== ""){ var img = infobox.filter( 'img' ); console.log( img[0].outerHTML ); } where wikiHTML is the request i make to wikipedia api in json format for several searchterms. Edit: return from img and infobox: image:[object Object] infobox[object Object] image:[object Object] infobox[object Object] image:[object Object] infobox[object Object] image:[object Object] infobox[object Object] image:[object Object] infobox[object Object] image:[object Object] infobox[object Object] image:[object Object] infobox[object Object] image:[object Object] infobox[object Object]
has answer: http://stackoverflow.com/a/25018077
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25018082
tagged with: html-parsing
type: Question

http://stackoverflow.com/a/24950300
score: 0
has body: DEMO JS code: $(function () { var days_difference = 365; function addDays(theDate, days) { return new Date(theDate.getTime() + days*24*60*60*1000); } function subtractDays(theDate, days) { return new Date(theDate.getTime() - days*24*60*60*1000); } function parseDate(str) { var mdy = str.split('/') return new Date(mdy[2], mdy[0]-1, mdy[1]); } function generate_difference() { var from_date = $("#from").datepicker( "getDate" ); var to_date = $("#to").datepicker( "getDate" ); //alert("In generate_difference \n From date = "+from_date+" \n To date = "+to_date); if(from_date != null &amp;&amp; to_date != null) { var diff_days = (to_date-from_date)/(1000*60*60*24); $('#diff_days').val(diff_days); } } $("#from").datepicker({ //defaultDate: "+1w", changeMonth: true, //numberOfMonths: 3, onClose: function (selectedDate) { //The selectedDate is in format mm/dd/yyyy so it should be convert to a valid javascript date selectedDate = parseDate(selectedDate); //alert("selectedDate = "+selectedDate+" parsed date = "+parseDate(selectedDate)+" new parsed = "+Date.parse(selectedDate)); //Generate a new date by adding "no. of days i.e 365" to selected date var new_date = addDays(selectedDate, days_difference); //alert("selectedDate = "+selectedDate+" new_date = "+new_date); $("#to").datepicker("option", "minDate", selectedDate); $("#to").datepicker("option", "maxDate", new_date); generate_difference(); } }); $("#to").datepicker({ //defaultDate: "+1w", changeMonth: true, //numberOfMonths: 3, onClose: function (selectedDate) { selectedDate = parseDate(selectedDate); var new_date = subtractDays(selectedDate, days_difference) //alert("selectedDate = "+selectedDate+" new_date = "+new_date); $("#from").datepicker("option", "minDate", new_date); $("#from").datepicker("option", "maxDate", selectedDate); generate_difference(); } }); });
type: Answer
answers question: http://stackoverflow.com/q/24946413

http://stackoverflow.com/q/25037780
score: 0
has title: How to retrospectively attach a / one fully defined but autonomous GUI element to another (DOM-attached) element
has body: I've been trying, step by step, to convert some very nice but static &amp; non-d3 chordname-to-waveform code for dynamic animation in a d3.js visualisation. I've now reached a point where I have (in particular) two fully defined GUI elements, the first of which (plot) is already attached to the DOM: var plot = plotframe .append("svg") .attr("whatever", .... .. and the second (path, defined but as yet DOM-unattached) created using the following curious syntax: var path = d3.select(document.createElementNS(d3.ns.prefix.svg, "svg:path")) .attr("id", "path") .attr("whatever", .... Prior to my changes (these elements becoming the subject of d3 selections), the raw elements were hooked up using: plot.appendChild(path); However, as path is subject to some cute wave-building algorithms which it would be a shame to disturb, how could I do a purely retrospective attach of (the now both d3 selections) path to plot? Something similar to appendChild, but d3-friendly.. Does d3.js cater for this at all? I'm aware this resembles an earlier question, but the answer provided there is clearly not what I'm looking for. Thanks Thug
answer count: 1
tagged with: appendchild
has answer: http://stackoverflow.com/a/25041208
type: AnsweredQuestion
tagged with: javascript
linked to: http://stackoverflow.com/q/18455282
linked to: http://stackoverflow.com/q/13869414
type: Question
accepted answer: http://stackoverflow.com/a/25041208
has comment: http://stackoverflow.com/comment/38941588
tagged with: http://stackoverflow.com/tag/svg
tagged with: d3.js

http://stackoverflow.com/comment/38793876
has text: Are you just opening maps by id until you find one that has data?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24958553
score: 0

http://stackoverflow.com/a/24914025
has comment: http://stackoverflow.com/comment/38709457
has body: You'll need an event handler for that jQuery(function($) { $('#cbCheckedStatus7').on('change', function() { $('#spBlueCheckbox').toggle(this.checked); }); }); And where did you find that DOM ready handler?
has comment: http://stackoverflow.com/comment/38708958
type: Answer
has comment: http://stackoverflow.com/comment/38709249
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24913996
accepted answer of: http://stackoverflow.com/q/24913996
has comment: http://stackoverflow.com/comment/38710479
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24939363
has body: On page i have two with same options. If a select option it should be disabled in each select. Here is my demo: http://jsfiddle.net/bfmKw/8/ $("select").off('change').on('change', function () { disableOptions(); }); function disableOptions() { var $dropdowns = $('select'); $dropdowns.find('option').attr('disabled', false); $.each($dropdowns, function (i, dropdown) { var mark = $(dropdown).find('option:selected').attr('mark'); if (mark) { $dropdowns.find('option[mark="' + mark + '"]:not(:selected)').attr('disabled', true); } }); } But in firefox exist bug or feature. Steps for reproduction: 1) Open select box and choose option. Change event will rise and options will be disabled. 2) Open same select box, hover mouse on another option and click twice on diferent from select box place. Change event will be rised too. If instead disabled set any another attribute all works fine. May be exist another way how can i disable options?
has answer: http://stackoverflow.com/a/24950899
type: Question
score: -2
has comment: http://stackoverflow.com/comment/38757380
has comment: http://stackoverflow.com/comment/38756537
has title: Bug in firefox with setting disabled attribute to select after change event
downvote count: 2
tagged with: firefox
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
upvote count: 0

http://stackoverflow.com/comment/38838238
has text: @jfriend00: It seems to be there for getting only. However, I'd recommend to use a [setter and getter property](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) instead, and never use an extra `setX` method without a respective `getX` method
comment on: http://stackoverflow.com/a/24982614
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38949460
score: 1
comment on: http://stackoverflow.com/q/25042036
type: Comment
type: QuestionComment
has text: You can't explain how people vote. That aside, this question should be closed as off-topic, due to a typo.

http://stackoverflow.com/a/25037345
accepted answer of: http://stackoverflow.com/q/25037291
answers question: http://stackoverflow.com/q/25037291
type: AcceptedAnswer
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38940319
has comment: http://stackoverflow.com/comment/38941763
has body: disabled is a property, not a class. Use ng-disabled:

http://stackoverflow.com/comment/38843966
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/24965702
type: Comment
has text: load() only works from the rhino shell, not when you're running in embedded mode.

http://stackoverflow.com/comment/38702164
score: 0
type: AnswerComment
type: Comment
has text: @savantKing you welcome dude. I suppose you tested it and it was that you wanted. Correct?
comment on: http://stackoverflow.com/a/24910756

http://stackoverflow.com/q/24991714
tagged with: adobe
has body: I've found plenty of scripts where I can define resolution, but is possible to export the first page of an indesign document with a specified height (in this case 20mm at 300dpi). I have several thousand documents to do and need a script! Thanks
has answer: http://stackoverflow.com/a/25018387
has title: Define height in mm of a jpeg being exported from indesign
score: 0
tagged with: adobe-indesign
tagged with: javascript
type: UnansweredQuestion
tagged with: export
type: Question
answer count: 1
tagged with: http://stackoverflow.com/tag/jpeg

http://stackoverflow.com/comment/38776808
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24916887
type: Comment
has text: i have tried the same fiddle in ie10 and found its not working but found one function to get proper height and width : h = viewport.getBoundingClientRect().height..etc

http://stackoverflow.com/comment/38784276
has text: yeah then those are delegated events , you need to bind the event handler and event to a element which will be available in your page on DOM load, like `document` which `Rory` has suggested.
comment on: http://stackoverflow.com/q/24953504
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38767659
type: QuestionComment
score: 0
has text: Just to clarify, the main purpose would be to select the first instance of since this is the parent div of all the contents, and duplicate it. Also, adding a static prefix (i.e. "minimenu") to the input ID's and label FORs.
comment on: http://stackoverflow.com/q/24944694
type: Comment

http://stackoverflow.com/comment/89905235
type: Comment
comment on: http://stackoverflow.com/q/24958865
type: QuestionComment
has text: surprisingly, it worked for me on IE11 after adding the Nicescroll jQuery plugin (https://nicescroll.areaaperta.com) to my page.
score: 0

http://stackoverflow.com/comment/38704633
score: 1
type: Comment
type: QuestionComment
has text: Your `_self` is [implicitly global](http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html)!
comment on: http://stackoverflow.com/q/24911982

http://stackoverflow.com/q/24966821
type: Question
tagged with: charts
tagged with: javascript
tagged with: linechart
linked to: http://stackoverflow.com/q/14777518
upvote count: 1
answer count: 1
favorite count: 0
has title: d3js multi-line chart with focus+context zoom
tagged with: d3.js
has body: I am working on a multi-series line chart using d3.js and I am attempting to implement the focus and context zoom as seen in this example. I have converted the area chart in the example to a line chart with a single series but I cannot figure out how to extend it to allow multiple series. Here is the code I am using: var margin = {top: 10, right: 10, bottom: 100, left: 40}, margin2 = {top: 430, right: 10, bottom: 20, left: 40}, width = 960 - margin.left - margin.right, height = 500 - margin.top - margin.bottom, height2 = 500 - margin2.top - margin2.bottom; var parseDate = d3.time.format("%b %Y").parse; var x = d3.time.scale().range([0, width]), x2 = d3.time.scale().range([0, width]), y = d3.scale.linear().range([height, 0]), y2 = d3.scale.linear().range([height2, 0]); var xAxis = d3.svg.axis().scale(x).orient("bottom"), xAxis2 = d3.svg.axis().scale(x2).orient("bottom"), yAxis = d3.svg.axis().scale(y).orient("left"); var brush = d3.svg.brush() .x(x2) .on("brush", brushed); var line = d3.svg.line() .interpolate("monotone") .x(function(d) { return x(d.date); }) .y(function(d) { return y(d.price); }); // single series? var line2 = d3.svg.line() .interpolate("monotone") .x(function(d) { return x2(d.date); }) .y(function(d) { return y2(d.price); }); var svg = d3.select("body").append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom); svg.append("defs").append("clipPath") .attr("id", "clip") .append("rect") .attr("width", width) .attr("height", height); var focus = svg.append("g") .attr("class", "focus") .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); var context = svg.append("g") .attr("class", "context") .attr("transform", "translate(" + margin2.left + "," + margin2.top + ")"); d3.csv("trends.csv", type, function(error, data) { x.domain(d3.extent(data.map(function(d) { return d.date; }))); y.domain([0, d3.max(data.map(function(d) { return d.price; }))]); x2.domain(x.domain()); y2.domain…
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38814219
score: 1
has answer: http://stackoverflow.com/a/24977000
accepted answer: http://stackoverflow.com/a/24977000

http://stackoverflow.com/q/25037819
has comment: http://stackoverflow.com/comment/38978433
tagged with: .net
tagged with: javascript
type: UnansweredQuestion
has body: I have a website which I need to login to automatically. I am trying to use Watin .NET library in order to do that. When I fill out the user name and password fields using Watin, the sumbit button remains disabled. I tried applying many events on the other fields (KeyPress, KeyDown, KeyUp, Tab, Enter...) Nothing worked. Pardon me for finding the button by value, but this is the only way that I found that worked. var field = ie.TextField(Find.ByName("userName")); field.TypeText("username"); field.KeyDown(); field.KeyUp(); field = ie.TextField(Find.ByName("password")); field.TypeText("pwd"); field.KeyDown(); field.KeyUp(); ie.Button(Find.ByValue("התחבר")).Click(); I am getting an exception that the button is disabled. The page which I need to login to is: https://portal.dorad.co.il/#/Login All that I want is to find an automatic way to make the sumbit button enabled so that I can login. Login Form Code: Login User Name Mandatory Field Password Mandatory Field
has answer: http://stackoverflow.com/a/29001662
has comment: http://stackoverflow.com/comment/38978673
has title: Watin - Submit button remain disabled after filling form
score: 2
downvote count: 0
tagged with: web
favorite count: 0
has comment: http://stackoverflow.com/comment/38980924
tagged with: watin
type: Question
upvote count: 2
answer count: 2
has answer: http://stackoverflow.com/a/25060910
has comment: http://stackoverflow.com/comment/38971178
has comment: http://stackoverflow.com/comment/38984235

http://stackoverflow.com/comment/38938072
comment on: http://stackoverflow.com/q/25035935
has text: If repetative data is there use jquery template
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38813453
has text: Are the divs with fixed width?
score: 0
comment on: http://stackoverflow.com/q/24969840
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38719537
has text: I know that a control inside a page gives the textbox and other elements a different Id that the one I entered. but but this purpose on the code i have the correct id's but since they are too long i'm using in here the id's i gave them.
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24919397

http://stackoverflow.com/comment/38722977
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24921403
has text: Remove the `onmousemove` handlers?
type: Comment

http://stackoverflow.com/a/24919541
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24919275
has body: I think you're calling a function incorrectly attempts thus hope you work function sleepCheck(numHours) { if (numHours &gt;= 8) { return "You're getting ....."; } else { return "Get some more ....."; } } console.log(sleepCheck(8));....

http://stackoverflow.com/a/71793982
type: Answer
score: 2
upvote count: 2
has body: Moving all items equal so something to the end can also be done by concat. const myArray = [1, 0, 3, 5, 0, 'a', 3, 's'] const moveZerosToEnd = (arr) =&gt; { return arr.filter(item =&gt; item !== 0).concat(arr.filter(item =&gt; item === 0)) } console.log(myArray) // [1, 0, 3, 5, 0, 'a', 3, 's'] console.log(moveZerosToEnd(myArray)) // [1, 3, 5, 'a', 3, 's', 0, 0]
downvote count: 0
answers question: http://stackoverflow.com/q/24909371

http://stackoverflow.com/a/24951007
has comment: http://stackoverflow.com/comment/38793805
has body: Why not run the Yeoman-Heroku generator over your existing app? Should take you a long step towards successful deployment. Either way, this is pretty well documented for yo angular: Deploy Yeoman App on Heroku Deploying a Yeoman/Angular app to Heroku Deploying a Yeoman + Angular app to Heroku Deploying a Yeoman webapp to Heroku+Node.js Easily deploy a build to Heroku with Grunt
score: 0
answers question: http://stackoverflow.com/q/24945704
type: Answer

http://stackoverflow.com/q/25031076
has answer: http://stackoverflow.com/a/25031439
accepted answer: http://stackoverflow.com/a/25031439
upvote count: 3
answer count: 2
possible better answer: http://stackoverflow.com/a/25031406
downvote count: 1
tagged with: jsp
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25031406
score: 2
type: AnsweredQuestion
has body: On my jsp, this is my code : $('.save').on("click",function(){ var array = $.map($('table tr'), function (val, i) { var obj = {}, inputs = $(val).find('td input:not(:hidden)'); obj[inputs.filter(':first').val()] = $.map(inputs.not(':first'), function (val, i) { return val.value; }); return obj; }); var data = JSON.stringify(array); $.post("Controller.html", data, function(response) { /// i dont know what to put here,so i think this where i get trouble with }); }); but still data is null when i check on servlet. this is my servlet : protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String data=request.getParameter("data"); if (data== null) { System.out.println("null"); } RequestDispatcher view = request.getRequestDispatcher("/page.jsp"); view.forward(request, response); } fiddle here
type: Question
has title: how can pass array to java servlet
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
tagged with: servlets

http://stackoverflow.com/q/24965721
has title: JQuery Sign in Sign out if statement code not working properly
tagged with: if-statement
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/30688505
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
has body: The snippet code for a custom "sign in" and "sign out" toggle link works on old non responsive templates, but it behaves badly when on responsive template. when it writes the html line, it actually replaces everything in the with the referenced in the code. Here is the original custom code snippet used by many online for bigcommerce (non responsive theme): I'm not sure why it would replace everything inside the with this.... "document.writeln...." So that all you get is the actual link on the page, that's it. Here is what I've tried to implement, and it works with only "one caveat": It doesn't change the "logout" link, until you either refresh the page, or go to another page. The variable %%GLOBAL_CurrentCustomerFirstName%% does change, but the jquery doesn't load the new link in the "else" statement. Here is the code I have gotten to work except for this problem stated above (it is not inside the like the first, instead it is just on its own on the page): I would appreciate any insight. I have tried implementing $( document ).ready(function(), and even tried: $(".login_link").hide(); $(".logoutContainer").html(logoutString); putting it inside a CDATA inside the doesn't help either. but I'm coming up with a loss on how to make the final "logout" / "signout" link to show, without having to do a manual reload of the page. Thanks for any insight!
has comment: http://stackoverflow.com/comment/38838039
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/30688505
has comment: http://stackoverflow.com/comment/38838035
has comment: http://stackoverflow.com/comment/38809458
type: Question

http://stackoverflow.com/comment/38853967
has text: @speak Could you provide me a JSFiddle and post it as an answer so if that works I can close this and mark as answered! Thanks already!
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24991108
score: 0

http://stackoverflow.com/q/24994916
has comment: http://stackoverflow.com/comment/38865908
linked to: http://stackoverflow.com/q/25013735
tagged with: socket.io
type: Question
has title: Socket.io 1.x + Express (using http): How to send messages to specific client id?
tagged with: javascript
tagged with: express
has comment: http://stackoverflow.com/comment/38863728
score: 0
accepted answer: http://stackoverflow.com/a/24997989
answer count: 1
has comment: http://stackoverflow.com/comment/38862167
has comment: http://stackoverflow.com/comment/38865643
has body: I'm new to socket.io, and I'm doing a simple API with NodeJS (express 4). I'm developing an action that is similar to the old "poke" action at facebook. A user send a poke to other user, and this one gets a notification on real time (this is the reason why I am using socket.io). This is the code: app.js var port = 3000; var app = module.exports = express(); var server = require('http').Server(app); ... server.listen(port); require('./config/socket-io')(app, server, secret); socket-io.js module.exports = function(app, server, secret) { var clients = {}; console.log("initiating sockets..."); var sio = require('socket.io').listen(server, {'log level': 2}); sio.on('connection', function (socket) { console.log("...new connection: "+socket.client.id); clients[socket.id] = socket; socket.emit('identification', { data : socket.client.id }); socket.on('newShoutOut', function(data) { var receptor = data.idTo; var emiter = socket.client.id; console.log("...new shout out from " +emiter+ " to "+receptor); sio.sockets.sockets[receptor].emit({ data : data.data, from : emiter }); }); socket.on('disconnect', function() { console.log("..."+socket.client.id + " disconnected"); }); }); }; Here you can differentiate three states: Connection: The server detects all the clients connection to the host:port. After that, the server sends to each client his ID. This works fine. Send message: One client sends a notification to other client. For now, the server receives the notification from one client, but the "receiver" doesn't receive anything. Disconnection: Doesn't matter in this case. My question is, what is the way to send a message to a client directly knowing the ID? What I am doing wrong? I tried so many options to send a message directly to a specific client ID but didn't work... EDIT Frontend var socket = io('http://localhost:3000'); var id = ""; socket.on('connection', function (data) { console.log("connected!"); console.log(data); }); socket.on('identification', function(data) { i…
tagged with: node.js
linked to: http://stackoverflow.com/q/4647348
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24997989

http://stackoverflow.com/a/24946142
answers question: http://stackoverflow.com/q/24946112
accepted answer of: http://stackoverflow.com/q/24946112
upvote count: 53
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/105645869
downvote count: 0
has body: Use map instead of forEach and drop the parenthesis and the curly braces in the lambda: var userNames = objectArr.map(o =&gt; o.userName).join(', ');
type: Answer
has comment: http://stackoverflow.com/comment/101269685
has comment: http://stackoverflow.com/comment/101270249
score: 53

http://stackoverflow.com/comment/38738589
has text: Uh... `var b = func;`?
comment on: http://stackoverflow.com/q/24930094
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38893727
comment on: http://stackoverflow.com/a/25012313
score: 0
type: AnswerComment
has text: Depending on what you want to do if the ajax call fails, it might be better to use the .always callback.
type: Comment

asynchronous
tags question: http://stackoverflow.com/q/25064094
tags question: http://stackoverflow.com/q/25050502
tags question: http://stackoverflow.com/q/24977141
tags question: http://stackoverflow.com/q/24958776
tags question: http://stackoverflow.com/q/24946840
tags question: http://stackoverflow.com/q/24925835
tags question: http://stackoverflow.com/q/25025035
tags question: http://stackoverflow.com/q/24937693
tags question: http://stackoverflow.com/q/25005168
tags question: http://stackoverflow.com/q/24952939
tags question: http://stackoverflow.com/q/24910509
tags question: http://stackoverflow.com/q/25009456
tags question: http://stackoverflow.com/q/24924038
tags question: http://stackoverflow.com/q/24944787
tags question: http://stackoverflow.com/q/25018293
tags question: http://stackoverflow.com/q/24953431
type: Tag
tags question: http://stackoverflow.com/q/24959995
tags question: http://stackoverflow.com/q/24954797
tag name: asynchronous
tags question: http://stackoverflow.com/q/24944858
tags question: http://stackoverflow.com/q/24959364
tags question: http://stackoverflow.com/q/24984299
tags question: http://stackoverflow.com/q/25003225
tags question: http://stackoverflow.com/q/24935505
tags question: http://stackoverflow.com/q/24944644
tags question: http://stackoverflow.com/q/24909230
tags question: http://stackoverflow.com/q/24958628
tags question: http://stackoverflow.com/q/24946479
tags question: http://stackoverflow.com/q/25067364
tags question: http://stackoverflow.com/q/24980991
tags question: http://stackoverflow.com/q/25001898
tags question: http://stackoverflow.com/q/24982701
tags question: http://stackoverflow.com/q/24985933
tags question: http://stackoverflow.com/q/25017055
tags question: http://stackoverflow.com/q/24993989
tags question: http://stackoverflow.com/q/24984618
tags question: http://stackoverflow.com/q/25043067
tags question: http://stackoverflow.com/q/24975530
tags question: http://stackoverflow.com/q/24934343
tags question: http://stackoverflow.com/q/25001841

http://stackoverflow.com/a/25036862
score: 0
has body: Try the below code Math.floor(Math.random() * 10) + 1 Also you can refer and use the following code based on your need function randomNumberInterval(min,max) { return Math.floor(Math.random() * (max - min + 1) + min); }
type: Answer
answers question: http://stackoverflow.com/q/25036787

http://stackoverflow.com/a/24926714
score: 0
has body: You can make use of the onclick event of javascript: Hello world In javascript then you can handle it like this: function navigateToLink(elt){ console.log("https://www.google.com/?q="+elt.textContent ); window.location.href="https://www.google.com/?q="+ elt.textContent; } Working Fiddle
answers question: http://stackoverflow.com/q/24926508
type: Answer

http://stackoverflow.com/comment/38876915
type: AnswerComment
has text: Yes - more research needs to be done regarding what the op wants as a number
type: Comment
comment on: http://stackoverflow.com/a/25003518
score: 0

http://stackoverflow.com/comment/38757112
type: QuestionComment
has text: Thanks Andy. I'm on it.
comment on: http://stackoverflow.com/q/24939347
score: 0
type: Comment

http://stackoverflow.com/q/25042946
tagged with: css
has body: I have multiple classes apply to an element. Is it possible to change only 1 class, not the all of the classes? For example, As you can see, I have to duplicate result class in both of the conditions. Is there a way to not have to repeat it? Thanks!
accepted answer: http://stackoverflow.com/a/25043072
tagged with: ng-class
type: Question
type: AnsweredQuestion
has title: Change part of the CSS class using ngClass
answer count: 1
tagged with: javascript
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25043072

http://stackoverflow.com/a/25011928
type: Answer
has comment: http://stackoverflow.com/comment/38921216
score: 0
has comment: http://stackoverflow.com/comment/38921858
answers question: http://stackoverflow.com/q/25006762
has body: You have to use random as a selector, not as an option in the query, eg: MiniSudoku.find({random: {$gte: Math.random()}}, {limit: 1}); Extra tips: You could also rewrite this to MiniSudoku.findOne({random: {$gte: Math.random()}}); You shouldn't use var keyword when you assign a value second time. You should assign Math.random() value to a variable, because in a corner case you can also get nothing from the second query :) Selecting random document from Mongo can be tricky, as they don't support this out of the box like other databases do. You can vote for it at https://jira.mongodb.org/browse/SERVER-533

http://stackoverflow.com/comment/38702907
type: QuestionComment
has text: possible duplicate of [loading multiple javascript files - jquery](http://stackoverflow.com/questions/9405979/loading-multiple-javascript-files-jquery)
comment on: http://stackoverflow.com/q/24911155
score: 0
type: Comment

http://stackoverflow.com/comment/38950155
comment on: http://stackoverflow.com/a/25025915
score: 0
type: AnswerComment
type: Comment
has text: ok I think I am starting to get it. I have updated the question's code. One question: would I use formData.stickie or just stickie in the app.post function in the server file? Currently both are returned as undefined, though I did pass $scope.formData into the $http call in the controller.

http://stackoverflow.com/comment/38874486
has text: It doesn't appear that WebWorkers allow you to operate on the DOM. You can run background processes that perform calculations and other useful things; but, I don't think the DOM can be operated on by concurrent threads.
score: 0
comment on: http://stackoverflow.com/a/24945040
type: Comment
type: AnswerComment

http://stackoverflow.com/q/25065035
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/38992901
has comment: http://stackoverflow.com/comment/38993137
has answer: http://stackoverflow.com/a/70149997
type: Question
has body: I am working on creating lightbox-like functionality from scratch. So far I have the takeover element working and properly displaying an image, but now I would like to code next/previous buttons. I would also like the buttons to cycle through the gallery(if "previous" is clicked on the first image, it loads the last image and vice versa). Here is the HTML that displays my image thumbnails: When an image thumbnail is clicked, the lightbox is generated and shown via Javascript: $(document).ready(function() { $('.image').click(function(e) { e.preventDefault(); $('body').width($('body').width()); $('body').css('overflow', 'hidden'); var image_href = $(this).attr("href"); if ($('#lightbox').length > 0) { $('#content').html(' '); $('#lightbox').show(); } else { var lightbox = ' ' + ' ' + ' CloseX '+ ' '+ ' ' + ' '+ ' ' + ' '; $('body').append(lightbox); } }); $('body').on('click', '.close-gallery', function () { $('body').removeAttr('style'); $('#lightbox').remove(); }); }); This is what I've tried so far. It only works for the sibling immediately before or immediately after the currently selected image: $(document).ready(function($) { $('.image').click(function(e) { $(this).addClass('active'); e.preventDefault(); $('body').width($('body').width()); $('body').css('overflow', 'hidden'); var image_href = $(this).attr("href"); var prevImage = $('.active').parent().prev().find('a').attr("href"); var nextImage = $('.active').parent().next().find('a').attr("href"); console.log(prevImage, nextImage); if ($('#lightbox').length > 0) { $('#content').html(' '); $('#lightbox').show(); } else { var lightbox = ' ' + ' ' + ' CloseX '+ ' '+ ' ' + ' '+ ' ' + ' '; $('body').append(lightbox); } }); $('body').on('click', '.gallery-previous', function () { var prev = $(this).data('nav'); console.log(prev); $('#content').find('img').attr('src',prev); }); $('body').on('click', '.gallery-next', function () { var next = $(this).data('nav'); console.log(next); $('#content').find('img').attr('src',…
has title: How to code next/previous buttons for a custom "lightbox"
tagged with: javascript
tagged with: jquery
tagged with: image
answer count: 1
favorite count: 0
type: UnansweredQuestion
downvote count: 1

http://stackoverflow.com/q/25033294
has comment: http://stackoverflow.com/comment/38933610
tagged with: parsing
has body: I am working on a script to get and change the content of an IFrame, by accessing a variable and a function defined in it, through a button and a Javascript script created in another IFrame. The script works fine, but what I would like to do is instead of text been injected in the IFRAME 1 I would like to inject a script, something like: I have tried with injecting IMG and also works: .... but I would like to be able to inject a js file something like: <button onclick="f_ifr2(' IFRAME 1 Content in BODY Div content of the iframe 1 Code ifr2.htm Page for IFrame 2 IFRAME 2 Action iframe Code main.html Main Page Main Page First iframe Second iframe
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38935103
tagged with: iframe
has comment: http://stackoverflow.com/comment/38935282
type: Question
tagged with: inject
has comment: http://stackoverflow.com/comment/38935006
tagged with: javascript
score: 0
has title: Change to content of IFRAME. Inject script into IFRAME from another IFRAME

http://stackoverflow.com/q/24994729
type: AnsweredQuestion
has title: Replacing some characters from string using javascript
score: -4
type: Question
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/44391407
possible better answer: http://stackoverflow.com/a/28001454
has answer: http://stackoverflow.com/a/28001454
downvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/44391824
has answer: http://stackoverflow.com/a/28001204
favorite count: 0
has body: Hi i have a simple javascript variable: var a=["varun"]; i want to remove characters[]" from string, so that resultant string is varun i have used following code to achieve it a = a.replace(/[]"/g, ''); but its not working for me. Can anyone suggest me better way to do it.
accepted answer: http://stackoverflow.com/a/28001204
tagged with: regex

http://stackoverflow.com/q/25035891
score: -1
type: Question
has title: What is templates/system directory in Joomla 1.5?
answer count: 1
downvote count: 1
tagged with: javascript
tagged with: joomla1.5
favorite count: 0
has answer: http://stackoverflow.com/a/25078774
upvote count: 0
type: UnansweredQuestion
has body: What is templates/system directory in Joomla 1.5? Is it system template or common directory for all templates? May I put some javascript widgets there?

http://stackoverflow.com/a/24980527
score: 0
type: Answer
has body: For the first problem, it opens a new tab because you have target="no-show" on your form. For the second problem, if you want to use Ajax, I recommend you use jQuery, it will simplify a lot of the code. But the best option is probably that you completely remove the direct link to click2sell, and just add a submit button to your form. Post the form to your site, which will store whatever info it needs, assigns an ID, and builds the click2sell URL with the ID in one of the parameters, and redirect to it. Now how you would do that depends on what server-side language you use.
answers question: http://stackoverflow.com/q/24980445

http://stackoverflow.com/comment/38908497
score: 0
comment on: http://stackoverflow.com/q/25020086
has text: You shouldn't need to handle/change the injection. Create one factory that is always injected wherever needed. Inside the factory, you can either have the individual methods (like `getOrders`) or the entire object `return`ed, use logic to use the correct methods (local storage vs. web service).
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/73245531
type: Comment
has text: This should be the answer. Julian is the real MVP.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/35564886

http://stackoverflow.com/q/24972908
has comment: http://stackoverflow.com/comment/38822519
has answer: http://stackoverflow.com/a/24974494
possible better answer: http://stackoverflow.com/a/24973272
has title: Classes in CoffeeScript
type: AnsweredQuestion
score: 1
upvote count: 1
tagged with: coffeescript
type: Question
accepted answer: http://stackoverflow.com/a/24974494
tagged with: javascript
has body: There is the following class in CoffeScript: class MyClass f: (@x) -&gt; Translating this code in JS we have: (function() { var MyClass; MyClass = (function() { function MyClass() {} MyClass.prototype.f = function(x) { this.x = x; }; return MyClass; })(); }).call(this); I don't understand why in order to add function to MyClass I should use prototype for it; why I can't use 'MyClass.f = function(x) ... " ? Please, explain it to me. Thanks.
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24973272
favorite count: 0

http://stackoverflow.com/a/25017944
has comment: http://stackoverflow.com/comment/38908692
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38908357
upvote count: 2
type: Answer
has body: localfeeds/show.js.erb // Append new data $('#infinite_table').append(... but in your HTML you have: &lt;div id="infinite-table" .... The first uses _, the second - EDIT: From your comments it looks like the error is in your scroll detection code. Try this, and look at the console output for clues: jQuery -&gt; console.log("Creating pagination callback") if $('.pagination').length console.log("Pagination detected") $(window).scroll -&gt; console.log("Scroll detected") url = $('.pagination .next a').attr('href') if url &amp;&amp; $(window).scrollTop() &gt; $(document).height() - $(window).height() - 50 console.log("Url found: " + url) $('.pagination').text('Fetching more products...') $.getScript(url) console.log("Script loaded") $(window).scroll() Which, if any, of the console log statements lead to entries in the console log? What happens when you scroll the page?
has comment: http://stackoverflow.com/comment/38929613
has comment: http://stackoverflow.com/comment/38907099
has comment: http://stackoverflow.com/comment/38908009
has comment: http://stackoverflow.com/comment/38913021
score: 2
has comment: http://stackoverflow.com/comment/38904685
downvote count: 0
answers question: http://stackoverflow.com/q/24999422
has comment: http://stackoverflow.com/comment/38912914
accepted answer of: http://stackoverflow.com/q/24999422

http://stackoverflow.com/a/25056175
answers question: http://stackoverflow.com/q/25055757
upvote count: 1
has comment: http://stackoverflow.com/comment/38976103
type: Answer
downvote count: 0
score: 1
has body: Add position:relative to the .wrapper (to make it the parent for the position calculations) and use .position() to get the position of the clicked element relative to the .wrapper HTML &lt;div class="wrapper"&gt; &lt;div class="div1"&gt;&lt;/div&gt; &lt;!-- ... --&gt; &lt;/div&gt; CSS .wrapper { /*...*/ position: relative; } Javascript $(".wrapper").children().on("click", function() { console.log($(this).position()); }); Demo: http://jsfiddle.net/8d62J/

http://stackoverflow.com/comment/38854918
type: AnswerComment
has text: Why wait for the fadeIn to be finished ?
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24991611

http://stackoverflow.com/a/24983877
has body: If you only have access to JS (not Flash, Silverlight, Java, et cetera), and you have no access at all to server-side storage procedures, then there really isn't any way to store and retrieve data on one domain, intended for another domain. That's by design. What you're currently asking for would be very helpful for making life easier for developers, but it would also make life very easy for everyone from hackers to data-miners who could just save everything you're doing in a spot set aside from their domain, and then the next time you're on their domain (an ad, running injected JS, perhaps), they can just grab all of that data from all sites you've been on... Not great. It's not that preventing this behaviour solves the problem of injected scripts stealing your data, on poorly-secured sites, et cetera, so much as allowing the behaviour makes it unfairly easy to do, and impossible to protect against.
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38900844
accepted answer of: http://stackoverflow.com/q/24983707
answers question: http://stackoverflow.com/q/24983707

http://stackoverflow.com/q/25007139
answer count: 1
has comment: http://stackoverflow.com/comment/38906446
has body: As the question says, I would like to know how to get the last selected item value from chosen multiselect plugin. So far I have this: $(document).ready(function() { $('#id').chosen().on('change', function(evt, param) { var id1 = this.value; var id2 = $("#id").chosen().val(); var id3 = $('#id', this).filter(':selected:last').val(); var id4 = $(evt.target).text(); alert('IDs:' +id1+'-'+id2+'-'+id3+'-'+id4); }); }); Here is the output: 2 - undefined - undefined - [all the values] The first answer is correct (I chose the second value). But if I later choose the 3rd value or one after the one I chose before, it keeps showing me the first value I chose. However, if I choose a value situated before the first one it works perfectly and I don't know why. Any help would be great.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25007203
has comment: http://stackoverflow.com/comment/38908411
has comment: http://stackoverflow.com/comment/38909055
tagged with: jquery-chosen
type: Question
has title: How to get last selected item from chosen multiselect plugin
tagged with: javascript
has comment: http://stackoverflow.com/comment/38907855
tagged with: jquery
has comment: http://stackoverflow.com/comment/38883975
has comment: http://stackoverflow.com/comment/38906522
has comment: http://stackoverflow.com/comment/38908090
score: 0

http://stackoverflow.com/comment/38818585
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24972421
has text: Events bubble, when you place an element inside `.bx` both event listeners are triggered.
score: 0

http://stackoverflow.com/q/24977466
accepted answer: http://stackoverflow.com/a/24981419
has body: I need your help. I have some submit buttons with an animation, here is a working demo: http://plnkr.co/edit/KhDdXWYnj3kVxhiKaEFL But now the submit don't works, just ask and play animation. not submit the form Enviar this is the code for animation: [].slice.call( document.querySelectorAll( 'button.progress-button' ) ).forEach( function( bttn ) { new ProgressButton( bttn, { callback : function( instance ) { var progress = 0, interval = setInterval( function() { progress = Math.min( progress + Math.random() * 0.1, 1 ); instance._setProgress( progress ); if( progress === 1 ) { instance._stop(1); clearInterval( interval ); } }, 200 ); } } ); } ); Before to the animation I had this and works fine, but now I just want press button, animation and submit without confirm validation function message1() { var r = confirm("¿ Sure to submit ?"); if (r == true) { return true; } else { alert('it didnt work'); return false; } } You know how can I do that ? Thanks for your help !
tagged with: javascript
tagged with: jquery
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38834283
type: Question
tagged with: animation
has title: Submit form after progress bar submit animation
answer count: 1
score: 0
has comment: http://stackoverflow.com/comment/38828756
tagged with: forms
has answer: http://stackoverflow.com/a/24981419

http://stackoverflow.com/a/24949036
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24948865
has comment: http://stackoverflow.com/comment/38775327
accepted answer of: http://stackoverflow.com/q/24948865
downvote count: 0
has body: You have error here Wrong id passed: document.getElementById(" lblCtime.ClientID ").innerHTML = h + ":" + m + ":" + s; ^ ^ Giving error: Uncaught TypeError: Cannot set property 'innerHTML' of null Try this code: document.getElementById("lblCtime").innerHTML = h + ":" + m + ":" + s; DEMO
upvote count: 2
type: Answer
score: 2

http://stackoverflow.com/comment/38865931
has text: FTR this is indicative of bad design.
score: 0
comment on: http://stackoverflow.com/q/24997724
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38996338
type: QuestionComment
has text: Where is `$scope.subject.id` defined?
comment on: http://stackoverflow.com/q/25066740
score: 0
type: Comment

http://stackoverflow.com/q/25060375
type: Question
has answer: http://stackoverflow.com/a/25682781
possible better answer: http://stackoverflow.com/a/25682781
answer count: 2
has answer: http://stackoverflow.com/a/25753192
downvote count: 0
has title: Meteor Spacebars - Expected identifier, number, string, boolean, or null
tagged with: javascript
tagged with: meteor
favorite count: 0
has comment: http://stackoverflow.com/comment/38984316
score: 2
type: AnsweredQuestion
has body: I have a function, which if there is one player in a game it returns true Template.gamePage.searching = function() { var game = GameCollection.findOne({current: true}); if(game.players.length === 1) { return true } }; I would like to show the below text through spacebars if this searching function returns true: {{#if {{searching}}}} Searching for an opponent {{> spinner}} {{/if}} I get the below error: client/views/games/game_page.html:35: Expected identifier, number, string, boolean, or null ...>. {{#if {{searching}}}} ...
accepted answer: http://stackoverflow.com/a/25753192
upvote count: 2

http://stackoverflow.com/comment/38867672
has text: I'm not sure that's the only problem (although I agree it is a problem). Since OP calls `update()` before `setInterval`, the correct call should have been made initially, and some data should have been shown. This is contradictory to the statement of "Nothing is shown on the page"
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24998692
type: Comment

http://stackoverflow.com/q/24927182
duplicate of: http://stackoverflow.com/q/6682997
type: Question
has comment: http://stackoverflow.com/comment/38733503
score: 5
upvote count: 5
has body: I just read the underscope source code, and cannot get the point from this code: _.each = _.forEach = function(obj, iterator, context) { if (obj == null) return obj; iterator = createCallback(iterator, context); var i, length = obj.length; if (length === +length) { // why +length? for (i = 0; i &lt; length; i++) { iterator(obj[i], i, obj); } } else { var keys = _.keys(obj); for (i = 0, length = keys.length; i &lt; length; i++) { iterator(obj[keys[i]], keys[i], obj); } } return obj; }; why length===+length ? I guess this used for force to convert if length is not a number? Could somebody give me a hand?
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24927248
linked to: http://stackoverflow.com/q/8330499
answer count: 2
possible better answer: http://stackoverflow.com/a/24927222
has answer: http://stackoverflow.com/a/24927222
downvote count: 0
duplicate of: http://stackoverflow.com/q/8330499
linked to: http://stackoverflow.com/q/6682997
favorite count: 0
linked to: http://stackoverflow.com/q/9081880
has title: What is the code " length === +length" mean in JavaScript?
has answer: http://stackoverflow.com/a/24927248
type: AnsweredQuestion

http://stackoverflow.com/comment/38780384
comment on: http://stackoverflow.com/a/24935346
type: AnswerComment
has text: well no , thats not difficult at all. you can define `ADickinson` in the array just the way you have define`d Company drop-down's` options. just make sure you place the array outside `$(document).ready(){...}`, so that its accessible anywhere in your js script code.
score: 0
type: Comment

http://stackoverflow.com/comment/38937824
type: Comment
score: 0
has text: In that case _never_ return a promise from it. Ok, I've added an answer.
type: QuestionComment
comment on: http://stackoverflow.com/q/25032549

http://stackoverflow.com/a/25003943
type: Answer
downvote count: 0
score: 1
has body: You aren't actually grabbing the element you need to remove - you're trying to remove a second copy of the element that hasn't been attached anywhere. To remove the element, you want to find it in your second list, then remove it. So the second part of your if statement becomes this: else if ($(this).css('color') === 'rgb(234, 76, 136)') { // if pink $(this).css('color', 'rgb(204, 204, 204)'); // turn to gray $('.b').find(".color-block[data-color='" + $(this).closest(".color-block").data("color") + "']").remove(); } Working Fiddle: http://jsfiddle.net/XDk6s/7/
answers question: http://stackoverflow.com/q/25003761
has comment: http://stackoverflow.com/comment/38878099
upvote count: 1

http://stackoverflow.com/q/25028245
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38924030
favorite count: 0
type: UnansweredQuestion
score: 6
tagged with: http://stackoverflow.com/tag/html
upvote count: 6
has comment: http://stackoverflow.com/comment/38923982
type: Question
linked to: http://stackoverflow.com/q/3194632
tagged with: javascript
tagged with: code-injection
has title: How to prevent variable injection in javascript and html5 games
has answer: http://stackoverflow.com/a/25028327
has body: I have used this html5 Snake game on my website , but problem is that it can be hacked so easily . http://cssdeck.com/labs/classic-snake-game-with-html5-canvas Hackers can inject scores and submit their own scores. Is there anyway to protect score variable inside the script not to be injected by clients ?

http://stackoverflow.com/q/25040844
tagged with: razor
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38947257
type: Question
has title: Why is parameter not defined?
has answer: http://stackoverflow.com/a/25040899
accepted answer: http://stackoverflow.com/a/25040899
tagged with: javascript
has comment: http://stackoverflow.com/comment/38947350
score: 0
answer count: 1
has body: why is dtc not defined when I call @Html.Raw(Json.Encode(dtc))? I get an error that states "The name 'dtc' does not exist in the current context" function createChartEncounterChart(chartid, dtc) { var mdl = @Html.Raw(Json.Encode(dtc)); ... }
has comment: http://stackoverflow.com/comment/38947251
has comment: http://stackoverflow.com/comment/38947401

http://stackoverflow.com/q/24987141
has title: How to update Google Cloud Storage ACL using Cloud Storage API in Javascript
answer count: 0
type: UnansweredQuestion
has body: I was studying the sample: https://developers.google.com/storage/docs/json_api/v1/json-api-javascript-samples It works well and one of its demonstrations is getBucket/ObjectAccessControls. But update ACL is not in the sample. The closest document I could find was https://developers.google.com/storage/docs/json_api/v1/bucketAccessControls/update?hl=zh-TW But where should I put the "Request body" part? or use the generic gapi.client.request? So do I need to call gapi.client.storage.bucket/objectAccessControls.insert even if the generic gapi.client.request has been used? Moreover, in the above document there is no description about where to put the ACL content, something like the xml scripts in https://developers.google.com/storage/docs/accesscontrol?hl=zh-tw And also the cross origin settings: https://developers.google.com/storage/docs/cross-origin?hl=zh-tw
score: 1
tagged with: google-cloud-storage
type: Question
upvote count: 1
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/38811107
type: AnswerComment
comment on: http://stackoverflow.com/a/24967877
score: 0
type: Comment
has text: Got it! The console showed "Uncaught TypeError: undefined is not a function," and it was referencing the line with `$(hash).modal('toggle');`. So I did some digging and changed our jquery from 1.11.1 to 2.1.1. Then the code you provided worked! Many thanks, Patrick.

http://stackoverflow.com/comment/38935122
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25034316
has text: According to my test it looks like your code is bringing up a popup, is that not what you wanted? http://jsfiddle.net/spryno724/b857X/

http://stackoverflow.com/a/24990863
type: Answer
has body: Delete or comment the padding in the two following classes .ui-dialog { overflow: hidden; position: absolute; top: 0; left: 0; /*padding: .2em;*/ outline: 0; } .ui-dialog .ui-dialog-content { position: relative; border: 0; /*padding: .5em 1em;*/ background: none; overflow: auto; }
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24990764

http://stackoverflow.com/a/25066081
has comment: http://stackoverflow.com/comment/38995216
score: 18
upvote count: 18
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25066005
answers question: http://stackoverflow.com/q/25066005
has comment: http://stackoverflow.com/comment/98119496
has comment: http://stackoverflow.com/comment/82099792
type: Answer
has body: You can assign the second promise's then() callback with a returned promise from the third service. var promise1, promise2, promise3; promise1 = service1(); promise2 = service2(); promise3 = promise2.then(function (data) { return service3(data); }); $q.all([ promise1, promise2, promise3]).then(function success() { //somehing });
has comment: http://stackoverflow.com/comment/38995078

http://stackoverflow.com/a/38322926
upvote count: 7
has comment: http://stackoverflow.com/comment/120084130
downvote count: 1
answers question: http://stackoverflow.com/q/25040479
type: Answer
score: 6
has body: As per MDN documentation on FormData An object implementing FormData can directly be used in a for...of structure, instead of entries(): for (var p of myFormData) is equivalent to for (var p of myFormData.entries()). Iterating over FormData.entries() didn't worked for me. Here is what I do to check if formData is empty or not: var isFormDataEmpty= true; for (var p of formData) { isFormDataEmpty= false; break; } As iterating over formData gives you the uploaded file, you can use it for getting the file name, file type validation, etc.
has comment: http://stackoverflow.com/comment/120168519
has comment: http://stackoverflow.com/comment/120187621

http://stackoverflow.com/comment/38836885
score: 0
has text: You appear to be making up HTML tag attributes (project, description, images). You should preface these attribute names with `data-`.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24982233

http://stackoverflow.com/q/24974621
type: Question
accepted answer: http://stackoverflow.com/a/24974667
tagged with: javascript
has comment: http://stackoverflow.com/comment/38822697
has answer: http://stackoverflow.com/a/59892781
upvote count: 39
has comment: http://stackoverflow.com/comment/38822637
has answer: http://stackoverflow.com/a/60313934
linked to: http://stackoverflow.com/q/4976344
has comment: http://stackoverflow.com/comment/38822723
favorite count: 0
score: 38
has answer: http://stackoverflow.com/a/58997692
has title: What is a node in Javascript?
has body: I was wondering what exactly a node is in JavaScript? As in the functions: element.nodeType row.parentNode.removeChild(row);
answer count: 4
possible better answer: http://stackoverflow.com/a/58997692
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24974667
tagged with: dom
downvote count: 1
tagged with: nodes

http://stackoverflow.com/comment/38853302
type: AnswerComment
has text: done i made it i had to change $("#users").html(divData); to $("#users").html(); thanks a lot:D
comment on: http://stackoverflow.com/a/24990879
type: Comment
score: 0

http://stackoverflow.com/comment/38790619
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24957656
has text: @Spokey I want balls rolled out one after the other like in the game lotto.

http://stackoverflow.com/comment/39014853
comment on: http://stackoverflow.com/a/25069647
score: 0
type: AnswerComment
type: Comment
has text: True...sorry! I updated the fiddle now http://jsfiddle.net/Bws3t/9/ But right now nothing works in there. That's the code I'm using...or did I mess up the js? I'm totally confused, I'm still trying to learn, but it's difficult!

http://stackoverflow.com/comment/38730042
comment on: http://stackoverflow.com/a/24925261
score: 0
type: AnswerComment
type: Comment
has text: I had a feeling that this was the issue. Thank you for the response!

http://stackoverflow.com/q/24939654
score: 3
has comment: http://stackoverflow.com/comment/38761907
has body: If I have a text field like &lt;input type="text" name="summary" value="Summary: This is a test."&gt;, is it possible to make it so that when the user clicks on the field, or uses Tab to reach it, that rather than select all of the text, only part of it is selected? In this case, I'd like the This is a test part to be selected, so the user can immediately start typing to replace it with what they want. Is this possible with JavaScript, and if necessary, some type of hack to make it work? Unfortunately, I am quite limited by what other options I have in this case; typically, alternatives would be to place the Summary: outside the text box, for instance, so it can't be edited.
has comment: http://stackoverflow.com/comment/38761291
has comment: http://stackoverflow.com/comment/38757235
possible better answer: http://stackoverflow.com/a/24940763
type: Question
has comment: http://stackoverflow.com/comment/38763222
answer count: 2
has answer: http://stackoverflow.com/a/24940763
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38761636
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24939704
has title: Select some text in an input field, but not all, when it is focused
tagged with: field
tagged with: input
has comment: http://stackoverflow.com/comment/38757351
favorite count: 0
has comment: http://stackoverflow.com/comment/38757323
upvote count: 3
has comment: http://stackoverflow.com/comment/38759417
has comment: http://stackoverflow.com/comment/38761205
has answer: http://stackoverflow.com/a/24939704
has comment: http://stackoverflow.com/comment/38757195
tagged with: text
type: AnsweredQuestion

http://stackoverflow.com/q/25040091
has body: This is my first Ember.js application. I'm building a multiple choice question (eventually a quiz). Whenever the submit button is clicked it should highlight the choice as green for correct or red for incorrect. I get the error "Uncaught TypeError: undefined is not a function" on option.set("highlight", "green") || option.set("highlight", "red) in my controllers/index.js file. When I console.log(option) I can see there is an object with the property highlight. What am I doing wrong? routes/index.js var IndexRoute = Ember.Route.extend({ model: function() { return Ember.A([ { question: "What's up?", answer: 'option b', options: [ { text: "option a", active: false, highlight: '' }, { text: "option b", active: false, highlight: '1' } ] }, { question: "How many?", answer: 'two', options: [ "one", "two" ] } ]); } }); controllers/index.js var IndexController = Ember.ObjectController.extend({ actions:{ submitAction : function(){ this.get('model').forEach(function (item){ item.options.forEach(function (option) { if (option.text === item.answer) { console.log(option); option.set("highlight", "green"); console.log(option.highlight); } if (option.active &amp;&amp; (option.text !== item.answer)) { option.set("highlight", "red"); } }); }); } } });
type: Question
accepted answer: http://stackoverflow.com/a/25041706
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38946183
has title: Why can't I set this object property?
answer count: 1
has comment: http://stackoverflow.com/comment/38947116
score: 8
favorite count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/38945737
has answer: http://stackoverflow.com/a/25041706
tagged with: ember.js
type: AnsweredQuestion

http://stackoverflow.com/comment/38848315
type: QuestionComment
type: Comment
has text: Take a look at the `XMLHTTPRequest` object
score: 0
comment on: http://stackoverflow.com/q/24988114

http://stackoverflow.com/comment/38707162
comment on: http://stackoverflow.com/q/24910432
type: Comment
has text: @Jay Blanchard Using serialize also strips out the html tags from the textarea.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38819819
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24971955
type: Comment
has text: Are you testing with the same browser (same version too)?

http://stackoverflow.com/comment/38866157
score: 0
type: QuestionComment
type: Comment
has text: You could try saving the individual variables in cookies or with the Web Storage API (session storage or local storage). Actually, saving the files though is not possibly as far as I know. Not without prompting the user at least.
comment on: http://stackoverflow.com/q/24997901

http://stackoverflow.com/comment/39164010
type: AnswerComment
type: Comment
has text: No I can't, have you thought for yourself ? have you looked at the source code of your page ? is everything ok ?
comment on: http://stackoverflow.com/a/24980784
score: 0

http://stackoverflow.com/q/25023459
tagged with: shell
tagged with: unix
favorite count: 0
tagged with: ruby
tagged with: sinatra
upvote count: 2
has title: How do I display the popen output as it happens through a get request?
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25027460
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25023704
accepted answer: http://stackoverflow.com/a/25023704
has body: I have some Ruby scripts that I use to automate some rsync tasks that can take a very long time to finish. I'm using popen to run a command: def process(command) io = IO.popen(command) output = io.read io.close return output end The command is executed by a get request in a Sinatra app: get '/sync' do stream do |out| rsync_command = "rsync somedir" out &lt;&lt; process(rsync_command) end end Then I am accessing the output with an Ajax request on the front end: $.get('/sync', function (data) { console.log(data); }); Is it possible to display the shell output as it happens rather than only having it return at the end of the process?
answer count: 2
has answer: http://stackoverflow.com/a/25027460
downvote count: 0

http://stackoverflow.com/comment/38838737
has text: I updated the question. If you still dont understand let me know.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24982563

http://stackoverflow.com/a/25041820
accepted answer of: http://stackoverflow.com/q/25021155
type: Answer
answers question: http://stackoverflow.com/q/25021155
has body: I used byte[] instead of InputStream. which seemed to remedy the problem with 20mb files, as our QA server only has 124 mb.
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/38896052
comment on: http://stackoverflow.com/q/25013643
type: Comment
score: 3
has text: Storage is per origin. But it's standard to namespace your variables : `localStorage['moduleA.a']` which helps manage big sites (or origins with many different sites).
type: QuestionComment

http://stackoverflow.com/a/24918690
type: Answer
has body: You can't, you have to store previous height/width in some variables. Just put it in variables on page load and then you can access it in this method. There is nothing like bofore resize. read this
answers question: http://stackoverflow.com/q/24918526
score: 0

http://stackoverflow.com/a/25007546
type: Answer
answers question: http://stackoverflow.com/q/25007415
has body: Using a single directive sounds reasonable, especially since the contents are dynamic. If there are common parts (such as a title or a legend), you could nest those as directives inside. So: &lt;mp-seating-chart layout="layout"&gt;&lt;/mp-seating-chart&gt; Here you are passing the layout to the directive, layout being a complex object describing the seating arrangement.
score: 0

http://stackoverflow.com/q/24931919
has body: I made a simple animation today. It's supposed to show days and nights going by. It works correctly in Chrome, but in Firefox, the texture animation gets stuck sometimes. Click to see For the animated texture, I'm using a 2d Canvas: mixedTexture = document.createElement ( 'canvas' ); What's the problem?
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
type: Question
has title: Animated three,js texture not working correctly in Firefox
tagged with: canvas
has answer: http://stackoverflow.com/a/24932042
tagged with: javascript

http://stackoverflow.com/comment/70630635
type: QuestionComment
comment on: http://stackoverflow.com/q/25003217
score: 1
has text: `encodeURI()` without UTF-8 and `escape()` with UTF-8
type: Comment

http://stackoverflow.com/comment/48095596
type: Comment
has text: Beware of that this fails (as of v1.9.0) if element or it's parent is hidden from the DOM by `display:none` https://github.com/lcdsantos/jQuery-Selectric/issues/87
comment on: http://stackoverflow.com/a/27489283
score: 0
type: AnswerComment

http://stackoverflow.com/comment/119575017
type: AnswerComment
has text: neat trick! takes less code than using the http / https createServer way :)
comment on: http://stackoverflow.com/a/66084892
type: Comment
score: 0

http://stackoverflow.com/a/24997073
answers question: http://stackoverflow.com/q/24996910
score: 0
type: Answer
has body: You can conditionally include a script file in JavaScript if(someConditionIsTrue){ // load script from the server $.getScript( "somePath/onTheServer/script.js", function( data, textStatus, jqxhr ) { // do something after the load is complete }); }

http://stackoverflow.com/a/24933788
has comment: http://stackoverflow.com/comment/38745945
has comment: http://stackoverflow.com/comment/38745963
has comment: http://stackoverflow.com/comment/38745844
has comment: http://stackoverflow.com/comment/38745903
has comment: http://stackoverflow.com/comment/38746079
type: Answer
has comment: http://stackoverflow.com/comment/38745969
score: 0
answers question: http://stackoverflow.com/q/24933607
has body: Code looks OK . Try something like below true true false true true false //jquery $(document).on('click','#dropDown option',function(){ $('#visit-paid').prop('checked', $.trim($(this).text())); });

http://stackoverflow.com/comment/38887570
has text: Hmmm, this library gives you a line by line comparison, but does it work down to the characters?
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/25009185

http://stackoverflow.com/q/25020306
tagged with: javascript
has title: How to select a radio input on ajax callback
accepted answer: http://stackoverflow.com/a/25020439
tagged with: jquery
has answer: http://stackoverflow.com/a/25020422
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38908814
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38908846
has answer: http://stackoverflow.com/a/25020468
score: 0
has answer: http://stackoverflow.com/a/25020439
type: Question
possible better answer: http://stackoverflow.com/a/25020413
has body: I'm going to make a auto complete form. In which the options of the form like address, telephone, fax and department are auto select after a username is selected by a drop down (auto suggest) list. The whole process is completed. But only one thing - the radio button. I don't have any idea how to make it selected from a value return by ajax. Here is my code. HTML Address : Telephone : Department : Dep 1 Dep 2 Dep 3 Javascript $('#inst_name').blur(function(){ $.ajax({ url: 'inc/autoform.json.php', dataType:'json', data: {name:$('#inst_name').val()}, success: function(data){ $('#inst_addr').val(data.addr); $('#inst_tel').val(data.tel); $('#hidden_dep').val(data.dep); } }); }); For example, if an ajax returned data.dep="1" so the Dep 1 should be selected.
has comment: http://stackoverflow.com/comment/38908911
has answer: http://stackoverflow.com/a/25020413

http://stackoverflow.com/q/24969297
has answer: http://stackoverflow.com/a/24969358
tagged with: javascript
has body: I have added 31 buttons on web page and 30 of them are either "Yes" or "No" or "NO Clue"and last is "Submit". I have used jquery functions such that "NO" and "NO Clue" fades out on clicking "YES" and viceversa. But since my input type = "submit" for all, my jquery is not working as the page reloads after clicking the very first button. Any suggestions on how to implement this ? I am a noob so please go easy on me.
score: 0
answer count: 3
has comment: http://stackoverflow.com/comment/38812485
has comment: http://stackoverflow.com/comment/38812505
tagged with: jquery
has answer: http://stackoverflow.com/a/24969318
has title: Webpage not working
has comment: http://stackoverflow.com/comment/38812488
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/38812487
has answer: http://stackoverflow.com/a/24969323
type: Question

http://stackoverflow.com/q/25023436
has comment: http://stackoverflow.com/comment/38915024
tagged with: http://stackoverflow.com/tag/html
has title: How can integrate tabs into a Bootstrap Carousel?
tagged with: css
answer count: 0
type: Question
has body: Right now, I have a proof of concept built of a modal with a tabbed carousel in it. It looks like this: The images for the carousel are populated by a CMS. What I would like to do, is have multiple images tagged as one of the tabs above. When the image shows up in the slideshow, its corresponding tab becomes the active tab. It would also be preferable to be able to click a tab and the slideshow jumps to the first one in the group. Here's what my current code looks like: &lt;ul class="nav nav-tabs" role="tablist"&gt; &lt;li class="active"&gt; &lt;a href="#"&gt;Brand&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Print&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Web&lt;/a&gt; &lt;/li&gt; &lt;li&gt; &lt;a href="#"&gt;Marketing&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div id="this-carousel-id" class="carousel slide"&gt; &lt;!-- class of slide for animation --&gt; &lt;div class="carousel-inner"&gt; {foreach from=$images item=slide name=foo} {if $smarty.foreach.foo.first} &lt;div class="item active"&gt; &lt;!-- class of active since it's the first item --&gt; &lt;img src="{$slide-&gt;file}" alt=""&gt; &lt;div class="carousel-caption"&gt; &lt;p&gt; Caption text here &lt;/p&gt; &lt;/div&gt; &lt;/div&gt;{else} &lt;div class="item"&gt; &lt;!-- class of active since it's the first item --&gt; &lt;img src="{$slide-&gt;file}" alt=""&gt; &lt;div class="carousel-caption"&gt;&lt;/div&gt; &lt;ul&gt; &lt;li style="list-style: none"&gt;{foreach from=$slide-&amp;gt;fields item=imagefield} &lt;/li&gt; &lt;li&gt;fieldname '{$imagefield.name}' has value: '{$imagefield.value}' &lt;/li&gt; &lt;li style="list-style: none"&gt;{/foreach} &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt;{/if} {/foreach} &lt;/div&gt;&lt;!-- /.carousel-inner --&gt; &lt;!-- Next and Previous controls below href values must reference the id for this carousel --&gt; &lt;a class="carousel-control left" href="#this-carousel-id" data-slide="prev"&gt;‹&lt;/a&gt; &lt;a class="carousel-control right" href="#this-carousel-id" d…
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38915077
has comment: http://stackoverflow.com/comment/38915113
tagged with: jquery
tagged with: twitter-bootstrap
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38915168

http://stackoverflow.com/q/24977023
has body: jQuery Mobile's rangeslider widget allows the user to select an upper and lower bound; it is essentially two &lt;input type='range'/&gt; elements that have been "enhanced" to appear as a single slider with two "thumbs" or "handles." This works great for simple numeric ranges (e.g., a min and max price), but I'd like to use this to allow a user to select a color range. Mapping colors to numbers is not quite intuitive, and I'd like to provide some UI cues to help the user out. In doing some research I found something very much like I want, here. You can see that user can select what range of blue they are interested in by setting the lightest acceptable shade, and the darkest acceptable shade of blue. There are several UI cues that makes this selection intuitive for the user: The track (or "slider bar") itself is has a different color for each discrete step. In the sample I linked to, they actually use a gradient background, which is also fine, but for my application I don't mind if each step is a solid color. There is a label below each discrete step indicating the name of the color. Each step has a distinct border. I've been experimenting with jQuery Mobile's rangeslider and have yet to come up with a method that can reproduce even one of these UI cues. There is a "theme" and "trackTheme" setting, but neither allows you to label or color the individual steps of your slider. Is it possible to do this with jQuery Mobile's rangeslider?
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38827616
tagged with: jquery-mobile
tagged with: javascript
type: UnansweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38827060
has answer: http://stackoverflow.com/a/24977419
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Is it possible to create a jQuery mobile range slider for color selection, with labels, step borders, and step backgrounds?
tagged with: css

http://stackoverflow.com/q/25024464
has body: I am working on my new website and have a masonry/Pinterest style effect blog board. When you hover over a post it brings up a button which should link through to the blog/single page. Which it will do if you right click and open in a new window but doesn't if you just left click. i am guessing it is something to do with the javascript I am using to power the masonry style. The test site is live here: http://zonocreative.co.uk/lee/blog.html If anyone could help it would be great. Regards For reference, here is my html code: &lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;Lee Bollu - Creative Designer Leigh-on-Sea, Essex&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="css/styles.css"&gt; &lt;link rel="stylesheet" type="text/css" href="css/columns.css"&gt; &lt;link rel="stylesheet" type="text/css" href="css/flexy-menu.css"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"&gt; &lt;/head&gt; &lt;body&gt; &lt;!--Header--&gt; &lt;div class="nav-wrapper"&gt; &lt;div class="nav-inner"&gt; &lt;a href="index.html"&gt;&lt;img class="logo" src="images/lee-bollu-logo.svg" alt="Lee Bollu Logo"&gt;&lt;/a&gt; &lt;a href="http://www.facebook.com/lee.bollu"&gt;&lt;img class="social" src="images/facebook.svg" alt="facebook"&gt;&lt;/a&gt; &lt;a href="http://www.twitter.com/lbollu"&gt;&lt;img class="social" src="images/twitter.svg" alt="twitter"&gt;&lt;/a&gt; &lt;ul class="flexy-menu"&gt; &lt;li&gt;&lt;a href="index.html"&gt;Work&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="blog.html"&gt;Blog&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;!--Header--&gt; &lt;!--Recent Blog Posts--&gt; &lt;div class="container"&gt; &lt;div class="container-fluid social-wrapper"&gt; &lt;div id="social-container"&gt;&lt;/div&gt; &lt;div id="hidden-items"&gt; &lt;!-- start of an item--&gt; &lt;div class="item panel clearfix social-entry"&gt; &lt;div class="panel-body"&gt; &lt;div class="content-image"&gt; &lt;img height="300"…
has title: Unable to click anchor link
tagged with: http://stackoverflow.com/tag/html
tagged with: anchor
type: AnsweredQuestion
score: 1
upvote count: 1
type: Question
tagged with: masonry
has answer: http://stackoverflow.com/a/25024566
has answer: http://stackoverflow.com/a/25024555
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38917126
accepted answer: http://stackoverflow.com/a/25024566
answer count: 2
possible better answer: http://stackoverflow.com/a/25024555
downvote count: 0
favorite count: 0

http://stackoverflow.com/comment/38966844
score: 0
type: AnswerComment
has text: @user3890317 see updated fiddle and code. I think this is what you want.
comment on: http://stackoverflow.com/a/25051066
type: Comment

http://stackoverflow.com/q/24928951
upvote count: 2
tagged with: css
has body: I have one linked css file for default properties and a second one for the news that it changes when the wiewport is changed. At the end of the JS script I puted an element's offsetWidth in the global value NavW. So JS seems to returns the wrong value, it doesn't compute only in the dom but based of the first default css properties not the new one. However, the target element rendered correctly. Notice that the value '2' in the condition is because there is a Link element which is not a css file but an icon. function switchTheme(newHref) { var newIndex; newIndex = document.getElementsByTagName("link").length; var newTheme = document.createElement("link"); newTheme.setAttribute("rel", "stylesheet"); newTheme.setAttribute("type", "text/css"); newTheme.setAttribute("href", newHref); if ( newIndex == 2 ) { document.getElementsByTagName("head").item(newIndex - 2).appendChild(newTheme); } else if ( newIndex &gt; 2 ) { var themeToReplace = document.getElementsByTagName("link").item(2); document.getElementsByTagName("head").item(0).replaceChild(newTheme, themeToReplace); } NavW = document.getElementById("wrap").offsetWidth; }
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38736922
has comment: http://stackoverflow.com/comment/38736857
has answer: http://stackoverflow.com/a/24931358
type: Question
tagged with: javascript
tagged with: offsetwidth
has comment: http://stackoverflow.com/comment/38737397
accepted answer: http://stackoverflow.com/a/24931358
has title: offsetWidth returns unknown value (JS)
score: 2
answer count: 1
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38736666

http://stackoverflow.com/q/24946312
type: Question
has comment: http://stackoverflow.com/comment/38769965
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has title: JavaScript fillStyle usable with stroke()?
type: UnansweredQuestion
upvote count: 1
has body: In JavaScript, is it possible to use any sort of fillStyle in a stroke()? Here is my code: var text = document.getElementById("text"); var first = text.getContext("2d"); first.font = "100px SimLLHP"; first.strokeStyle = "blue"; first.strokeText("T1",100,100); var last = text.getContext("2d"); last.font = "100px SimLLHP"; last.strokeStyle = "blue"; last.strokeText("T2",110,180)
has answer: http://stackoverflow.com/a/24946593
score: 1

http://stackoverflow.com/comment/38906279
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25018377
type: AnswerComment
has text: Good luck! :) Glad you like my solution. I also really like working with promises this way, because it make the code so more readable. Just everything below each other.

http://stackoverflow.com/q/25041126
tagged with: javascript
has comment: http://stackoverflow.com/comment/38947819
has comment: http://stackoverflow.com/comment/38948485
has comment: http://stackoverflow.com/comment/38947669
has comment: http://stackoverflow.com/comment/38947770
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38947929
has comment: http://stackoverflow.com/comment/38947666
has comment: http://stackoverflow.com/comment/38948413
favorite count: 0
has comment: http://stackoverflow.com/comment/38947872
tagged with: facebook
has comment: http://stackoverflow.com/comment/38947733
type: UnansweredQuestion
downvote count: 2
has body: Hey guys am developing a facebook app in which counts the number of words in messages. The main part of my code is <fb:login-button scope="public_profile,email,read_mailbox" onlogin="checkLoginState();"> </fb:login-button> The output of this is http://pastebin.com/4EaStYMX What i need is that i have to find all the words in the full words from the message. I have tried many methods but it didnt worked ..Hope you guys can help me out Thanks in advance..
has answer: http://stackoverflow.com/a/25041645
has comment: http://stackoverflow.com/comment/38947846
has title: Fetching the number of words with javascript
has comment: http://stackoverflow.com/comment/38947741
type: Question
has comment: http://stackoverflow.com/comment/38947790
score: -2
has comment: http://stackoverflow.com/comment/38947889

http://stackoverflow.com/comment/38910596
has text: checkout this [link](https://developers.google.com/maps/documentation/javascript/examples/polygon-arrays) that's what i'm trying to do but with a input where you set the lat and lng
comment on: http://stackoverflow.com/q/25020479
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24977110
has title: How to count the number of elements in this json object?
has comment: http://stackoverflow.com/comment/76477515
type: Question
linked to: http://stackoverflow.com/q/126100
has body: I want to get the number of elements for this JSON object in javascript. data = { name_data: { 35: { name: "AA", }, 47: { name: "BB", }, 48: { name: "CC", }, 49: { name: "DD", } } } The correct answer should be 4. My code is data.name_data.length but it returns an undefined object. How can the correct number of elements in this JSON object be obtained in javascript?
score: 10
tagged with: javascript
duplicate of: http://stackoverflow.com/q/126100
upvote count: 11
has comment: http://stackoverflow.com/comment/38827239
downvote count: 1
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24977145
linked to: http://stackoverflow.com/q/1345939
has answer: http://stackoverflow.com/a/24977145
type: AnsweredQuestion
duplicate of: http://stackoverflow.com/q/1345939
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/25058832
tagged with: javascript
answer count: 1
has comment: http://stackoverflow.com/comment/38981305
has body: I've just across a weird 'quirk', and I'm not sure if I'm doing something wrong. Here's the code, with a Plunkr link below: HTML ng-if: {{ foo.bar }} ng-show: {{ foo.bar }} ng-hide: {{ foo.bar }} Select 'B' Select 'N' Reset JavaScript angular.module('app', []) .controller('MainController', function($scope) { $scope.foo = { baz: 'foo' }; $scope.foo.select = function(item) { $scope.foo.bar = item; } $scope.foo.reset = function() { $scope.foo.bar = ''; } }); Plunkr: http://plnkr.co/edit/H3Ghk1dCQqQ5PVd30Pdp?p=preview In the example, why when you select 'N' is it not shown? In my actual app, the whole alphabet it used, and only the letter 'N' doesn't work. This doesn't make any sense to me, in plain JavaScript, the following apply: var obj = {}; obj.foo = {}; obj.foo.bar = 'N'; !!obj.foo.bar // => true And I assumed ng-if / ng-show displayed content based on the expression being 'truthy'? Any help would be amazing, I'm hoping it's just a misunderstanding that I've made!
favorite count: 0
has title: ng-if expression evaluating incorrectly
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/38981141
has answer: http://stackoverflow.com/a/25059039
type: AnsweredQuestion
score: 2
accepted answer: http://stackoverflow.com/a/25059039
type: Question
downvote count: 0

http://stackoverflow.com/a/24939522
has comment: http://stackoverflow.com/comment/38756907
type: Answer
has comment: http://stackoverflow.com/comment/38756811
has comment: http://stackoverflow.com/comment/38756730
has body: When you callname().another(), this evaluates to (5).anotherone(). anotherone() is not a function of the literal 5, which is why you get the error undefined is not a function. If you want to chain methods, use a class/object that returns an instance of itself so you can call myClass.aFunction().anotherfunction() so the call stack evaluates to (myClass).anotherfunction()
downvote count: 0
has comment: http://stackoverflow.com/comment/38757140
score: 2
has comment: http://stackoverflow.com/comment/38757135
answers question: http://stackoverflow.com/q/24939458
upvote count: 2

http://stackoverflow.com/comment/97443366
score: 1
type: Comment
comment on: http://stackoverflow.com/a/25021736
type: AnswerComment
has text: I found `^(?:20(?:1[4-9]|[2-9][\d])|2[1-9][\d]{2}|[3-9][\d]{3})$` made it a tad shorter and a bit more readable.

http://stackoverflow.com/comment/38768081
type: AnswerComment
comment on: http://stackoverflow.com/a/24945069
score: 0
type: Comment
has text: As far as I can tell, this works for my scenario, so I'm going to mark it as the accepted answer. Two things: The forward slashes need to be escaped in the regex (e.g. `\/`), and also I modified the end similar to the beginning, with the addition of being able to match at the end of a sentence, in addition to the end the text (`(^|\s+)\/([A-Z0-9a-z ]+)\/(\s+|$|\.)`).

http://stackoverflow.com/comment/38996457
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25064094
has text: Also, I presume that `MongoClient.connect` is _itself_ async, such that `function(err, db)` is called on completion of the connection and `doStuff()` then returns immediately?
score: 0

http://stackoverflow.com/a/25011055
score: 0
has body: Remove the dots from the price string: var price = $(this).contents().filter(function () { return this.nodeType === 3; }).text().replace('.','');
answers question: http://stackoverflow.com/q/25010840
type: Answer

http://stackoverflow.com/q/24979324
tagged with: checkbox
has comment: http://stackoverflow.com/comment/38831325
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24979437
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38831294
upvote count: 0
tagged with: javascript
score: -1
has comment: http://stackoverflow.com/comment/38831413
has title: Android Spinner & CheckBox OnClick Event
tagged with: android
answer count: 1
favorite count: 0
has body: I am having some problem with the on trigger event of spinner and checkbox in android. So basically what I am trying to do is firstly when something from spinner was selected, my tableOri will appear. When the checkbox is checked, the tableOri will be hidden and replace with tableSuggested. Both of the tables should be hidden at first. Here is my route_planning.xml: &lt;Spinner android:id="@+id/spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;CheckBox android:id="@+id/cbMostCommuter" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="8sp" android:text="Most Commuter Routes" /&gt; &lt;TableLayout android:id = "@+id/tableOri" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" android:padding="5dp"&gt; &lt;TableRow android:layout_height="wrap_content"&gt; &lt;TextView android:text="10009" android:paddingRight="10dp" android:layout_height="wrap_content" /&gt; &lt;TextView android:text="Bt Merah Int" android:layout_height="wrap_content" /&gt; &lt;TextView android:text="0 mins" android:paddingLeft="10dp" android:layout_height="wrap_content" /&gt; &lt;/TableRow&gt; &lt;/TableLayout&gt; &lt;TableLayout android:id = "@+id/tableSuggested" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" android:padding="5dp"&gt; &lt;TableRow android:layout_height="wrap_content"&gt; &lt;TextView android:text="10009" android:paddingRight="10dp" android:layout_height="wrap_content" /&gt; &lt;TextView android:text="Bt Merah Int " android:layout_height="wrap_content" /&gt; &lt;TextView android:text="0 mins" android:paddingLeft="10dp" android:layout_height="wrap_content" /&gt; &lt;/TableRow&gt; And the place where I execute all the onCLick event: private CheckBox cbMostCommuter; private Spinner spinner; private static final String[]paths = {"Trunk Bus Service", "268", "269", "272", "275"}; ArrayAd…
has answer: http://stackoverflow.com/a/24979437

internet-explorer
tags question: http://stackoverflow.com/q/24957058
tags question: http://stackoverflow.com/q/25027647
tags question: http://stackoverflow.com/q/25052676
tags question: http://stackoverflow.com/q/24998663
tags question: http://stackoverflow.com/q/25000862
tags question: http://stackoverflow.com/q/24945567
tags question: http://stackoverflow.com/q/25059256
tags question: http://stackoverflow.com/q/24999266
tags question: http://stackoverflow.com/q/25055323
tag name: internet-explorer
tags question: http://stackoverflow.com/q/24918117
tags question: http://stackoverflow.com/q/25017294
tags question: http://stackoverflow.com/q/25013607
tags question: http://stackoverflow.com/q/24931675
tags question: http://stackoverflow.com/q/24945690
tags question: http://stackoverflow.com/q/25035114
tags question: http://stackoverflow.com/q/24991737
tags question: http://stackoverflow.com/q/24944940
tags question: http://stackoverflow.com/q/25050690
tags question: http://stackoverflow.com/q/24942681
tags question: http://stackoverflow.com/q/24992132
tags question: http://stackoverflow.com/q/25008099
tags question: http://stackoverflow.com/q/25024378
tags question: http://stackoverflow.com/q/24935848
tags question: http://stackoverflow.com/q/25015148
tags question: http://stackoverflow.com/q/25015844
tags question: http://stackoverflow.com/q/25063470
tags question: http://stackoverflow.com/q/25043895
tags question: http://stackoverflow.com/q/25051558
tags question: http://stackoverflow.com/q/24930229
tags question: http://stackoverflow.com/q/25044304
tags question: http://stackoverflow.com/q/25035006
tags question: http://stackoverflow.com/q/24958043
tags question: http://stackoverflow.com/q/24978426
tags question: http://stackoverflow.com/q/25013174
tags question: http://stackoverflow.com/q/25046540
tags question: http://stackoverflow.com/q/25044799
tags question: http://stackoverflow.com/q/24996161
tags question: http://stackoverflow.com/q/25058809
tags question: http://stackoverflow.com/q/24987965
tags question: http://stackoverflow.com/q/24958865
tags question: http://stackoverflow.com/q/24955790
type: Tag
tags question: http://stackoverflow.com/q/25067716
tags question: http://stackoverflow.com/q/25057509
tags question: http://stackoverflow.com/q/24935819
tags question: http://stackoverflow.com/q/24915721
tags question: http://stackoverflow.com/q/24942012
tags question: http://stackoverflow.com/q/25053082
tags question: http://stackoverflow.com/q/24928253
tags question: http://stackoverflow.com/q/24955468
tags question: http://stackoverflow.com/q/24930054

http://stackoverflow.com/q/25051774
tagged with: javascript
tagged with: jquery
score: 0
tagged with: photoswipe
has answer: http://stackoverflow.com/a/25052200
accepted answer: http://stackoverflow.com/a/25052200
has body: I try to work with photoswipe (downloaded here: http://github.com/downloads/dimsemenov/PhotoSwipe/code-photoswipe.v1.0.11.zip) on my mobile site. My problem is, that appearently the photoswipe doesn't fire. My header is the following: &lt;link media="all" href="fileadmin/css/mobile/photoswipe.css?1406785972" type="text/css" rel="stylesheet"&gt; &lt;script src="//code.jquery.com/jquery-1.9.1.min.js"&gt; &lt;script src="fileadmin/js/libaries/simple-inheritance.min.js"&gt; &lt;script src="fileadmin/js/libaries/code-photoswipe-1.0.11.min.js"&gt; &lt;script src="fileadmin/js/libaries/photoswipe.js"&gt; When I click on a picture, photoswipe doesn't start. I think you can see that best on my site itself: http://m.andre-hohmann.net/bilder/urlaubsbilder/tunesien-2010/. Does anybody know what I'm doing wrong? Thank you very much.
type: Question
type: AnsweredQuestion
has title: photoswipe 1.0.11 - doesn't fire
answer count: 1

http://stackoverflow.com/a/25033844
score: 3
has comment: http://stackoverflow.com/comment/50554800
accepted answer of: http://stackoverflow.com/q/25025502
type: AcceptedAnswer
has body: No, you cannot influence the "From:" description in the Save dialog. Otherwise folks would abuse this. However, it is indeed unfortunate that blob URIs display this poorly. Consider filing a bug (or even creating a patch) to rectify this.
downvote count: 0
answers question: http://stackoverflow.com/q/25025502
type: Answer
upvote count: 3

http://stackoverflow.com/a/25034677
score: 0
has comment: http://stackoverflow.com/comment/38939025
type: Answer
answers question: http://stackoverflow.com/q/25033647
has body: Your watch function will be called whenever $scope.$digest is called (this is called by $apply function ). $digest is called for browser events (click, keydown.. ),$http request completed, and also by $timeouts. I think you need to use $timeout service here instead of setTimeout $timeout(function() { deferred.resolve('test value'); }, 0); http://jsfiddle.net/Byca5/7/ . This will fire $scope.$apply for you after timeout completed. When async = false your value will set immediately when the controller is loaded or when the $scope is created. So when first $digest cycle happens there is no change in the $scope.text. That's why it newVal==oldvalue.
has comment: http://stackoverflow.com/comment/38938904

http://stackoverflow.com/comment/38783039
comment on: http://stackoverflow.com/q/24953377
has text: @user3154108 I have this now:`success: function (result) { $('#app-status-ul').hide(); ajax.parseJSONP(result); $("form").submit(function() {alert( "Submited form" ); });` but I still don't see the alert "Submitted form" },`
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25072887
answers question: http://stackoverflow.com/q/25050579
type: AcceptedAnswer
type: Answer
has body: There is no way in the API to suppress spawning tooltips on mouseover when a tooltip spawned by a selection is present. You can turn off tooltips entirely, however, and implement your own custom tooltips with the requisite logic to control when you spawn one (which, since you would have complete control of the tooltip's construction, would also allow you to remove the MutationObserver that watches for new tooltips to adjust positioning). You can use the "select" and "onmouseover"/"onmouseout" events to spawn and remove tooltips. If you implement custom tooltips, you can use any logic you want to remove them. If you choose not to implement custom tooltips, you can remove tooltips spawned on select by clearing the chart's selection via the setSelection method: chart.setSelection(); // set the selection to null, which clears all selected points and tooltips You can call that from whatever event handler you like (as long as the chart object is within scope of the event handler).
accepted answer of: http://stackoverflow.com/q/25050579
score: 0

http://stackoverflow.com/a/24922429
has comment: http://stackoverflow.com/comment/38756343
score: 0
has body: You need to look into the HTML5's FileSystem. You need to create a file and push your array into it in JSON format. Fiddle window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; function errorHandler(err) { console.log("Error happened"); console.log(err); } var yourdata = [ ['mother', 'father', 'pet', 'age', 'hairLength'], ['Ellen', 'Bob', 'cat', 50, 10], ['Sandra', 'Jeff', 'dog', 18, 2] ]; function onInitFs(fs) { fs.root.getFile('data.json', {create: true}, function(fileEntry) { fileEntry.createWriter(function(fileWriter) { fileWriter.onwriteend = function(e) { console.log('Write completed.'); }; fileWriter.onerror = function(e) { console.log('Write failed: ' + e); }; var json = JSON.stringify(yourdata); console.log(json); var blob = new Blob([json], {type: "application/json"}); fileWriter.write(blob); }, errorHandler); }, errorHandler); } window.webkitStorageInfo.requestQuota(PERSISTENT, 1024, function(grantedBytes) { // Is this a bug? This function is called instantly, i didn't even granted permission or anything. You need to refresh after granting permission. window.requestFileSystem(PERSISTENT, grantedBytes, onInitFs, errorHandler); }, errorHandler);
type: Answer
has comment: http://stackoverflow.com/comment/38756209
answers question: http://stackoverflow.com/q/24921292
has comment: http://stackoverflow.com/comment/38781520

http://stackoverflow.com/a/24911073
downvote count: 0
answers question: http://stackoverflow.com/q/24910918
type: Answer
score: 2
upvote count: 2
has body: To replace the input fields, just do exactly that: $("input[type='text'][value='On']").replaceWith(sOn); Your FIDDLE updated with above line.

http://stackoverflow.com/q/24995534
has answer: http://stackoverflow.com/a/25090232
has comment: http://stackoverflow.com/comment/38872403
score: 1
has body: What I tried to accomplish, when I type grunt into my cmd shell, is the following: start mongod start elasticsearch start nodemon when mongod and elasticsearch runs, execute load_JSON_into_elasticSearch.js (because I need a connection to both of them) when everything is done, open http://localhost:8080 in the system default browser The only thing what works at the moment is, that it'll start mongod, elasticsearch and nodemon. That's it... Gruntfile.js module.exports = function (grunt) { grunt.initConfig({ shell: { mongo: { command: 'mongod', options: { async: true } }, elasticsearch: { command: 'elasticsearch', options: { async: true } } }, nodemon: { dev: { script: 'server.js' } }, execute: { target: { src: ['load_JSON_into_elasticSearch.js'] } }, open: { dev: { path: 'http://localhost:8080', app: 'Google Chrome' } } }); grunt.loadNpmTasks('grunt-shell-spawn'); grunt.loadNpmTasks('grunt-nodemon'); grunt.loadNpmTasks('grunt-execute'); grunt.loadNpmTasks('grunt-open'); grunt.registerTask('startServices', ['shell', 'nodemon']); grunt.registerTask('indexAndBrowser', ['execute', 'open']); grunt.registerTask('default', 'Start it...', function() { var done = this.async(); grunt.log.writeln('\n===========================================\nStarting Mongod/ ElasticSearch/ Nodemon...\n===========================================\n'); var init = function () { grunt.task.run('startServices'); var process = function () { setTimeout(function () { grunt.log.writeln('\n==================================\nStarting Index and Browser...\n==================================\n'); grunt.task.run('execute'); }, 20000); }; process(); done(); }; init(); }); };
upvote count: 1
type: Question
tagged with: mongodb
tagged with: javascript
tagged with: gruntjs
tagged with: nodemon
has title: How to call multiple grunt.run.task within one grunt.registerTask?
answer count: 1
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: elasticsearch

http://stackoverflow.com/q/24917152
has comment: http://stackoverflow.com/comment/38718582
has comment: http://stackoverflow.com/comment/38714720
tagged with: checksum
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/41892567
tagged with: http://stackoverflow.com/tag/json
tagged with: javascript
has comment: http://stackoverflow.com/comment/38718607
tagged with: adler32
has answer: http://stackoverflow.com/a/24917186
type: Question
accepted answer: http://stackoverflow.com/a/24917186
score: 12
has title: How do I make a checksum from a JavaScript Object?
has comment: http://stackoverflow.com/comment/38715615
favorite count: 0
has answer: http://stackoverflow.com/a/24917465
has answer: http://stackoverflow.com/a/41892567
answer count: 3
has body: I need to make a checksum from a JavaScript Object. Unfortunately, there does not seem to be an easy way to accomplish this because of JavaScript's Object ordering. For example, take these Objects: var obj1 = {type:"cake",quantity:0} , obj2 = {quantity:0,type:"cake"}; I consider these Objects equal in data, and would like their checksums to be the same. I really don't care about the order of the Object just as long as the data in them is the same. Alas, JSON.stringify of both of them is actually not equal; as the only way to make a checksum of an Object is via its String representation, and the JSON.stringify-ed representations are not equal, my checksums will not be equal! One solution I have come up with is to recreate the Object based on a predefined schema, like so: var schema = ["type","quantity"]; function sortify(obj,schema){ var n={}; for(i in schema) n[schema[i]]=obj[schema[i]]; return n } Running JSON.stringify(sortify(obj1,schema))==JSON.stringify(sortify(obj2,schema)) will return true... but at the price of creating a new Object and shuffling around data. My other solution is to replace the JSON.stringify method with one that picks keys from a predefined schema and stringifying their values, then joining them together. The function reads: function smarterStringify(obj,schema){ var s=""; for(i in schema) s+=JSON.stringify(obj[schema[i]]); return s } Ignoring the fact that this method doesn't return correct JSON (it's close enough as an example of what I'm trying to do), it is a massive improvement over the first one in speed (at least in my Chrome OS browser, you can check it yourself here: http://jsperf.com/sort-then-json-stringify-vs-smarter-stringify), and of course it makes the two Object String representations equal! However, I was just wondering if I had missed something and there was a built-in method for something like this all along that didn't a) drive the JavaScript GC into a pathological case or b) do way too many String concatenations. I'd ra…
has comment: http://stackoverflow.com/comment/128185191
upvote count: 12
downvote count: 0

http://stackoverflow.com/q/25044543
score: 1
has body: I have a gif that appears as my site is loading however the gif dissapers and the page appears after everything has loaded except the background images called via css. How could I have the gif fade away only after the background images have loaded. I am using this code for the loader: html: &lt;html class="loading"&gt; &lt;!-- All the things --&gt; &lt;/html&gt; css: html { -webkit-transition: background-color 1s; transition: background-color 1s; } html, body { /* For the loading indicator to be vertically centered ensure */ /* the html and body elements take up the full viewport */ min-height: 100%; } html.loading { /* Replace #333 with the background-color of your choice */ /* Replace loading.gif with the loading image of your choice */ background: #333 url('loading.gif') no-repeat 50% 50%; /* Ensures that the transition only runs in one direction */ -webkit-transition: background-color 0; transition: background-color 0; } body { -webkit-transition: opacity 1s ease-in; transition: opacity 1s ease-in; } html.loading body { /* Make the contents of the body opaque during loading */ opacity: 0; /* Ensures that the transition only runs in one direction */ -webkit-transition: opacity 0; transition: opacity 0; } javascript // IE10+ document.getElementsByTagName( "html" )[0].classList.remove( "loading" ); // All browsers document.getElementsByTagName( "html" )[0].className.replace( /loading/, "" ); // Or with jQuery $( "html" ).removeClass( "loading" ); Thank you
upvote count: 1
has comment: http://stackoverflow.com/comment/38955242
type: Question
has comment: http://stackoverflow.com/comment/38954902
has comment: http://stackoverflow.com/comment/38955132
has title: Loading Gif Page Does not load background images
downvote count: 0
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38956241
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25044657
has comment: http://stackoverflow.com/comment/38955285
tagged with: loader
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38955097
tagged with: css
has comment: http://stackoverflow.com/comment/38955505
has comment: http://stackoverflow.com/comment/38955067

http://stackoverflow.com/comment/38914770
score: 0
type: Comment
type: QuestionComment
has text: @JordanD Thanks for reply! How exactly would that look like in code?
comment on: http://stackoverflow.com/q/25023199

http://stackoverflow.com/comment/38793298
has text: Sure - [here you go](https://www.mapbox.com/mapbox.js/example/v1.0.0/fit-map-to-markers/)
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24958553
type: Comment

http://stackoverflow.com/a/39174073
answers question: http://stackoverflow.com/q/24912021
has comment: http://stackoverflow.com/comment/96912118
score: 3
has body: Here is my solution for the same problem. let logo = null; getDataUri(imgUrl, function(dataUri) { logo = dataUri; console.log("logo=" + logo); }); function getDataUri(url, cb) { var image = new Image(); image.setAttribute('crossOrigin', 'anonymous'); //getting images from external domain image.onload = function () { var canvas = document.createElement('canvas'); canvas.width = this.naturalWidth; canvas.height = this.naturalHeight; //next three lines for white background in case png has a transparent background var ctx = canvas.getContext('2d'); ctx.fillStyle = '#fff'; /// set white fill style ctx.fillRect(0, 0, canvas.width, canvas.height); canvas.getContext('2d').drawImage(this, 0, 0); cb(canvas.toDataURL('image/jpeg')); }; image.src = url; } Then to generate the pdf var doc = new jsPDF(); let left = 15; let top = 8; const imgWidth = 100; const imgHeight = 100; doc.addImage(logo, 'PNG', left, top, imgWidth, imgHeight); doc.output('dataurlnewwindow'); //opens pdf in new tab
upvote count: 3
type: Answer
downvote count: 0

http://stackoverflow.com/comment/38810668
type: Comment
comment on: http://stackoverflow.com/q/24968285
score: 0
type: QuestionComment
has text: http://stackoverflow.com/questions/14220321/how-to-return-the-response-from-an-ajax-call

http://stackoverflow.com/q/25034111
type: Question
tagged with: javascript
tagged with: extjs
has comment: http://stackoverflow.com/comment/38938577
score: 0
has answer: http://stackoverflow.com/a/25039993
answer count: 1
type: UnansweredQuestion
has title: How to set the form into the window in extjs
has body: I am a new in extjs and I prepared one login form. I used that form into the Ext.window.Window but when it display on browser its showing separately var win = new Ext.window.Window({ renderTo: Ext.get('main'), items: form, }); win.show();

http://stackoverflow.com/q/25059513
answer count: 2
has comment: http://stackoverflow.com/comment/38982344
downvote count: 1
has body: I have two input, textarea (name + comment) and Submit button. Onclick should post text from input and textarea. I use appendchild(), but need to call textarea. 1. How should I do it? 2. Button "Delete" remove all post, but I need delete just the last one. So how it is possible? Thank you for any tips. There is the code: Name: Comment:
favorite count: 0
has answer: http://stackoverflow.com/a/25059597
has comment: http://stackoverflow.com/comment/38982411
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has title: Appendchild() with two inputs, and removing latest post
has answer: http://stackoverflow.com/a/25059877
score: 1
type: Question
tagged with: javascript
upvote count: 2

http://stackoverflow.com/q/24966276
tagged with: javascript
has body: How, using bootstrap, I can align all div elements on the red line? Incorrect: Correct: Content in div may not be same and this is a problem. Divs where content is few paragraphs in the middle. Where a lot of text otherwise. And I need to put all divs top edges on the all pages to a one position.
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38807080
tagged with: css
favorite count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion
tagged with: positioning
upvote count: 1
has answer: http://stackoverflow.com/a/24967021
has title: How to fix divs alignment using Bootstrap
has comment: http://stackoverflow.com/comment/38808367
score: 1
has comment: http://stackoverflow.com/comment/38806975
type: Question
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24966907

http://stackoverflow.com/a/25046206
has body: I was able to solve this. The order of adding elements to the $document and $compiling is crucial here. The problem with the initial code is that the $compile of the myDirective element happened after the element was added to the $document. The correct test code would be - beforeEach(inject(function ($compile, $rootScope, $document) { var scope = $rootScope.$new(); var element = $compile('&lt;div id="inputId"&gt;&lt;/div&gt;')(scope); angular.element($document[0].body).append(element); var myDirective = $compile('&lt;div my-directive my-directive-attr="inputId"&gt;&lt;/div&gt;')(scope); }); The code in the 'link' method is triggered as the myDirective element is compiled. Thus we needed to ensure that the initial element has already been added to the $document before we call $compile. This assures 'element' to be available during the link phase of the directive. As an aside, note that for testing purposes, the myDirective element doesn't actually need to be added to $document.
score: 1
accepted answer of: http://stackoverflow.com/q/25039243
answers question: http://stackoverflow.com/q/25039243
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0

http://stackoverflow.com/a/57194382
score: -1
upvote count: 0
answers question: http://stackoverflow.com/q/24928846
has body: You can use a combination of Promise and setTimeOut like the example below let f1 = function(){ return new Promise(async function(res,err){ let x=0; let p = new Promise(function(res,err){ setTimeout(function(){ x= 1; res(x); },2000) }) p.then(function(x){ console.log(x); res(x); }) }); }
type: Answer
downvote count: 1

http://stackoverflow.com/a/24917339
answers question: http://stackoverflow.com/q/24917188
score: 1
type: AcceptedAnswer
has body: $("#txtName").val($('#' + $(elem).closest('table').attr('id')+"_cname").text()); Should solve it. You were trying to get an element by id without "#", and trying to get val() of a td. I put the # and changed val() to text().
has comment: http://stackoverflow.com/comment/38716114
type: Answer
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24917188
downvote count: 1
has comment: http://stackoverflow.com/comment/38715364

http://stackoverflow.com/a/24977640
has comment: http://stackoverflow.com/comment/38828243
downvote count: 1
has comment: http://stackoverflow.com/comment/38828418
has comment: http://stackoverflow.com/comment/38828445
has comment: http://stackoverflow.com/comment/38828232
has comment: http://stackoverflow.com/comment/38828405
has comment: http://stackoverflow.com/comment/38828304
has comment: http://stackoverflow.com/comment/38828216
score: 1
answers question: http://stackoverflow.com/q/24977624
has comment: http://stackoverflow.com/comment/38828455
upvote count: 2
type: Answer
has body: You can do it with the below code: function setVal() { var content = document.getElementById('test').value; document.getElementById('result').innerHTML = content.replace(/\n/g, '&lt;br/&gt;'); } Explanation: Basically, the need is to convert the \n characters to their equivalent HTML line breaks using &lt;br/&gt;. Demo

http://stackoverflow.com/comment/38923559
type: AnswerComment
comment on: http://stackoverflow.com/a/25027913
score: 0
type: Comment
has text: @KennethEspinal Can you get the full json object retrieved stored in allPersons (e.g., using alert) and post it here?

http://stackoverflow.com/comment/38739414
has text: Do you know how I would get it?
type: Comment
comment on: http://stackoverflow.com/a/24929870
type: AnswerComment
score: 0

http://stackoverflow.com/a/25066330
has body: You could also use the form property of HTMLButtonElement object: // property var path = button.prop('form').action; // attribute var path = button.prop('form').getAttribute('action');
score: 0
answers question: http://stackoverflow.com/q/25066120
type: Answer

http://stackoverflow.com/comment/38771572
has text: Please see my update with a link to JFiddle project. Hope you can fix it there.
type: AnswerComment
comment on: http://stackoverflow.com/a/24946097
score: 0
type: Comment

http://stackoverflow.com/q/24993051
downvote count: 0
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24993209
favorite count: 0
has title: How to set height Or Padding in select box (dropdown box) for safari and chrome?
tagged with: http://stackoverflow.com/tag/html
tagged with: css
linked to: http://stackoverflow.com/q/8430279
answer count: 4
tagged with: safari
has answer: http://stackoverflow.com/a/24993243
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38857319
linked to: http://stackoverflow.com/q/12836227
has body: I want to set height or width in selectbox . <?php $subjectList=array('0'=>'Questions','1'=>'Feedback / Suggestions','2'=>'Location Owner Inquiry' ,'3'=>'Other');?> -Select One- <?php foreach($subjectList as $r=>$k) { ?> <option value="<?php echo $r?>" ><?php echo $k?> <?php }?> Padding and height is not working in SAFARI. So suggest some solution.
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24993284
has answer: http://stackoverflow.com/a/24993209
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24993284
linked to: http://stackoverflow.com/q/13252835
has comment: http://stackoverflow.com/comment/38857938
has answer: http://stackoverflow.com/a/38222194

fancybox-2
tags question: http://stackoverflow.com/q/24920636
type: Tag
tag name: fancybox-2
tags question: http://stackoverflow.com/q/25066402

http://stackoverflow.com/a/25026283
upvote count: 2
score: 2
answers question: http://stackoverflow.com/q/25023170
has body: The rest of the answers have covered everything, but to get the element to shape like a bullet use: border-radius: 10px 10px 0 0; But match the size and sides to your likings.
downvote count: 0
type: Answer

dc.js
tag name: dc.js
tags question: http://stackoverflow.com/q/25018365
tags question: http://stackoverflow.com/q/24953359
tags question: http://stackoverflow.com/q/24979512
tags question: http://stackoverflow.com/q/24914698
tags question: http://stackoverflow.com/q/25047163
tags question: http://stackoverflow.com/q/25020829
type: Tag
tags question: http://stackoverflow.com/q/25026010
tags question: http://stackoverflow.com/q/25023221
tags question: http://stackoverflow.com/q/24915507

http://stackoverflow.com/comment/38972678
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25053532
type: QuestionComment
has text: @Lars Kotthoff Would this do it dynamically though so when we went to a new month would it switch to that month? if not is there a way that this is possible? Thanks

http://stackoverflow.com/comment/38931197
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25029940
has text: hi alexP, thanks for the reply but seems to be it's not working correctly. i have updated your demo with height in inner div check this out. http://jsfiddle.net/gayancc/7pLEK/8/
score: 0

http://stackoverflow.com/comment/38889653
score: 2
comment on: http://stackoverflow.com/q/25010289
has text: Sounds like horrible UX. Why would you want to display an error message as the contents of an input field? Nobody does that, with good reason.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25013661
tagged with: requirejs
upvote count: 1
has title: AMD: concurrent resources in module loading
has body: Let's say I have an application that load a module myModule. Said module needs some other resources to work (a template, for example), so it's neat that myModule cares to load the resources it needs. And it's quite easy, actually: // main.js require(["myModule"], function(myModule) { // ... }); // myModule.js define(["mustache", "text!myTemplate.mt"], function(mt, template) { // ... }); However, what happens here is that first the module's script is loaded, then the script loads the resources it needs. What I'd like to achieve is to start to load myModule and myTemplate at the same moment in order to save time. I managed to do so by preloading the resources in main.js: // main.js require(["myModule", "text!myTemplate.mt"], function(myModule) { // ... }); Is there a more elegant way to do so? Granted that I don't think there's a way to avoid that main.js must "know" myModule's dependencies. Another problem What if myModule doesn't require its resources, but rather they're granted to the module? Just like, "I require myModule, and it can use template1 and template3". I thought that configuring require with some config would do the trick: // main.js var templatesForMyModule = [...] require.config({ config: { myModule: templatesForMyModule } }); // myModule.js define(["module", "mustache"], function(module, mt) { var templates = module.config(); // ... }); The problem here is that I either pass the templates' paths - which would be loaded after myModule is loaded, thus leading to the initial problem - or the templates' contents, but that would imply that I have to load the templates before myModule, and that's another thing I'd like to avoid. Sadly, I can't do require.config({ config: { myModule: require(templatesForMyModule) } }); and then, magically, retrieve the templates' contents inside myModule.js. A solution would be: myModule returns a callback function that main calls after the resources are loaded, passing the resources to the callback. But that would change s…
score: 1
has answer: http://stackoverflow.com/a/25033553
tagged with: amd
has comment: http://stackoverflow.com/comment/38908167
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
type: UnansweredQuestion

http://stackoverflow.com/q/24939945
type: Question
has comment: http://stackoverflow.com/comment/38758295
tagged with: window
downvote count: 0
tagged with: javascript
has title: Window.close isn't working in chrome, neither are the hacky work-arounds
upvote count: 1
tagged with: asp.net
favorite count: 0
has body: I am attempting to use a button to close a window in Javascript. Before the user encounters this button they go through three different aspx pages. Every one of these pages is opened using window.open() that I factored out to one Javascript file. However, when I attempt to use my close function (defined in that same javascript file) the console gives me the message "Scripts may close only the windows that were opened by it.". I have tried using the hacky work around: window.open('','_self',''); window.close(); but that doesn't work. I'm fairly sure Google patched that. Along with that I have tried window.opener.close() to no avail either. Here is my factored out code in the Javascript file: function openWindow(windowLocation) { window.open(windowLocation, '_self'); } function closeWindow() { window.close(); } These functions are the ONLY functions used to open new pages. Any help? Edit: Every page also has the same document.domain property if thats any help. Other things I have tried: Using HttpContext.Current.Response.Redirect("javascript:window.close();"); Using window.location = "javascript:window.close()";
answer count: 0
type: UnansweredQuestion
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38758396
score: 1
has comment: http://stackoverflow.com/comment/38758781
has comment: http://stackoverflow.com/comment/38758032

http://stackoverflow.com/comment/38855426
comment on: http://stackoverflow.com/q/24991697
has text: `matrixData.Data[y]`?
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38724310
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24922049
has text: I'd have to double-check, but I imagine that this would mess up basic stuff like `for in` loops on objects, which many third-party vendors probably assume are safe to use.

http://stackoverflow.com/comment/38725299
type: Comment
type: QuestionComment
has text: Not related to question, but your code is vulnerable to XSS attack. You need to HTML encode all values you add to HTML
comment on: http://stackoverflow.com/q/24922495
score: 0

http://stackoverflow.com/q/24992162
has answer: http://stackoverflow.com/a/24992321
tagged with: css
has title: SVG Chrome FireFox difference use defs elements, relations between figures
tagged with: http://stackoverflow.com/tag/svg
has body: I'm searching for a week a solution to solve a problem. When I'm open a page with Chrome and FireFox I've got a diffrences: *DOM structure works well in FireFox, not in Chrome; *Video-animation works well in Chrome, not in FireFox: by pressing not only on clock-wing, but also to button. Thank you, and I apologize for the size of the file. I'll be happy in you help to solve even one of these problems <g id="active_element_button"> <g id="blinker.red"> <animate attributeName="fill" begin="0s" dur="0.5s" values ="white; #E2F9E5; white;" repeatCount="indefinite" /> <animate attributeName="fill" begin="mouseover" end="mouseout" dur="1.5s" values ="#ACF0B6; #3EDB53;" repeatCount="indefinite" /> <set attributeName="fill" to="#16D430" begin="mousedown" end="mouseout" /> <g onclick="blinker_open(this, 700)" cursor="pointer"> <g> <set attributeName="fill" to="white" begin="mouseover" end="mouseout"/> <set attributeName="fill" to="#D9D9D9" begin="mousedown" end="mouseout" /> <set attributeName="fill" to="white" begin="mouseover" end="mouseout"/> <set attributeName="fill" to="#D9D9D9" begin="mousedown" end="mouseout" /> <set attributeName="fill" to="white" begin="mouseover" end="mouseout"/> <set attributeName="fill" to="#D9D9D9" begin="mousedown" end="mouseout" /> </g> <g> <g transform="translate(0.2, 0.3)"> <polygon style="fill:#808080;stroke:#666666;stroke-width:3;stroke-linejoin:bevel;stroke-miterlimit:10;" points="-8.762,15.419 -8.926,-0.842 5.238,-8.83 19.568,-0.557 19.732,15.704 5.568,23.691 "/> </g> </g> <animateTransform begin="click" attributeName="transform" type="rotate" additive="replace" from="0 5.75 8" to="-59 5.75 8" dur="0.7s" fill="freeze" /> <animateTransform begin="diffrFig1.click" attributeName="transform" type="rotate" additive="replace" from="0 5.75 8" to="-59 5.75 8" dur="0.7s" fill="freeze" /> </g> </g> <g id="blinker.green"> <set attributeName="fill" to="#FF3333" begin="mouseover" end="mouseout"/> <animate attributeName="fill" begin="0s" dur="0.5s" valu…
tagged with: google-chrome
type: Question
tagged with: javascript
score: 0
tagged with: firefox
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/q/25003810
has comment: http://stackoverflow.com/comment/38878631
answer count: 1
tagged with: javascript
tagged with: zooming
score: 0
has body: I saw this question and found it helpful, but I tried doing more with the code to apply zoom buttons and can't seem to get it to work properly. I'm new to javascript and jquery and I'm having trouble understanding how the "this" keyword is applied. $('#plus').click( function( event ){ var scale = 150/100; var pos = $('#Container img').offset(); var clickX = event.pageX - pos.left; var clickY = event.pageY - pos.top; var container = $('#Container img').parent().get(0); $('#Container img').css({ width: this.width*scale, height: this.height*scale }); container.scrollLeft = ($(container).width() / -2 ) + clickX * scale; container.scrollTop = ($(container).height() / -2 ) + clickY * scale; } ); $('#minus').click( function( event ){ var scale = 100/150; var pos = $('#Container img').offset(); var clickX = event.pageX - pos.left; var clickY = event.pageY - pos.top; var container = $('#Container img').parent().get(0); $('#Container img').css({ width: this.width*scale, height: this.height*scale }); container.scrollLeft = ($(container).width() / -2 ) + clickX * scale; container.scrollTop = ($(container).height() / -2 ) + clickY * scale; } ); I made a jsfiddle to demo my code.
accepted answer: http://stackoverflow.com/a/25004572
has comment: http://stackoverflow.com/comment/38879756
has comment: http://stackoverflow.com/comment/38878531
has comment: http://stackoverflow.com/comment/38878456
tagged with: css
type: AnsweredQuestion
has title: Scale and zoom an image
has answer: http://stackoverflow.com/a/25004572
has comment: http://stackoverflow.com/comment/38877786
tagged with: scaling
type: Question

http://stackoverflow.com/a/25049336
has body: This line: data: "myid=" data, Should be data: "myid=" + data, The "+" operator concatenates the two strings together.
answers question: http://stackoverflow.com/q/25049306
type: Answer
has comment: http://stackoverflow.com/comment/38965269
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25049306

http://stackoverflow.com/q/24916538
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24916659
downvote count: 0
score: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/24916880
type: Question
possible better answer: http://stackoverflow.com/a/24916634
has answer: http://stackoverflow.com/a/24916634
answer count: 3
has body: I currently have some js for phone number validation that is using inline event listeners in the input field. I need to change this example so that instead of attaching the event listeners inline, I would be targeting the DOM element in jQuery and adding the event listeners. Here's a working example of what I have so far: http://jsfiddle.net/yVdgL/21/ window.mask = function (e,f){ var len = f.value.length; var key = whichKey(e); if((key&gt;=47 &amp;&amp; key&lt;=58) || (key&gt;=96 &amp;&amp; key&lt;=105)) { if( len==1 )f.value='('+f.value else if(len==4 )f.value=f.value+')' else if(len==8 )f.value=f.value+'-' else f.value=f.value; } } function whichKey(e) { var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; return code } and &lt;input type="text" name="phone" id="phone" onkeydown="mask(event,this)" onkeyup="mask(event,this)" maxlength="13" /&gt; I tried this but was unable to achieve the functionality that I need.
upvote count: 1
has answer: http://stackoverflow.com/a/24916880
has title: JS onkeydown/onkeyup - convert to jQuery keydown/keyup
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25052584
favorite count: 0
has body: I want to display some message without using alert box if associateID is null. If possible can we do it using jquery? but I don't know how to write code using jquery. I want to display message in same page but don't want to use alert box. function retrieveAssociate() { //alert("in retrive associate"); var associates = document.getElementsByName("resourceId"); var associateID = null; for (var i = 0; i &lt; associates.length; i++) { if (associates[i].checked) { associateID = associates[i].value; break; } } if(associateID==null) { //in this part i need to put my logic to display message //here i want to display some message without using alert box if associateID is null //alert("Please select associate ID"); } else { } }
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
score: -1
has title: have to display some message if no any radio button is selected and submit button is clicked
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25052654
tagged with: javascript
has comment: http://stackoverflow.com/comment/38969522
upvote count: 0
answer count: 1
tagged with: jquery

http://stackoverflow.com/q/25052092
answer count: 2
has title: How to open a window and close another window when a button is pressed with javascript?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25052278
score: 0
has body: I am in quite a bind right now! You will notice in the Demo provided below that when you click the black button a window appears with another button in it. What I am trying to achieve is when you click the light gray button it will shut that whole window from the black button and open a whole new window! Below I will have some code and a demo! HTML CDN CSS #sidemenu { width: 60px; max-height: 100%; min-height: 100%; min-width: 60px; max-width: 60px; background-color: #383D3F; background-size: 100% 100%; background-attachment: fixed; position: absolute; left: -60px; transition: left ease-in-out 0.5s; top: 0; } #sidemenu.show { left: 0; } #regionsContainer { width: 60px; height: 100%; min-height: 100%; min-width: 60px; max-width: 60px; max-height: 100%; background-color: #383D3F; position: absolute; top:25%; } #regionsUnitedStates { width: 60px; height: 60px; background-color:#111111; } #regionsUnitedStatesTooltip { opacity:0; background-color:#000; height:60px; width:180px; left:100px; position:absolute; transition:all ease-in-out 0.25s; top:0; visibility:hidden; } #regionsUnitedStates.not-open:hover #regionsUnitedStatesTooltip{ left: 60px; opacity:1; visibility:visible; } #regionsUnitedStates:hover { background-position:bottom; } #regionsUnitedStatesChooseState{ position:absolute; transition:all ease-in-out 0.25s; left: -500px; width: 500px; height: 100%; background: #505759; top:0; z-index:-1; } #regionsUnitedStatesChooseState.show { left: 60px; z-index:-1; } #regionsCanada { width: 60px; height: 60px; background-color:#666; } #regionsCanadaTooltip { opacity:0; background-color:#000000; height:60px; width:120px; left:100px; position:absolute; transition:all ease-in-out 0.25s; top:60px; visibility:hidden; } #regionsCanada.not-open:hover #regionsCanadaTooltip{ left: 60px; opacity:1; visibility:visible; } #regionsCanada:hover { background-position:bottom; } #regionsCanadaChooseProvince{ position:absolute; transition:all ease-in-out 0.25s; left: -500px; width: 500px; h…
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/25052153
accepted answer: http://stackoverflow.com/a/25052153
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25052278
type: Question

http://stackoverflow.com/a/25012063
upvote count: 3
downvote count: 0
has body: One valid approach is to "flag" the .dropped tag element when the mouse is enter. Finally, when you move .dragged, you can check is .dropped has the tag you put into them. $('.dropped').hover(function() { $(this).addClass('hovered'); }, function() { $(this).removeClass('hovered'); }); $('.dragged').mousemove(function(e) { ... if($(".dropped").hasClass(".hovered")) { ... } }); Regards.
type: Answer
answers question: http://stackoverflow.com/q/25011915
score: 3

http://stackoverflow.com/comment/38811197
type: Comment
type: QuestionComment
has text: Can I just say that rather than paste code, a function I tried for my faq page came from [link]http://forums.phpfreaks.com/topic/162195-solved-multiple-stylevisibility-set/[/link] if that is any good. But as I say, I could not get a link in my home page to open a specific answer on the faq page.
comment on: http://stackoverflow.com/q/24968075
score: 0

http://stackoverflow.com/q/25009824
has comment: http://stackoverflow.com/comment/38889170
has body: I'm no javascript expert and I'm trying to find out how I can ensure my functions are available for all my pages. My setup: index.php > my main page where I load my javascript functions sl.php > a back end script sending html back $(document).ready( function ButtonManager() { $( "button" ).click(function() { $.ajax ({ type: 'POST', url: 'php/sl.php', data: 'test=1', cache: false, async: false, dataType: 'html', success: function(result) { $('#mydiv').html(result); } }); } }); &lt;/pre&gt; In my index.php, I have a button that triggers this function and it works fine. Basically it retrieves some html containing other buttons using the same function as the one described above. The problem is that the function declared in index.php does not seem to be known by the html I get back from sl.php Is there a way to make my ButtonManager function available for the html code that comes back from the server ? The html I get back from the server is inserted in the page where the function is declared. UPDATE 29/07 : Here is an example of the buttons I use TEST I have such a button in index.php and when I click on it, it posts test=1 to sl.php In return I get some content that I insert into #mydiv. The process works fine except that buttons included in the sl.php output do not react at all when I click on them. TJ Crowder: I have tried your solution (the one without the ready tag) but now even the buttons in index.php don't react any more. Here is a simplified version to clear any interferences with something else. var MyApp; MyApp = MyApp || {}; (function() { MyApp.ButtonManager = ButtonManager; function ButtonManager() { $("button").click(function() { alert ('oo'); }); } })(); In the end, the only thing I would like to do is have one location to manage all buttons with sometimes buttons being used in index.php sometimes elsewhere. Thanks! Laurent
downvote count: 3
has comment: http://stackoverflow.com/comment/38888956
has comment: http://stackoverflow.com/comment/38888804
type: Question
has title: Javascript Function scope / accessibility
tagged with: function
has answer: http://stackoverflow.com/a/25024192
tagged with: javascript
has comment: http://stackoverflow.com/comment/38908115
has comment: http://stackoverflow.com/comment/38890022
answer count: 2
upvote count: 0
has comment: http://stackoverflow.com/comment/38888910
favorite count: 0
has comment: http://stackoverflow.com/comment/38889227
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38889714
score: -3
has answer: http://stackoverflow.com/a/25009869

http://stackoverflow.com/q/24983138
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24983227
type: AnsweredQuestion
has title: How to remove character in html with jQuery
possible better answer: http://stackoverflow.com/a/24983227
type: Question
answer count: 2
has body: Here is the html: Remember me Forget? | <-------- **** I want to remove this character**** Register Is There is a way to remove this character "|" from the above html with jQuery or CSS?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24983188
accepted answer: http://stackoverflow.com/a/24983188

http://stackoverflow.com/comment/38888757
has text: i got it yesterday only.thanks you all for replay and valuable time.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24995173

http://stackoverflow.com/a/24938118
has comment: http://stackoverflow.com/comment/38755523
has body: Actually datauri is only partially supported by IE. You can't reference any file but images, stylesheets and since IE10 javascript. If you want to deliver your CSV, you have to use a server-side script which generates the CSV on the fly. Source: http://caniuse.com/datauri I can give you examples on how to create CSV files with PHP or other languages on the fly if you want to.
accepted answer of: http://stackoverflow.com/q/24938042
has comment: http://stackoverflow.com/comment/38754988
type: Answer
has comment: http://stackoverflow.com/comment/38755293
answers question: http://stackoverflow.com/q/24938042
has comment: http://stackoverflow.com/comment/38755766
has comment: http://stackoverflow.com/comment/38754491
has comment: http://stackoverflow.com/comment/38755135
has comment: http://stackoverflow.com/comment/38755399
has comment: http://stackoverflow.com/comment/38755228
has comment: http://stackoverflow.com/comment/38754426
has comment: http://stackoverflow.com/comment/38754341
score: 0
has comment: http://stackoverflow.com/comment/38754848
type: AcceptedAnswer

http://stackoverflow.com/a/24957770
answers question: http://stackoverflow.com/q/24957648
has comment: http://stackoverflow.com/comment/38790720
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38790624
has body: As I pointed in the comment, you should change $scope.query = Query.query(); to $scope.queries = Query.query();, as you are using ng-repeat over queries. However, there are another error. You must change app.factory('Query', ['$resource', function($resource) { return $resource('/api', null, { 'update': { method:'PUT' } }); }]); to app.factory('Query', ['$resource', function($resource) { return $resource('/api/query', null, { 'update': { method:'PUT' } }); }]); When you call Query.query() you are requesting a HTTP GET to /api, while you want to request to /api/query.
score: 1
has comment: http://stackoverflow.com/comment/38791106

http://stackoverflow.com/comment/38757876
score: 1
type: Comment
comment on: http://stackoverflow.com/q/24940084
type: QuestionComment
has text: Why not use `overflow:hidden` on the outer `div` and position the inner `div` where you want it?

http://stackoverflow.com/q/25027104
favorite count: 0
has comment: http://stackoverflow.com/comment/38921977
has answer: http://stackoverflow.com/a/25027601
upvote count: 2
has body: I have a job board website/script that uses 3rd party content that I collect from an XML feed. When the applicant hits the apply button for a job, an iframe opens but they are redirected to another website to apply. I would like the domain in the iframe to stay the same as my domain so they would appear to be applying on my domain. I tried changing: window.location = '&lt;?php echo jb_escape_html($data['app_url']);?&gt;'; To $('iframe').attr('src','&lt;?php echo jb_escape_html($data['app_url']);?&gt;'; But the iframe does not load the redirected url and gives a blank page as output. please help me overcome this hurdle. Here is the original code // redirect the user to a custom URL jb_app_redirect_script($data); } elseif (JB_ONLINE_APP_SIGN_IN!='YES') { // users can apply without logging in jb_app_redirect_script($data); } } function jb_app_redirect_script(&amp;$data) { ?&gt; &lt;script type="text/javascript"&gt; function js_redirect() { // //parent.window.location = 'http://www.cnn.com/'; window.location = '&lt;?php echo jb_escape_html($data['app_url']);?&gt;'; } window.onload = js_redirect; &lt;/script&gt; &lt;?php } $JBMarkup-&gt;body_close(); $JBMarkup-&gt;markup_close();
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/9393532
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/38921945
score: 2
tagged with: iframe
type: Question
has title: redirect a page into an iframe using jQuery
tagged with: javascript
has comment: http://stackoverflow.com/comment/38921957
has comment: http://stackoverflow.com/comment/38922387
downvote count: 0
has comment: http://stackoverflow.com/comment/38922011
answer count: 1
tagged with: jquery

http://stackoverflow.com/comment/38905727
has text: Thank you for actually providing an answer to my question
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25018470
type: AnswerComment

http://stackoverflow.com/a/24942517
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24941859
answers question: http://stackoverflow.com/q/24941859
has body: ;TLDR: &lt;head&gt; is ignored on internal pages when using jQuery Mobile. To use jQuery Mobile with external styles and scripts, you're going to have to load the same set of scripts and styles to every page, per the documentation.
has comment: http://stackoverflow.com/comment/38763328
score: 0

callback
tags question: http://stackoverflow.com/q/24984774
tags question: http://stackoverflow.com/q/24972729
tag name: callback
tags question: http://stackoverflow.com/q/24937378
tags question: http://stackoverflow.com/q/24985023
tags question: http://stackoverflow.com/q/25042892
tags question: http://stackoverflow.com/q/25051864
tags question: http://stackoverflow.com/q/24935498
tags question: http://stackoverflow.com/q/25025910
tags question: http://stackoverflow.com/q/24961988
tags question: http://stackoverflow.com/q/24963151
tags question: http://stackoverflow.com/q/25000889
tags question: http://stackoverflow.com/q/24982701
tags question: http://stackoverflow.com/q/24963580
tags question: http://stackoverflow.com/q/24978423
tags question: http://stackoverflow.com/q/24944409
tags question: http://stackoverflow.com/q/25050267
tags question: http://stackoverflow.com/q/24926146
tags question: http://stackoverflow.com/q/24962655
tags question: http://stackoverflow.com/q/25025984
type: Tag
tags question: http://stackoverflow.com/q/24932436

http://stackoverflow.com/q/24938260
has answer: http://stackoverflow.com/a/24939211
tagged with: audio
has title: Inline audio play/pause on text link
has body: Here's what I have so far from piecing together a few different methods I found: http://192.185.121.49/~steveobr/ I need all the voice demos to work like the first one "Commercial" As you can see on the live example, every link is currently tied to the same function. I can write a different function for each line but I assume there is a better way to do this in one function. Here's my code so far: Commercial Narration Promo TV Affiliate Radio
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38754702
score: 0
has comment: http://stackoverflow.com/comment/38755740
has comment: http://stackoverflow.com/comment/38755746
has comment: http://stackoverflow.com/comment/38755843
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38755759
has comment: http://stackoverflow.com/comment/38755642
type: UnansweredQuestion

http://stackoverflow.com/comment/38734239
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24926827
has text: Its there in the Fiddle. The first line in my JS code.
score: 0

http://stackoverflow.com/comment/38797409
type: Comment
type: QuestionComment
has text: Looks very similar to http://stackoverflow.com/questions/14207496/javascript-recursion-completes-before-traversing-the-whole-tree
score: 0
comment on: http://stackoverflow.com/q/24961131

http://stackoverflow.com/comment/38778965
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24950591
has text: @florin.prisecariu yes my friend. I want shadow to be inside the photo.

http://stackoverflow.com/comment/38829377
score: 0
has text: First, figure out if it's a problem with the web view or the html. Use a simple hello world `htmlContent` and see if it works.
type: Comment
comment on: http://stackoverflow.com/q/24977964
type: QuestionComment

http://stackoverflow.com/q/24936937
has comment: http://stackoverflow.com/comment/38756742
has comment: http://stackoverflow.com/comment/38752201
accepted answer: http://stackoverflow.com/a/24939542
has comment: http://stackoverflow.com/comment/38751778
has body: Is it possible to check the XMLHttpRequestObject.responseText value using if condition instead of just displaying it? I have tried like this. var a=XMLHttpRequestObject.responseText; if(a=="false") { document.getElementById("show_mark").innerHTML =a; } I know its wrong,but i need to do like this.Is there any other alternative way for doing this?Help me i am completely a newbie to AJAX.
has comment: http://stackoverflow.com/comment/38752509
has comment: http://stackoverflow.com/comment/38752506
has comment: http://stackoverflow.com/comment/38753408
answer count: 2
has comment: http://stackoverflow.com/comment/38752056
has comment: http://stackoverflow.com/comment/38753505
has comment: http://stackoverflow.com/comment/38752294
has title: is it possible to check the XMLHttpRequestObject.responseText value using if condition
tagged with: javascript
has comment: http://stackoverflow.com/comment/38752717
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24937692
tagged with: ajax
has comment: http://stackoverflow.com/comment/38752174
score: 0
has answer: http://stackoverflow.com/a/24937692
has comment: http://stackoverflow.com/comment/38752757
has comment: http://stackoverflow.com/comment/38751887
has comment: http://stackoverflow.com/comment/38751824
has comment: http://stackoverflow.com/comment/38751998
has answer: http://stackoverflow.com/a/24939542
has comment: http://stackoverflow.com/comment/38752404
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/38789507
type: Comment
type: QuestionComment
has text: Edited to follow the guidelines
comment on: http://stackoverflow.com/q/24955468
score: 0

http://stackoverflow.com/comment/38720859
type: QuestionComment
has text: Do not use inline events and the href....
comment on: http://stackoverflow.com/q/24920274
score: 0
type: Comment

http://stackoverflow.com/comment/38924765
type: Comment
has text: is there a way to do this if they are in different files, without global variables?
comment on: http://stackoverflow.com/a/25028706
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38933174
type: Comment
comment on: http://stackoverflow.com/a/25032037
type: AnswerComment
has text: I've kept forms.block.fields.rule as ng-model and it works like a charm. Thanks!
score: 0

http://stackoverflow.com/comment/38963792
type: Comment
type: QuestionComment
has text: Um, sounds like you are binding it multiple times/
comment on: http://stackoverflow.com/q/25049462
score: 0

http://stackoverflow.com/comment/39149549
comment on: http://stackoverflow.com/a/25029406
has text: Is there any way you can post code on this page with my code that will give a working timer. My whole view page is posted above
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38749600
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24935869
type: QuestionComment
has text: Booleans coerce to numbers 1 for true, and 0 for false. So just do a negated numeric conversion of your boolean result. `o = +!(i.css.('opacity') == 1)`

http://stackoverflow.com/q/24912334
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38710170
has title: Hiding data loaded in a filtered jQuery listview
has comment: http://stackoverflow.com/comment/38706286
has comment: http://stackoverflow.com/comment/38710839
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24912794
has comment: http://stackoverflow.com/comment/38706332
type: Question
has answer: http://stackoverflow.com/a/24912794
has body: I have a jQuery Mobile list view that loads &lt;li&gt; elements from a php file on the server into a listview. I have set this list filterable. However, what i want is that when the page loads the list should not appear. I tried data-filter-reveal="true" but this doesnot work when the page first loads. Here is my code structure: &lt;ul data-role="listview" data-filter="true" id="aa" data-filter-placeholder="Search ..."&gt; &lt;!-- Data loaded from server here --&gt; &lt;/ul&gt; &lt;script&gt; $(function(){ $.get( "file.php", function(data){ $('#aa').html(data) .listview('refresh'); }); }); &lt;/script&gt;

http://stackoverflow.com/q/24959684
possible better answer: http://stackoverflow.com/a/24960353
score: 0
has answer: http://stackoverflow.com/a/24960353
has comment: http://stackoverflow.com/comment/38794345
tagged with: quicksort
has comment: http://stackoverflow.com/comment/38794513
has comment: http://stackoverflow.com/comment/38849278
type: Question
has comment: http://stackoverflow.com/comment/38809144
type: AnsweredQuestion
has body: I'm trying to write a quicksort in javascript and display the sorted output. But Whenever I run the execute() function the program hangs and stopped responding. Why is this? I'm not so familiar with javascript and I just translated this from my java code. But I just don't see why it didn't work. Here the code. &lt;script type="text/javascript"&gt; function exchange(a, i, j) { var k = a[i]; a[i] = a[j]; a[j] = k; } function partition(a2, lo, hi) { var i2 = lo; var j2 = hi + 1; var v = a2[lo]; while (true) { while (a2[++i2] &lt; v) { if (i2 == hi) { break; } } while (v &lt; a2[--j2]) { if (j2 == lo) { break; } } if (i2 &gt;= j2) { break; } exchange(a2, i2, j2); } exchange(a2, lo, j2); return j2; } function sort(a3, lo2, hi2) { var j3 = partition(a3, lo2, hi2); sort(a3, lo2, j3 - 1); sort(a3, j 3+ 1, hi2); } function sort(a4) { sort(a4, 0, a.length - 1); } function execute() { var array = document.getElementById("texts").value.split(' '); sort(array); for (a in array) { document.write(array[a] + "&lt;br&gt;"); } } &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38794815
has answer: http://stackoverflow.com/a/24960111
has title: javascript crashing when running quicksort
answer count: 2
has comment: http://stackoverflow.com/comment/38795580
accepted answer: http://stackoverflow.com/a/24960111
tagged with: javascript
tagged with: sorting

http://stackoverflow.com/a/25034430
has comment: http://stackoverflow.com/comment/38934887
has comment: http://stackoverflow.com/comment/38935357
has comment: http://stackoverflow.com/comment/38935440
downvote count: 0
has comment: http://stackoverflow.com/comment/38934826
upvote count: 2
type: Answer
answers question: http://stackoverflow.com/q/25034229
has comment: http://stackoverflow.com/comment/38935473
has body: @Artem, Your code is fine, but it depends how you want your button be disabled. To disable using CSS(Your code): http://jsfiddle.net/L3G78/ Or you can use disabled attribute of HTML as: &lt;input id="one_click_button" disabled class="global-button" type="submit" value="Send" /&gt; or &lt;input id="one_click_button" disabled=disabled class="global-button" type="submit" value="Send" /&gt;
has comment: http://stackoverflow.com/comment/38935052
score: 2

http://stackoverflow.com/comment/38804340
comment on: http://stackoverflow.com/q/24964807
type: Comment
type: QuestionComment
has text: You need to give us more info..
score: 0

http://stackoverflow.com/a/24969643
score: 0
answers question: http://stackoverflow.com/q/24969616
has comment: http://stackoverflow.com/comment/38850095
has comment: http://stackoverflow.com/comment/38849207
has comment: http://stackoverflow.com/comment/38850574
type: Answer
has comment: http://stackoverflow.com/comment/38850770
has comment: http://stackoverflow.com/comment/38849748
has comment: http://stackoverflow.com/comment/38850545
has comment: http://stackoverflow.com/comment/38849511
has comment: http://stackoverflow.com/comment/38850516
has body: In order to change class using javascript you can do something like this: function ChangeSelectedMenuCss(id){ document.getElementByClassName('homeactive').className ="home"; document.getElementById(id).className = "homeactive"; }

http://stackoverflow.com/q/24965656
tagged with: email
downvote count: 0
answer count: 1
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: Send email with rails 4, mail form, and ajax?
accepted answer: http://stackoverflow.com/a/24965795
has body: I am working on an app that has a contact form. It is a single page app, and I am using rails on the backend, and angular (not for the form) and bootstrap on the front end. I am trying to use ajax so I do not have to refresh the page. When I just have it submit with rails (using Mailform), it looks like it is working. When I go into the console and type; c = Contact.new(:name => "name", :email => "email@email.com", :message => "hi") c.deliver In the console, I get; Rendered vendor/bundle/gems/mail_form-1.5.0/lib/mail_form/views/mail_form/contact.erb (2.9ms) MailForm::Notifier#contact: processed outbound mail in 29.2ms Sent mail to [EMAIL] (5.1ms) Date: Fri, 25 Jul 2014 14:52:20 -0700 From: Name <email@email.com> To: [EMAIL] Message-ID: <53d2d194c8870_ec73fe2d54606d42885a@localhost.mail> Subject: Onyx Contact Form Mime-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Onyx Contact Form Name: Name Email: email@email.com Message: Hi => true Which looks like it is working. However, I am not sure if it is, only because I am not getting anything to my email (but maybe email doesnt send locally?). When I try to submit with ajax and press "submit" nothing happens, so I know my javascript isn't right. Here is the rest of my code; index.html.erb <%= bootstrap_form_for @contact ||= Contact.new do, remote: true |f| %> <%= f.text_field :name, :required => true, :hide_label => true, :placeholder => "Name" %> <%= f.text_field :email, :required => true, :hide_label => true, :placeholder => "Email" %> <%= f.text_area :message, size: "60x10", :required => true, :hide_label => true, :plceholder => "Hello, we'd love to work with you" %> <%= f.submit 'Send Message', class: 'custom-button' %> contact.rb class Contact < MailForm::Base attribute :name, :validate => true attribute :email, :validate => /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i attribute :message attribute :nickname, :captcha => true # Declare the e-mail headers. It accepts anything the ma…
type: AnsweredQuestion
score: 3
upvote count: 3
tagged with: ruby-on-rails
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24965795

http://stackoverflow.com/a/25027990
has comment: http://stackoverflow.com/comment/39050684
type: Answer
has comment: http://stackoverflow.com/comment/38923857
score: 0
has body: if you want to check something on page load with javascript then use $(document).ready(function () { //Your code here } ); or in javascript window.onload
has comment: http://stackoverflow.com/comment/38923540
has comment: http://stackoverflow.com/comment/38923576
answers question: http://stackoverflow.com/q/25027949
has comment: http://stackoverflow.com/comment/39008561

http://stackoverflow.com/q/24910614
tagged with: javascript
upvote count: 3
answer count: 2
has answer: http://stackoverflow.com/a/24910902
accepted answer: http://stackoverflow.com/a/24910756
tagged with: jquery
tagged with: asp.net
favorite count: 0
possible better answer: http://stackoverflow.com/a/24910902
has answer: http://stackoverflow.com/a/24910756
has title: How to reload dropdownlist
type: AnsweredQuestion
downvote count: 0
type: Question
tagged with: c#
score: 3
has body: I want to reload the dropdownlist. If I now do a selection on the dropdownlist and I select other option then the previous values are also showing. &lt;script type="text/javascript"&gt; $(document).ready(function () { $("#SelectedCategoriedFaqId").change(function () { $.ajax({ url: "/Medicijnverstrekking/FAQ/SubCategorie/", type: 'POST', dataType: 'json', data: { Categorieid: this.value }, success: function (data) { $('SelectedCategoriedFaqId').val('').trigger('liszt:updated'); //alert("Data retrieval successfull"); var items = ""; $.each(data, function (i, val) { var opt = $("&lt;option&gt;&lt;/option&gt;") .attr("value", val.Value) .text(val.Text); $('#FaqCategorie_Id').append(opt); }); }, error: function (xhr) { alert("Something seems Wrong"); } }); }); }); &lt;/script&gt; Thank you

http://stackoverflow.com/q/24956200
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2353211
linked to: http://stackoverflow.com/q/13806483
type: Question
has body: I am trying to get a color from an element on my screen after the initial color has been ran through -webkit-filter on the CSS. nd apply that color onto another element. HTML &lt;div id="Div1" style="background-color: rgb(166,187,207);"&gt;&lt;/div&gt; &lt;br&gt; &lt;div id="Div2"&gt;&lt;/div&gt; CSS #Div1{ height: 100px; width: 100px; -webkit-filter: saturate(5); } Javascript var inDiv1 = document.getElementById("Div1"); var dColorx = inDiv1.style.backgroundColor; var inDiv2 = document.getElementById("Div2"); inDiv2.innerHTML += '&lt;svg width="400" height="110"&gt;'+ '&lt;rect width="300" height="100" '+ 'style="fill:'+ dColorx +';'+ 'stroke-width:3;stroke:rgb(0,0,0)"&gt;&lt;/svg&gt;'; I need the rect inside of Div2 to be the same color as Div1 currently. Div1 default color rgb(166,187,207). Div1 post filter color rgb(94,199,255). &lt;-- need to get this color I also used a RGB to HSL converters I've found on stackoverflow, but the colors were off by quite a bit. If I'm not making sense, I do apologize. I've been up all night trying to get this to work. If anyone can help me it would greatly be appreciated! Example: http://jsfiddle.net/JfKEL/
has comment: http://stackoverflow.com/comment/38787860
tagged with: javascript
has answer: http://stackoverflow.com/a/24956597
has comment: http://stackoverflow.com/comment/38787750
possible better answer: http://stackoverflow.com/a/24956649
accepted answer: http://stackoverflow.com/a/24956597
has answer: http://stackoverflow.com/a/24956649
score: 0
answer count: 2
tagged with: jquery
has title: Get elements background color after webkit-filter
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25039287
tagged with: math
tagged with: javascript
score: 0
has title: Rotation of shape about its center in Javascript
has answer: http://stackoverflow.com/a/25039907
tagged with: trigonometry
answer count: 1
has body: I am trying to rotate a shape about its center (a triangle in this example). The degree of rotation is based on the radians I calculate earlier from a slope formula. However, instead of turning about its center my shape just becomes skewed. Can anyone help me figure out where my formula is going wrong? Also, it is important to note that the origin (0,0) of this canvas is located in the top left corner of the screen, y increases as you move downwards and x increases as you move to the right. I would like to rotate the shape in the clockwise direction var x1 = 600; var y1 = 600; var x2 = 550; var y2 = 500; var x3 = 500; var y3 = 600 var rad = radians; var a = (550 + (2/3)*(550 - 550)); var b = (500 + (2/3)*(600 - 500)); x1 = (a + ((x1-a) * Math.cos(-rad).toFixed(3))) + ((y1-b) * Math.sin(-rad).toFixed(3)); y1 = (b - ((x1-a) * Math.sin(-rad).toFixed(3))) + ((y1-b) * Math.cos(-rad).toFixed(3)); x2 = (a + ((x2-a) * Math.cos(-rad).toFixed(3))) + ((y2-b) * Math.sin(-rad).toFixed(3)); y2 = (b - ((x2-a) * Math.sin(-rad).toFixed(3))) + ((y2-b) * Math.cos(-rad).toFixed(3)); x3 = (a + ((x3-a) * Math.cos(-rad).toFixed(3))) + ((y3-b) * Math.sin(-rad).toFixed(3)); y3 = (b - ((x3-a) * Math.sin(-rad).toFixed(3))) + ((y3-b) * Math.cos(-rad).toFixed(3)); this.canvas.moveTo(x1, y1); this.canvas.beginPath(); this.canvas.lineTo(x2,y2); this.canvas.lineTo(x3,y3); this.canvas.lineTo(x1,y1); this.canvas.fill(); this.canvas.stroke();
tagged with: geometry
accepted answer: http://stackoverflow.com/a/25039907
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/38969008
score: 0
has text: Tried this as well, but problem still persists.
type: Comment
comment on: http://stackoverflow.com/a/25051917
type: AnswerComment

http://stackoverflow.com/q/25067756
has comment: http://stackoverflow.com/comment/38998326
has comment: http://stackoverflow.com/comment/38998866
has comment: http://stackoverflow.com/comment/38998444
has comment: http://stackoverflow.com/comment/38998390
has comment: http://stackoverflow.com/comment/38998530
has answer: http://stackoverflow.com/a/25082804
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38999715
accepted answer: http://stackoverflow.com/a/25082804
has title: Jquery .data() method not working when getting html attributes
has comment: http://stackoverflow.com/comment/38998560
has comment: http://stackoverflow.com/comment/38998672
type: Question
linked to: http://stackoverflow.com/q/23592030
has comment: http://stackoverflow.com/comment/38999217
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38998364
has comment: http://stackoverflow.com/comment/38998704
has comment: http://stackoverflow.com/comment/38998363
score: 0
has comment: http://stackoverflow.com/comment/38999223
has body: For some reason, the jquery .data() method is only working when the data is set using jquery. Attempting to retrieve data attributes set in the html results in a return value of null or undefined. Here is my javascript and html. var ico = ""; var x = "" + ui.item.label+ " " + ico + ""; $("#" + id + " .userEditor").prepend(x); $("#" + id + " .userEditor .deleteTag").bind("click",function(){ alert($(this).parent().attr("data-id")) alert($(this).parent().data("id")); alert($("#testdivv").data("hola")); $(this).parent().data("yolo","swag"); alert($(this).parent().data("yolo")); // $(this).parent().remove(); });
has comment: http://stackoverflow.com/comment/38998696
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38998465

http://stackoverflow.com/comment/38999311
score: 0
has text: @Cthulhu I solved it, I will write the answer.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25067593

http://stackoverflow.com/q/24958011
has comment: http://stackoverflow.com/comment/38791046
has answer: http://stackoverflow.com/a/24958390
favorite count: 0
accepted answer: http://stackoverflow.com/a/24958128
tagged with: properties
has title: Is it safe/acceptable to attach properties to function objects?
possible better answer: http://stackoverflow.com/a/24958262
score: 1
has answer: http://stackoverflow.com/a/24958262
upvote count: 1
type: AnsweredQuestion
tagged with: object
has body: Let's say I have a function. function foo() { var bar = true; if(bar) { //Do x } } In this example, bar is some condition, like a regular expression. I would like it to be globally accessible, so I can change the condition and run foo() again. I could do this by making it a global variable: var bar = true; function foo() { if(bar) { //Do x } } foo(); bar = false; foo(); or an argument to the function: function foo(bar) { if(bar) { //Do x } } foo(true); foo(false); or even a separate global object: var foo_options = { bar: true }; function foo() { if(foo_options.bar) { //Do x } } foo(); foo_options.bar = false; foo(); I would like to avoid creating a single global variable to hold the condition, because it seems unnecessarily clutter-inducing to have a global variable (even if it's well-named) to hold something that is really only used in one place. I don't want to have to pass the condition as an argument, because this function is going to be called many times and I might not actually be able to control the arguments that the function is called with. A global object seems unnecessary for similar reasons to a global variable, but it's also very clunky. I am currently considering giving the foo() function a property, which is possible because of how JavaScript treats functions (and almost everything else that isn't a string or number) as objects: function foo() { if(foo.bar) { //Do x } } foo.bar = true; foo(); foo.bar = false; foo(); I've tested this and it's possible, but I am concerned about whether or not it's a good idea or dangerous in any way. Advice?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38791454
has answer: http://stackoverflow.com/a/24958128
has comment: http://stackoverflow.com/comment/38791044
type: Question
answer count: 3
tagged with: function
downvote count: 0

http://stackoverflow.com/a/24950656
accepted answer of: http://stackoverflow.com/q/24950589
upvote count: 2
type: AcceptedAnswer
has body: Try passing index to setTimeout(). It would increment for each element in the loop, and thus add to the delay. $(function() { $(".line").each(function(index) { var dot = $(this).find('.dot'); setTimeout(function () { moveDot(dot); }, index * 250); }); }); Fiddle
type: Answer
has comment: http://stackoverflow.com/comment/38778335
score: 2
answers question: http://stackoverflow.com/q/24950589
downvote count: 0

http://stackoverflow.com/q/24992364
type: Question
tagged with: sails.js
has comment: http://stackoverflow.com/comment/38856326
tagged with: javascript
has title: Sails js won't redirect after update
score: 0
answer count: 0
has comment: http://stackoverflow.com/comment/38857251
type: UnansweredQuestion
has body: I'm using sails.js with Passport for user creation and sessions. I've created a user profile update screen with a submit button. <form action="/user/update/<%= req.user[0].id %>" method="post" class="js-user-edit-form"> ... Update ... This is the js file: $(function() { $('.js-user-edit-form').submit(function(event) { event.preventDefault(); $.ajax({ type: "PUT", url: $('.js-user-edit-form').attr('action'), data: $('.js-user-edit-form').serialize() }) .done(function(data) { window.location.href = "/user"; }) .error(function() { alert("Oops! Something went wrong."); }); return false; }) }); Relevant routes: 'get /user/edit': 'UserController.edit', 'get /user': 'UserController.index', 'get /user/:id': 'UserController.show', User controller: edit: function(req, res) { User.findOne(req.user.id) .done(function(err, user) { return res.view({ user: user }); }); }, My problem is that is that after i submit the update i get redirect to: http://localhost:1337/user/update/53d033e685b861924ab55870 Rather than being redirected to http://localhost:1337/user When i use the console it outputs this: Resource interpreted as Document but transferred with MIME type application/json: "http://localhost:1337/user/update/53d6207f40dee700004698e2". As far as i can tell the javascript isn't working, because at the end of it i redirect to /user but that doesnt happen.
tagged with: http-redirect
has comment: http://stackoverflow.com/comment/38994673
tagged with: node.js

http://stackoverflow.com/q/24910918
tagged with: input
tagged with: css
has title: Replace text in input fields with a CSS generated image
downvote count: 0
score: 1
type: Question
has body: I have input fields with value of ON or Off which I would like to replace with CSS generated image. Is this possible? I asked a similar question but about cells in a table. And I can replace the cell values with the CSS generated images. But I've been fiddling around with INPUT Type=text fields and can't figure out a way to do the same replacement with input type fields. I have seen some here that use a pic stored in a url. But it would be great to use the CSS generated image instead of linking to a pic. The code (html, css, js) is here. Cash Internet sOn = ' On ' $('span:contains("On")').html(sOn); The last line of code is what works to replace cell values in a table. I don't know how to do the same for input field values.
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/24875933
has answer: http://stackoverflow.com/a/24911073
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38760058
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24941109
has text: @juvian I will probably use the ChartWrapper instead then. It seems like that will do what I want it to do. If you want to post your comment as an answer with links to the documentation I will accept as answer.
score: 0

http://stackoverflow.com/q/24910481
has body: I have an API that returns list with three fields. EG ['Michał', 6, 'Michal']. First field is name full name with diacritics used in my language, second is an ID and thrid is full name with removed diacritics. Now I want to type in my select box Michal and I want my searchbox to find either Michal and Michał. Actually I have done it by removing dacritics from select-box input. Now if I input Michal it shows Michal but full name is Michał and if I type Michał it says NO RESULT but filters properly. How can I change my typeahead/select-box so it shows also Michał or Michal in dropdown after I write Michał.
accepted answer: http://stackoverflow.com/a/24911063
tagged with: angularjs
type: AnsweredQuestion
has title: Typeahead dropdown list
type: Question
has comment: http://stackoverflow.com/comment/38701609
tagged with: filtering
has answer: http://stackoverflow.com/a/24911063
tagged with: javascript
has comment: http://stackoverflow.com/comment/38701555
score: 0
tagged with: typeahead.js
answer count: 1
has comment: http://stackoverflow.com/comment/38711247

http://stackoverflow.com/comment/38984110
score: 0
comment on: http://stackoverflow.com/q/25060337
type: Comment
has text: possible duplicate http://stackoverflow.com/questions/16039708/jquery-wildcard-class-selector-in-removeclass
type: QuestionComment

http://stackoverflow.com/q/24971920
has answer: http://stackoverflow.com/a/24972081
tagged with: http://stackoverflow.com/tag/html
tagged with: http://stackoverflow.com/tag/xml
has title: How to get dynamic ip in xml file?
has body: I have 'links.xml' file it contains url's which is used to perform instant search and go for the particular page specified by the url. 'links.xml' source <?xml version="1.0" encoding="utf-8"?> Advanced http://{192.168.44.128}/reboot.php Manager http://{192.168.44.128}/manager.php Firmware http://{192.168.44.128}/system.php States http://{192.168.44.128}/states.php In above code: {192.168.44.128}=192.168.44.128 (I couldn't post the question without the braces.) I want to send dynamic IP address in the url tag because IP address keeps changing and its not static IP. Along with this file I have used a php and a html file. So can dynamic address be provided in xml file only without making any changes to other files? If yes, then how? If not, then how to send dynamic IP address in the url tag. This code is taken from: http://www.w3schools.com/php/php_ajax_livesearch.asp Regards.
type: UnansweredQuestion
tagged with: php
has comment: http://stackoverflow.com/comment/38817636
has answer: http://stackoverflow.com/a/24972013
type: Question
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38817578
score: 0

http://stackoverflow.com/comment/38758417
comment on: http://stackoverflow.com/q/24940262
type: Comment
has text: It doesn't need to be too terribly secure. I am going to obfuscated just as an added measure.
type: QuestionComment
score: 0

http://stackoverflow.com/q/24941284
upvote count: 6
has title: Inspecting Failed CORS Requests in Chrome
has body: I'm looking for ways to inspect failed CORS requests to HTTPS endpoint in google Chrome. It would seem that when requests fail, they do not show up in the developer tools networking tab. Instead I only see error messages in the console as follows. XMLHttpRequest cannot load https://someOtherDomain.com:8443/some/path. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.mysite.com' is therefore not allowed access. I'm fully aware of what this error message is telling me, however I'm trying to deduce wether or not there is something interfering with the response in between the client an server.
linked to: http://stackoverflow.com/q/3102819
score: 6
tagged with: google-chrome
type: Question
has answer: http://stackoverflow.com/a/24941367
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/38822497
downvote count: 0
has comment: http://stackoverflow.com/comment/101977993
favorite count: 0
has answer: http://stackoverflow.com/a/79304890
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38761924

http://stackoverflow.com/q/24941642
upvote count: 2
tagged with: web-scraping
type: Question
accepted answer: http://stackoverflow.com/a/24941707
tagged with: javascript
has answer: http://stackoverflow.com/a/24941707
has body: I am trying to scrape from this page: http://www.scoresway.com/?sport=basketball&amp;page=match&amp;id=45926 but having trouble getting some of the data. The second table on the page contains the home team boxscore. The boxscore is split between 'basic' and 'advanced' stats. This code prints the 'basic' total stats for the home team. from BeautifulSoup import BeautifulSoup import requests gameId = 45926 url = 'http://www.scoresway.com/?sport=basketball&amp;page=match&amp;id=' + str(gameId) r = requests.get(url) soup = BeautifulSoup(r.content) for x in soup.findAll('table')[1].findAll('tr')[-1].findAll('td'): print ''.join(x.findAll(text=True)) If you want to see the 'advanced' stats you click on the Advanced 'link' and it shows it while keeping you on the same page. I want to scrape that info as well but don't know how to get at it.
tagged with: python-2.7
answer count: 1
downvote count: 0
favorite count: 0
tagged with: beautifulsoup
tagged with: python
type: AnsweredQuestion
score: 2
has title: Python Beautiful Soup scape page containing Java Script

http://stackoverflow.com/q/24972572
has answer: http://stackoverflow.com/a/24972642
answer count: 3
score: 2
possible better answer: http://stackoverflow.com/a/24972657
downvote count: 0
tagged with: jquery
has answer: http://stackoverflow.com/a/24972657
favorite count: 0
accepted answer: http://stackoverflow.com/a/24972632
tagged with: http://stackoverflow.com/tag/html
has body: I'm trying to select the list anchor link using jquery. Though 'list' link doesn't exist in the page as shown in the console output, it seems 'click' is still getting triggered. What could be causing 'list' and 'add' to trigger? I have this simple code using jquery 1.10.2: Delete Add console output: list not found opentab: list opentab: add Here's jsfiddle link: http://jsfiddle.net/2FHf6/
type: AnsweredQuestion
upvote count: 2
has title: JQuery anchor link selector issue
type: Question
has answer: http://stackoverflow.com/a/24972632
tagged with: javascript

http://stackoverflow.com/comment/38984153
type: QuestionComment
comment on: http://stackoverflow.com/q/25060236
type: Comment
score: 0
has text: Cheers, [Simple HTML Dom Parser](http://simplehtmldom.sourceforge.net/) seems like what I was looking for!

http://stackoverflow.com/a/24977970
type: Answer
downvote count: 0
has body: Don't make think complicated by defining a function inside another one Define your hi function first like this for example function hi (message) { console.log(message) } it takes an argument and show it on the console now let's define our bye function function bye () { hi(" Called from the function bye "); } no when you call bye, you call hi at the same time bye(); // it will show on the console the message " Called from ... " If you want to return a function from a function it's easy you define your hi function like this function hi (message) { console.log(message) } and the bye function returns the hi function like this function bye() { return hi; } All you need to do now, is to call the bye function and give the argument to show in the console to what was returned , just like this bye()(" This is a sample message ");
answers question: http://stackoverflow.com/q/24977924
score: 1
accepted answer of: http://stackoverflow.com/q/24977924
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/24911423
has answer: http://stackoverflow.com/a/24911465
linked to: http://stackoverflow.com/q/3015335
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24911465
has comment: http://stackoverflow.com/comment/38703370
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/24911512
has body: I have written a jQuery script. This should, as I've thought it, take the number of templateTotal (the total number of Templates which exist on USB) from the JSON and generate as many buttons, as templateTotal indicates. For example if templateTotal is 6, then the script should generate 6 buttons. (function poll() { setTimeout(function () { $.ajax({ type: "GET", url: "/api/status", processData: true, dataType: 'text', cache: false, success: function (data, textStatus, request) { var template = jQuery.parseJSON(data); var templateButton = ""; for (i = 1; i > templateTotal; i++); templateButton += ' T' + i + ' ' }, complete: poll }); }); })();
has title: function poll with button create
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24911512
score: 0

http://stackoverflow.com/a/39124716
answers question: http://stackoverflow.com/q/24946573
type: Answer
has body: It been some time since this was active but I've bumped into this lib and I've decided I'll give it a try. Things have been working out alright for now. This is a solution adapted from one of the repo's closed issue (unsolved). It seems that the dev's promised a new API but that was more than 1 year ago. It's not perfect as there are some issues when setting $clock-flip-font-size: 120px. Also, when minutes are being displayed as 3 digits, the "Minutes" text is not centered. Here is the codepen: https://codepen.io/jimasun/pen/PzAqVw/ // // ------------------------- FlipClock // $clock-flip-font-size: 120px $clock-flip-border-radius: 8px $clock-digit-gap: 20px $clock-dot-size: 20px $clock-height: ($clock-flip-font-size * 1.2) $clock-flip-width: ($clock-flip-font-size * 0.8) $clock-flip-margin: ($clock-digit-gap / 2) $clock-flip-section-width: (2 * ($clock-flip-width + 2 * $clock-flip-margin)) $clock-flip-bg: #607D8B $clock-flip-shadow: 0 2px 5px rgba(0, 0, 0, 0.7) $clock-flip-font-color: #F44336 $clock-flip-font-shadow: 0 1px 2px #000 .countdown-wrapper left: 50% position: absolute top: 50% transform: translate(-50%, -50%) .countdown.flip-clock-wrapper ul height: $clock-height margin: 0 $clock-flip-margin width: $clock-flip-width box-shadow: $clock-flip-shadow .countdown.flip-clock-wrapper ul li line-height: $clock-height .countdown.flip-clock-wrapper ul li a div div.inn background-color: $clock-flip-bg color: $clock-flip-font-color font-size: $clock-flip-font-size text-shadow: $clock-flip-font-shadow .countdown.flip-clock-wrapper ul, .countdown.flip-clock-wrapper ul li a div div.inn border-radius: $clock-flip-border-radius .countdown.flip-clock-wrapper ul li a div.down border-bottom-left-radius: $clock-flip-border-radius border-bottom-right-radius: $clock-flip-border-radius .countdown.flip-clock-wrapper ul li a div.up:after top: (($clock-height / 2) - 1px) .countdown .flip-clock-dot.top top: ($clock-height / 2 - $clock-flip-font-size * 0.2 - $clock-dot-size / 2) .cou…
score: 0

http://stackoverflow.com/comment/38922921
score: 0
type: Comment
type: QuestionComment
has text: why not use overflow-y? put the detialed table inside a div tag give it a height limit then the overflow-y will probably do the trick to what you want.
comment on: http://stackoverflow.com/q/25027441

http://stackoverflow.com/comment/38854228
has text: Why `\b`? There is no statement that it should be a word.
comment on: http://stackoverflow.com/a/24991434
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24966118
has body: You can eval copyTo() server-side though it will block the entire mongod process and won't create indexes on the new collection. var copyTo = "function() { db['source'].copyTo('target') };" db.eval(copyTo, [], function(err, result) { console.log(err); }); Also note the field type warning. "When using db.collection.copyTo() check field types to ensure that the operation does not remove type information from documents during the translation from BSON to JSON. Consider using cloneCollection() to maintain type fidelity."
answers question: http://stackoverflow.com/q/24965897
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24965897

http://stackoverflow.com/a/24990083
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24990065
upvote count: 1
has body: Jquery gets single element not array use this var n = $('#demo_info'); instead of var n = $('#demo_info')[0];
score: 1

http://stackoverflow.com/comment/38972394
type: Comment
has text: @kpsingh the `if` is checking if the button has a css class of `fired` this class has been added in the `else`, so the first button press will run the `else`, then each additional press will run the `if`.
comment on: http://stackoverflow.com/a/25054049
score: 0
type: AnswerComment

http://stackoverflow.com/q/24912081
has answer: http://stackoverflow.com/a/24912222
answer count: 4
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24912148
has body: Simple problem that I cannot find the answer to. I have made a jsfiddle of the problem. I have this Javascript code: $(document).ready(function(){ $('#display-feedback-form').off('click').on('click', function(){ $('#feedback_form').show(); }); }); Here is the fiddle with an example: JSFiddle Why am I getting this error? Jquery is loaded correctly on the page.
type: Question
tagged with: javascript
tagged with: jquery
upvote count: 1
accepted answer: http://stackoverflow.com/a/24912144
possible better answer: http://stackoverflow.com/a/24912148
has title: Jquery code error: Undefined is not a function
favorite count: 0
has answer: http://stackoverflow.com/a/24912219
has answer: http://stackoverflow.com/a/24912144

http://stackoverflow.com/comment/38979713
has text: @MadBender, that doesn't work for a Greasemonkey script.
score: 0
comment on: http://stackoverflow.com/q/25056395
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38795849
type: AnswerComment
has text: Hi Sandy, thanks for your comment. I know that mode. Publish outside is not the key point. The key point is: If I initiate the App from Drive as normal user, I cannot run in debug mode. If I run debug mode insider Script Editor, I need the input of state parameters. Temporarily, I can just programmatically and manually insert values in the very start of the module to simulate it. Don't know if there is any better solution.
comment on: http://stackoverflow.com/a/24937077
score: 0
type: Comment

http://stackoverflow.com/q/24914700
score: 1
has comment: http://stackoverflow.com/comment/38711001
has title: In a switch statement is it possible to use a modulo operator in each case?
upvote count: 1
has answer: http://stackoverflow.com/a/24915161
accepted answer: http://stackoverflow.com/a/24915161
tagged with: switch-statement
type: Question
answer count: 2
tagged with: modulo
tagged with: javascript
has comment: http://stackoverflow.com/comment/38710420
possible better answer: http://stackoverflow.com/a/24915413
downvote count: 0
has body: Is it possible to do something like this using switch statements? switch(foo) { case %bar==0: //Do stuff break; } To be more clear, the switch statement should check if foo is divided by something is 0/if foo is divisible by something in each case.
favorite count: 0
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24915413

http://stackoverflow.com/comment/38719053
type: Comment
comment on: http://stackoverflow.com/q/24919307
type: QuestionComment
has text: try `console.log(eventItems.toString());` It will output your array in text format on the console you will than probably be able to read the value of each items. Or you could do `console.log(JSON.stringify(eventItems));` this should help you debug what is going on or at least give you a clue. because the output of your console that you post here is perfectly normal. -EDIT- the console output was remove from the post.
score: 0

http://stackoverflow.com/comment/38934564
type: Comment
comment on: http://stackoverflow.com/a/25025630
score: 0
type: AnswerComment
has text: I still get nothing! There is no element after the `buttonOnSite`. So I want to create a new button after `buttonOnSite`.

http://stackoverflow.com/a/25049162
has body: You should try to invoke ondblclick event, not click event. Here is discussion about ondblclick: How to double click on a HTML element using javascript Here you can test to trigger ondblclick by yourself: W3Schools ondblclick Finally, shouldn't you use apply javascript function to invoke this event? Instructions here
answers question: http://stackoverflow.com/q/25048815
type: AcceptedAnswer
score: 0
has comment: http://stackoverflow.com/comment/38997509
has comment: http://stackoverflow.com/comment/39008739
accepted answer of: http://stackoverflow.com/q/25048815
type: Answer

http://stackoverflow.com/a/24955988
has comment: http://stackoverflow.com/comment/38852135
accepted answer of: http://stackoverflow.com/q/24955122
has comment: http://stackoverflow.com/comment/38794992
answers question: http://stackoverflow.com/q/24955122
upvote count: 4
type: AcceptedAnswer
downvote count: 0
score: 4
has body: If you see the app.js in the calendar bootstrap, you can view how they initialize the buttons... it's not on the "core", you need to do too EDIT: You have all of them in app.js: $('.btn-group button[data-calendar-nav]').each(function() { var $this = $(this); $this.click(function() { calendar.navigate($this.data('calendar-nav')); }); }); $('.btn-group button[data-calendar-view]').each(function() { var $this = $(this); $this.click(function() { calendar.view($this.data('calendar-view')); }); }); $('#first_day').change(function(){ var value = $(this).val(); value = value.length ? parseInt(value) : null; calendar.setOptions({first_day: value}); calendar.view(); }); $('#language').change(function(){ calendar.setLanguage($(this).val()); calendar.view(); });
has comment: http://stackoverflow.com/comment/38787325
type: Answer

http://stackoverflow.com/comment/38848404
type: QuestionComment
comment on: http://stackoverflow.com/q/24988203
type: Comment
has text: Also... why are you trying to do this? this looks like you are trying to solve a problem you shouldn't have.
score: 1

http://stackoverflow.com/comment/38943802
comment on: http://stackoverflow.com/q/24953515
has text: Do you want #slider to be the height of the active #slideX?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24926334
answer count: 1
downvote count: 0
favorite count: 0
has body: I want to limit that there will only be one mover in the box. However, the code below shows that in one box it can put more then one mover which i dont want that to happen. May i know how to make only one mover in a box? Thank you very much!:) Is this draggable and droppable? <?php $conn = mysql_connect("localhost", "root", "password"); if (!mysql_select_db("login")) { echo "Unable to select go database " . mysql_error(); exit; } $sql = "SELECT table FROM se WHERE id = 1"; $result = mysql_query($sql); while ($row = mysql_fetch_assoc($result)) { $output = $row["full"]; } mysql_free_result($result); ?>
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/24926394
score: 1
upvote count: 1
type: Question
has title: Putting only one mover in a box
tagged with: javascript

http://stackoverflow.com/comment/38836915
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24982184
has text: Where are you getting fields and values to use in the query? Is it in an array? It would help if you edited your question to show that.

http://stackoverflow.com/a/25002171
has comment: http://stackoverflow.com/comment/38875462
downvote count: 0
type: Answer
has body: Edit: After some debugging, the answer was to use the right id and proper placing of the javascript code, as noted by the comments. For starters, a refresh is easy to avoid, just make sure to prevent the default event from running; since you're using jQuery, I would recommend doing return false to end the function, since it both 'prevents default' and 'stops propagation'. So the first thing you should do is check if your javascript code is actually running and not erring in the middle of execution. If everything is fine there, the worst case is that the project is not actually added (server side error) but the page should not refresh. Your server side code has nothing to do with the refresh (if it's being properly hijacked), so the response doesn't really matter, I would actually return the id of the new project (so you could provide a link for the newly created item or something like that), but i digress...
has comment: http://stackoverflow.com/comment/38875352
upvote count: 1
has comment: http://stackoverflow.com/comment/38875029
has comment: http://stackoverflow.com/comment/38874770
answers question: http://stackoverflow.com/q/25001610
score: 1

http://stackoverflow.com/comment/38704538
has text: @JohnyEmanuels: Then clearly you did something incorrectly. `display:none` *does* "work". If you're assuming that your code is correct and the CSS specification is broken, I'm afraid you're going to have a difficult time debugging your code.
comment on: http://stackoverflow.com/a/24911015
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38780263
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24952031
has text: When you include the two javascript files, are you including file 1 first? File 1 needs to load first in order for file 2 to use it.

http://stackoverflow.com/a/24955444
answers question: http://stackoverflow.com/q/24955102
has comment: http://stackoverflow.com/comment/38786160
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38864509
has body: You can't have multiple identical indexes in the same level of a JSON String. E.g : try to JSONLint your string and you will get : { "hosts": { "modified_host": "0", "modified_serv": "0" }, "services": { "HTTPS": { "host_name": "F3", "service_description": "HTTPS" }, "HTTP": { "host_name": "S1", "service_description": "HTTP" } } } That's what JSON.parse() — called (I guess) by $.getJSON — , returns. Your status.php needs to return an array for 'services' : "services": [{ "host_name" : "F1", "service_description": "HTTPS" }, { "host_name" : "F2", "service_description": "HTTPS" }, { "host_name" : "F3", "service_description": "HTTPS" }, { "host_name" : "S1", "service_description": "HTTP" } ]

http://stackoverflow.com/a/31371691
accepted answer of: http://stackoverflow.com/q/24994905
answers question: http://stackoverflow.com/q/24994905
has comment: http://stackoverflow.com/comment/50737093
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 7
has body: This is what you want exactly. By using the jQuery roundSlider plugin you can make any type of arc slider with custom appearance. Please check this jsFiddle for the demo of you requirement. Live demo: $("#arc-slider").roundSlider({ sliderType: "min-range", circleShape: "custom-quarter", value: 75, startAngle: 45, editableTooltip: true, radius: 350, width: 6, handleSize: "+32", tooltipFormat: function (args) { return args.value + " %"; } }); #arc-slider { height: 110px !important; width: 500px !important; overflow: hidden; padding: 15px; } #arc-slider .rs-container { margin-left: -350px; /* here 350 is the radius value */ left: 50%; } #arc-slider .rs-tooltip { top: 60px; } #arc-slider .rs-tooltip-text { font-size: 25px; } #arc-slider .rs-border{ border-width: 0px; } /* Appearance related changes */ .rs-control .rs-range-color { background-color: #54BBE0; } .rs-control .rs-path-color { background-color: #5f5f5f; } .rs-control .rs-handle { background-color: #51c5cf; } &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="https://cdn.jsdelivr.net/jquery.roundslider/1.0/roundslider.min.js"&gt;&lt;/script&gt; &lt;link href="https://cdn.jsdelivr.net/jquery.roundslider/1.0/roundslider.min.css" rel="stylesheet"/&gt; &lt;div id="arc-slider" class="rslider"&gt;&lt;/div&gt; Screenshots of the Output: To know more about the roundSlider, please check the demos and documentation page.
score: 7

http://stackoverflow.com/a/25059669
score: 1
has body: Update on your JS Fiddle: i=1; function addRowCell(el){ var table = document.getElementById(el); var fName = document.getElementById("inputName").value; var row = table.insertRow(i); var cell1 = row.insertCell(0); var cell2 = row.insertCell(1); cell1.innerHTML = "ID"; cell2.innerHTML = fName; i++; } Please check if that is the result that you were hoping for.
upvote count: 1
answers question: http://stackoverflow.com/q/25059491
type: Answer
downvote count: 0

http://stackoverflow.com/comment/38988135
comment on: http://stackoverflow.com/a/25061643
type: AnswerComment
score: 0
has text: And also, hide the loader back if some validation is activated or something goes wrong with the form.
type: Comment

http://stackoverflow.com/a/25046586
score: 7
upvote count: 7
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25046530
has body: It is because you are dropping out of the jQuery object and are using the DOM element... $container[0].css({backgroundColor:'blue'}); The [0] here gets you the DOM object from the jQuery object. Use jQuery if you want to access the jQuery method... $container.css({backgroundColor:'blue'});

http://stackoverflow.com/a/24933910
has comment: http://stackoverflow.com/comment/38748338
has comment: http://stackoverflow.com/comment/38772835
type: Answer
has body: Copy below file in your local /app/design/frontend/default/mytheme/template/catalog/product/view/type/options/configurable.phtml &lt;select name="super_attribute[&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt;]" id="attribute&lt;?php echo $_attribute-&gt;getAttributeId() ?&gt;" class="required-entry super-attribute-select"&gt; &lt;option&gt;&lt;?php echo $this-&gt;__('Choose an Option...') ?&gt;&lt;/option&gt; &lt;/select&gt; It shows 'Choose an Option...' as a default value You can change it like below to simply select the first real element in your select: $$('#attribute525 option')[1].selected = true; Check with your attributeid. The above is just an example.
answers question: http://stackoverflow.com/q/24933460
score: 0

http://stackoverflow.com/a/24966562
has comment: http://stackoverflow.com/comment/38807518
score: 1
accepted answer of: http://stackoverflow.com/q/24966538
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24966538
has body: The good news is that you understand scope just fine :) getJSON is an asynchronous function... that means it will kick off the service call, move on with the next statement (which is console.log("Outside: " + specialArray[1][0]);) and then when the service call completes it will get around to invoking your callback function (what you called 'inside'). If you want to act on the result of the service call, that code needs to either live inside the callback function or be invoked by something inside the callback function. The reason getJSON and similar APIs are like this is because they want to make sure your code doesn't 'hang' and make the browser unresponsive while waiting for something that could take a while to complete. Kinda tricky to wrap your head around at first but it's doing you a favor.
type: Answer
has comment: http://stackoverflow.com/comment/38807551
downvote count: 0

http://stackoverflow.com/comment/38829795
type: AnswerComment
comment on: http://stackoverflow.com/a/24978413
has text: Yes, i want this.. Your Fiddle makes me clear.. thanks for your answer.. :)
type: Comment
score: 0

http://stackoverflow.com/a/24977085
type: AcceptedAnswer
downvote count: 0
has body: The Accept Ranges header (the bit in writeHead()) is required for the HTML5 video controls to work. I think instead of just blindly send the full file, you should first check the Accept Ranges header in the REQUEST, then read in and send just that bit. fs.createReadStream support start, and end option for that. So I tried an example and it works. The code is not pretty but it is easy to understand. First we process the range header to get the start/end position. Then we use fs.stat to get the size of the file without reading the whole file into memory. Finally, use fs.createReadStream to send the requested part to the client. var fs = require("fs"), http = require("http"), url = require("url"), path = require("path"); http.createServer(function (req, res) { if (req.url != "/movie.mp4") { res.writeHead(200, { "Content-Type": "text/html" }); res.end(' '); } else { var file = path.resolve(__dirname,"movie.mp4"); fs.stat(file, function(err, stats) { if (err) { if (err.code === 'ENOENT') { // 404 Error if file not found return res.sendStatus(404); } res.end(err); } var range = req.headers.range; if (!range) { // 416 Wrong range return res.sendStatus(416); } var positions = range.replace(/bytes=/, "").split("-"); var start = parseInt(positions[0], 10); var total = stats.size; var end = positions[1] ? parseInt(positions[1], 10) : total - 1; var chunksize = (end - start) + 1; res.writeHead(206, { "Content-Range": "bytes " + start + "-" + end + "/" + total, "Accept-Ranges": "bytes", "Content-Length": chunksize, "Content-Type": "video/mp4" }); var stream = fs.createReadStream(file, { start: start, end: end }) .on("open", function() { stream.pipe(res); }).on("error", function(err) { res.end(err); }); }); } }).listen(8888);
score: 134
has comment: http://stackoverflow.com/comment/53204839
accepted answer of: http://stackoverflow.com/q/24976123
upvote count: 134
answers question: http://stackoverflow.com/q/24976123
type: Answer
has comment: http://stackoverflow.com/comment/100828397
has comment: http://stackoverflow.com/comment/65529809
has comment: http://stackoverflow.com/comment/85370416
has comment: http://stackoverflow.com/comment/47274824
has comment: http://stackoverflow.com/comment/107293321
has comment: http://stackoverflow.com/comment/58754344
has comment: http://stackoverflow.com/comment/52936104
has comment: http://stackoverflow.com/comment/53240149
has comment: http://stackoverflow.com/comment/71161557
has comment: http://stackoverflow.com/comment/58501706
has comment: http://stackoverflow.com/comment/70082591
has comment: http://stackoverflow.com/comment/47274348

http://stackoverflow.com/comment/38802878
has text: That is really nice :D
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24963970
type: AnswerComment

http://stackoverflow.com/q/25038272
upvote count: 1
has answer: http://stackoverflow.com/a/25038726
type: Question
linked to: http://stackoverflow.com/q/2450954
has title: What does this do in JavaScript: array[n] = true;
tagged with: arrays
has answer: http://stackoverflow.com/a/25038526
tagged with: javascript
answer count: 2
tagged with: random
downvote count: 0
score: 1
has body: I have the below code that generates non repeating random numbers for a bingo card. For you to understand, I am also putting HTML code of the same: window.onload = newCard; var usedNums = new Array(76); function newCard() { if (document.getElementById) { for (var i=0; i&lt;24; i++) { setSquare(i); } } else { alert("Sorry, your browser doesn't support this script"); } } function setSquare(thisSquare) { var currSquare = "square" + thisSquare; var colPlace = new Array(0,1,2,3,4,0,1,2,3,4,0,1,3,4,0,1,2,3,4,0,1,2,3,4); var colBasis = colPlace[thisSquare] * 15; var newNum; do { newNum = colBasis + getNewNum() + 1; } while (usedNums[newNum]); usedNums[newNum] = true; document.getElementById(currSquare).innerHTML = newNum; } function getNewNum() { return Math.floor(Math.random() * 15); } ================================================================================== &lt;html&gt; &lt;head&gt; &lt;title&gt;Make Your Own Bingo Card&lt;/title&gt; &lt;link rel="stylesheet" rev="stylesheet" href="script.css" /&gt; &lt;script type="text/javascript" src="script.js"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Create A Bingo Card&lt;/h1&gt; &lt;table&gt; &lt;tr&gt; &lt;th width="20%"&gt;B&lt;/th&gt; &lt;th width="20%"&gt;I&lt;/th&gt; &lt;th width="20%"&gt;N&lt;/th&gt; &lt;th width="20%"&gt;G&lt;/th&gt; &lt;th width="20%"&gt;O&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="square0"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square1"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square2"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square3"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square4"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="square5"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square6"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square7"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square8"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square9"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td id="square10"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="square11"&gt;&amp;nbsp;&lt;/td&gt; &lt;td id="free"&gt;Free&lt;/td&…
has comment: http://stackoverflow.com/comment/38942611
favorite count: 0
type: UnansweredQuestion
tagged with: generator
tagged with: numbers

http://stackoverflow.com/a/24952784
has comment: http://stackoverflow.com/comment/38783137
type: Answer
has comment: http://stackoverflow.com/comment/38782015
has comment: http://stackoverflow.com/comment/43084046
has comment: http://stackoverflow.com/comment/43069566
downvote count: 0
has comment: http://stackoverflow.com/comment/38782240
has comment: http://stackoverflow.com/comment/38782082
score: 1
answers question: http://stackoverflow.com/q/24952502
upvote count: 1
has body: You need to check the order of loading your scripts, jquery should come first, underscore secondly (since you are using undescore.js templating) then backbone: If that doesn't solve your problem then you could either try sending in a static reference to your initial set of data, then call fetch() as needed to grab more, or you can call fetch explicitly as follows: var profileList = new ProfileList(); var profilesView = new ProfileView({collection: profileList}); profileList.fetch(); profileList.bind('reset', function () { profilesView.render(); }); Working Demo

http://stackoverflow.com/comment/38831630
score: 0
comment on: http://stackoverflow.com/a/24979437
type: AnswerComment
has text: `android:visibility="gone"` attribute prevents the widget to appear on screen. Maybe your code shows it when your spinner or another view is being initialized...
type: Comment

http://stackoverflow.com/comment/38721397
has text: @p.s.w.g Honestly, this issue seems tangential to my concerns. Even if I don't use default values I still have the issue where the canvas won't redraw on resize.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24920318

http://stackoverflow.com/comment/38809866
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24967792
has text: Have you checked the fiddle posted in the answer? I haven't seen any height changing.
type: Comment

http://stackoverflow.com/q/25022241
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/111102
answer count: 1
linked to: http://stackoverflow.com/q/5172244
tagged with: node.js
has answer: http://stackoverflow.com/a/25023408
accepted answer: http://stackoverflow.com/a/25023408
has title: Concatenating JSON objects with callbacks and exporting result
type: AnsweredQuestion
tagged with: jsdom
has body: Full disclosure, I am new to all things NodeJS and Express. However, the below code works and is tested, so that should be a good place to start. I am trying to scrape various pages on the same website, pulling data into a big JSON object from each page. Then I would like to amalgamate all those JSON objects into one, even bigger JSON object, then I would like to export it so I can call it in another file. Here is my dataFetch.js: var request = require('request'), jsdom = require('jsdom'); var PlayerData = []; var QBFunction = jsdom.env({ url: 'http://www.fantasypros.com/nfl/projections/qb.php', scripts: ["http://code.jquery.com/jquery.js"], done: function (errors, window) { var $ = window.$; var table = $("tbody:gt(0)").hide(); var QBObject = []; table.find("tr").each(function (i, el) { var $tds = $(this).find('td'); QBObject.push({ 'position': 'QB', 'name': $tds.eq(0).text(), 'passing_attempts': $tds.eq(1).text(), 'completions': $tds.eq(2).text(), 'passing_yards': $tds.eq(3).text(), 'passing_tds': $tds.eq(4).text(), 'interceptions': $tds.eq(5).text(), 'rushing_attempts': $tds.eq(6).text(), 'rushing_yards': $tds.eq(7).text(), 'rushing_tds': $tds.eq(8).text(), 'fumbles_lost': $tds.eq(9).text(), 'standard_projection': $tds.eq(10).text() }); }); } }) exports.PlayerData = PlayerData; Above, the QBObject is an example of the initial JSON object I create when scraping the webpage. The idea is that I do this for each position so imagine that I have this same code for 5 different positions (I left it out for brevity). The QBObject is getting created perfectly. My question, when and how do I combine the QBObject with the PlayerObject, keeping in mind that I'll have to also combine it with a RBObject, etc...? I am confused because the QBObject is being created in a callback, and I'm new to asynchronous programming. I tried concatenating the JSON objects in the callback and printing it out to console, but it was empty (I'm assuming because the console log was executed before …
has comment: http://stackoverflow.com/comment/38913042
tagged with: http://stackoverflow.com/tag/json
type: Question

http://stackoverflow.com/q/25035935
accepted answer: http://stackoverflow.com/a/25036764
has title: How to Create Dynamic Objects?
type: Question
has comment: http://stackoverflow.com/comment/38938072
has answer: http://stackoverflow.com/a/25036772
linked to: http://stackoverflow.com/q/337352
tagged with: javascript
has body: I want to create dynamic objects using jquery.. I know I can use this method $('#container').append(' '); but in this way, the html string will be a very long to achieve. i have this html Select Conditions Select Brand Select Brand Select Brand Select Brand X Add More Now I want this section to be generated dynamically Select Brand Select Brand Select Brand Select Brand X EDIT: I modified the answer by bart s and rewrite the script like this, but it seems to have some error var i = 0; function add_relation() { i = i + 1; var memtag = $(' ', { 'class' : 'relation-parent_' + i, html : $(' ', { 'class' : 'relation-left', 'id' : 'relation_' + i, html : $(' ', { 'class' : 'relation-select', 'id' : 'key_' + i, 'name' : 'key[]' }) } ), $(' ', { 'class' : 'relation-right', html : $(' ', { 'class' : 'btn', 'name' : 'btn[]' }) } ) }); $("#relation_container").append(memtag); } Finaly I Got The Answer var i = 0; function add_relation() { i = i + 1; var left = $(' ', {'class' : 'relation-left','id' : 'relation_' + i}).append($(' ', { 'class' : 'relation-select', 'id' : 'key_' + i, 'name' : 'key[]' })).append($(' ', { 'class' : 'relation-select', 'id' : 'condition_' + i, 'name' : 'key[]' })).append($(' ', { 'class' : 'relation-input', 'id' : 'constraint_' + i, 'type' : 'text', 'name' : 'constraint[]', 'data-provide' : 'typeahead', 'data-items' : '2' })); var right = $(' ', {'class' : 'relation-right',html : $('<buton />', { 'class' : 'btn', 'name' : 'btn[]', 'value': 'X'}) }); var parent = $(' ', {'class' : 'relation-parent_' + i}).append(left).append(right); $("#relation_container").append(parent); } Here's the final script: Add collection <form class="form-horizontal" action="<?php echo base_url() ?>admin.php/collection/add_collection" method="post" enctype="multipart/form-data"> <?php if(isset($msg)) echo $msg;?> collection Name File input Conditions Manual(Product Added Manualy) Automatic(products addition automated) Select Conditions Select Brand Select Brand Select Brand S…
possible better answer: http://stackoverflow.com/a/25036772
score: 0
has comment: http://stackoverflow.com/comment/38938202
has comment: http://stackoverflow.com/comment/38938661
answer count: 2
has comment: http://stackoverflow.com/comment/38937720
tagged with: jquery
has answer: http://stackoverflow.com/a/25036764
has comment: http://stackoverflow.com/comment/38940801
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38938324

http://stackoverflow.com/q/24962934
has comment: http://stackoverflow.com/comment/38801023
has comment: http://stackoverflow.com/comment/38800870
downvote count: 2
type: Question
score: -2
accepted answer: http://stackoverflow.com/a/24963284
tagged with: navigationbar
tagged with: javascript
has comment: http://stackoverflow.com/comment/38800950
possible better answer: http://stackoverflow.com/a/24963105
answer count: 2
has comment: http://stackoverflow.com/comment/38800933
tagged with: mobile
has answer: http://stackoverflow.com/a/24963284
favorite count: 0
has title: How to hide menu with javascript
has body: I found this code on the web and i need help figuring out how to make is so when i click on one of the li elements the menu hides. Thanks. http://jsfiddle.net/E4Zgj/203/ var originalNavClasses; function toggleNav() { var elem = document.getElementById('navigation_list'); var classes = elem.className; if (originalNavClasses === undefined) { originalNavClasses = classes; } elem.className = /expanded/.test(classes) ? originalNavClasses : originalNavClasses + ' expanded'; } &lt;nav id="navigation"&gt; &lt;a class="menu_button" href="#footer_nav" onclick="toggleNav(); return false;"&gt; &amp;#9776; MENU &lt;/a&gt; &lt;ul id="navigation_list" role="navigation"&gt; &lt;li&gt;&lt;a href=#&gt;HOME&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=#&gt;SERVICES&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=#&gt;WORK&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href=#&gt;CONTACT&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/nav&gt;
has answer: http://stackoverflow.com/a/24963105
type: AnsweredQuestion
upvote count: 0

http://stackoverflow.com/a/24947574
type: Answer
upvote count: 3
has comment: http://stackoverflow.com/comment/38785180
score: 3
accepted answer of: http://stackoverflow.com/q/24946008
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24946008
has body: The ui-router configuration will depend on what you're trying to do. It looks like you want the account view and the order view to be on separate pages, in which case you won't want it to be an abstract state, since from the ui-router wiki: "An abstract state can have child states but can not get activated itself. An 'abstract' state is simply a state that can't be transitioned to." I'm not entirely sure you even want a child state for the same reason, since "child states will load their templates into their parent's ui-view." (https://github.com/angular-ui/ui-router/wiki/Nested-States-%26-Nested-Views#nested-states--views). If this is the case, then you can do something like this: .state('tab.account', { url: '/account', templateUrl: 'templates/tab-account.html', controller: 'AccountController' }) .state('tab.order', { url: '/account/order/:id', templateUrl: 'templates/order-view.html', controller: 'OrderController' }) Here's a plunkr: http://plnkr.co/edit/uuEQcxbWchxQyGV7wMlw?p=preview The views objects have been removed, since you don't really need them unless you have multiple nested views. If however you wanted the order view on the same page, then you could do something like this: http://plnkr.co/edit/8Tb1uhVDM0HCW8cgPRfL?p=preview Account Your orders {{ booking.carpark.city }} on app.js: .state('tab.account', { url: '/account', templateUrl: 'tab-account.html', controller: 'AccountController' }) .state('tab.account.order', { url: '/order/:id', templateUrl: 'order-view.html', controller: 'OrderController' }) You'll also probably want to remove your ion-content from the order view template, or else you might get some funky double scroll issues. Hope this helps! Ui-router is pretty confusing, but their wiki has some great documentation and examples to clear things up.

http://stackoverflow.com/comment/38803252
type: AnswerComment
comment on: http://stackoverflow.com/a/24963671
type: Comment
has text: Andrei Baibakou below was more specific. I did set a height, but I needed to do that to a placeholder div. Thanks though!
score: 0

http://stackoverflow.com/a/25061134
score: 1
has body: You need to serialize the ArrayBuffer before jQuery tries to convert it for you. Some examples of how to do this can be seen here.
upvote count: 1
answers question: http://stackoverflow.com/q/25060907
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38846337
type: AnswerComment
score: 1
type: Comment
comment on: http://stackoverflow.com/a/24987180
has text: *"Unless a tag for a framework/library is also included, a pure JavaScript answer is expected."*

http://stackoverflow.com/a/32674760
type: Answer
downvote count: 0
score: 1
has body: You can, and I created an example project demonstrating how to create these facilities for yourself using ES5 and RequireJS - it works with React and also with Backbone - it could probably work with Angular and Ember etc, as long as you use AMD modules and RequireJS. Here's all the information: https://medium.com/@the1mills/hot-reloading-with-react-requirejs-7b2aa6cb06e1 the basic steps are: gulp.js watchers listen for filesystem changes socket.io server in gulpfile sends a message to all browser clients with the path of the file that changed client deletes cache representing that file/module, and re-requires it (using AJAX to pull it from the server filesystem) front-end app is configured / designed to re-evaluate all references to the modules that it wishes to hot-reload, in this case, only JS views, templates and CSS are available to hot reload - the router, controllers, datastores are not configured yet. I do suspect all files could be hot reloaded with the only exception being data stores. You can see an example project here: https://github.com/ORESoftware/hr4R but I recommend reading the article above first. This is a simpler more DIY implementation of hot-reloading than using Babel/ES6 and React-Hot-Loader. Webpack was not primarily designed for hot-reloading- if it were, hot-reloading would no longer be an experimental feature, nor would it using polling to see filesystem diffs, which it currently does (see my article). The RequireJS / AMD spec was basically made for hot-reloading, if you think about it.
answers question: http://stackoverflow.com/q/24944983
upvote count: 1

http://stackoverflow.com/comment/38819466
type: QuestionComment
type: Comment
score: 0
comment on: http://stackoverflow.com/q/24972863
has text: Are you sure this code works? Looks like there are several missing round brackets to me.

http://stackoverflow.com/a/24936537
type: AcceptedAnswer
has body: Try document.pikeForm.totalCost.setAttribute("value",totalCost+"");, +"" converts your value into a string.
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24936399
accepted answer of: http://stackoverflow.com/q/24936399
upvote count: 1

http://stackoverflow.com/q/24960852
has comment: http://stackoverflow.com/comment/38797371
has comment: http://stackoverflow.com/comment/38797801
linked to: http://stackoverflow.com/q/10234725
has body: I don't understand how can I get the data from registered helper. I have the code in global place: var options = {'foo': 'Bar'}; Handlebars.registerHelper('options', function(){return options;}); In template I'm try to calling options {{#with options}}{{foo}}{{/with}} In the template I got the [Object object] on the output. Where is the mistake? I have the options not in JSON. In the JSON I am sending the dynamical data, but the options is static and I keep this in JS file and I need to call the options object in the template file. How can I do this? Upd: I am loading the template into div by using jQuery. The script adding the data to the template. I need to get access to global variable(where the template calls). Not in template, not in JSON, only in global place. So, the JSON data can be empty. Upd2: Global place: &lt;script src="handlebars.js"&gt; &lt;script&gt; var options = {foo: 'Foo', bar: 'Bar'}; var getTemplate = function(data) { return $.get('/static/templates/' + data.tpl + '.html').then(function(src) { return Handlebars.compile(src)(data); });} //run getTemplate() &lt;/script&gt; Template file: {{#with options}}{{foo}}{{/with}}
has title: Handlebars.js own helpers
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38797259
has comment: http://stackoverflow.com/comment/38796888
answer count: 0
has comment: http://stackoverflow.com/comment/38796842
tagged with: javascript
type: Question
has comment: http://stackoverflow.com/comment/38796732
score: 0
tagged with: handlebars.js

http://stackoverflow.com/a/25042647
answers question: http://stackoverflow.com/q/25001939
has body: This is because jspdf does not support UTF-8 characters don’t to don't
type: AcceptedAnswer
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/25001939

http://stackoverflow.com/a/25048414
has comment: http://stackoverflow.com/comment/39143203
answers question: http://stackoverflow.com/q/25048368
has comment: http://stackoverflow.com/comment/38990204
accepted answer of: http://stackoverflow.com/q/25048368
upvote count: 5
has comment: http://stackoverflow.com/comment/39108484
has body: You have auto play on all of the videos. Set auto play on the first element, then when you're going through the videos use: VideoElement.play() And VideoElement.pause() If you want to then reset the video you can do: VideoElement.currentTime = 0; To manage the videos playing. Working Fiddle
score: 5
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39071993
has comment: http://stackoverflow.com/comment/39127515
has comment: http://stackoverflow.com/comment/38972266
type: Answer
has comment: http://stackoverflow.com/comment/39107616
has comment: http://stackoverflow.com/comment/39109408
has comment: http://stackoverflow.com/comment/39071333
has comment: http://stackoverflow.com/comment/39111352

http://stackoverflow.com/q/24970337
tagged with: google-drive-api
answer count: 0
type: UnansweredQuestion
has body: I'm trying to collect mails from a web page. Need some help top find out what i'm doing wrong in the script. When i click the submit button it's redirecting me to the form and it's asking me to fill out the form it does'nt take the mail i send i'm from my HTML form. I hope someone is good enough with JS and google drive to help me. -All files are shared to public and i already created the form document before trying to run the script. -this is the script i writed in my HTML file:
upvote count: 1
score: 1
type: Question
has title: Post from HTML page to Google Drive Spreadsheet
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
favorite count: 0

http://stackoverflow.com/q/25025311
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25034203
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/csv
tagged with: node.js
tagged with: selenium-webdriver
has body: I'm using Webdriverjs. I want to assign a variable in a function and then use that result to compare with some data that I retrieved from a csv file. If I want to compare these two in the function that is reading the element from the webpage, then the value of the data from the csv would be the last item in the array. And if I want to use the result of the function outside of the function and compare it with the data from csv, then the variable(pageProductName) that contains the result of the function (textValue) would be undefined, even though I defined the variable outside the function(globally). What can I do to use the value of textValue outside of the function? or What can I do to have the retrieved data from csv in the right order in the function? Here is part of my code that I have problem with: reader.addListener('data', function(data){ allEntries.push(data); }); reader.addListener('end', function(end) { var i=0; console.log(allEntries.length); for(var j=0; j&lt;allEntries.length;j++) { ProductURLArray[i]=(BaseURL+allEntries[j]['col3']+".html"); ProductNameArray[i]=allEntries[j]['col2']; var url = ProductURLArray[i]; var name = ProductNameArray[i]; driver.get(url); driver.sleep(3000); driver.findElement(webdriver.By.css('.product-name h1')).getText().then(function(textValue){ pageProductName=textValue; }); console.log(pageProductName); assert.equal(pageProductName, name); } });
has title: How to use the assigned variable inside of a function, out of it,
has answer: http://stackoverflow.com/a/25027929
tagged with: webdriver
type: Question
tagged with: javascript

http://stackoverflow.com/comment/73287639
type: AnswerComment
has text: This solved my issue that I spent hours on. thank you
type: Comment
score: 1
comment on: http://stackoverflow.com/a/28482811

http://stackoverflow.com/a/24937396
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38752929
has comment: http://stackoverflow.com/comment/38753018
has comment: http://stackoverflow.com/comment/38752726
upvote count: 1
has body: This is actually very simple to do. Make a image like so: &lt;img src="http://lorempizza.com/200/200/" onclick="change()" id="target"&gt; And the function is very simple. function change(){ var target = document.getElementById("target"); var current = target.src; var url = prompt("change address to:", current); target.src= url; } First, you define the variables. var url opens a prompt window that asks for the url. var target defines which image you want to change. And the last line changes var target's src to the value of var url. var current gets the current url of the image and adds the current url to the text-box. JSFiddle Demo
answers question: http://stackoverflow.com/q/24937082
type: Answer

http://stackoverflow.com/comment/38945604
has text: Finally! Thank you ... it works! I just had to change $scope.db.transaction to $scope.listname. My problem was that I tried that deferred but as result I got an object [then, catch, finally] and didn't know what to do with it.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25039990

http://stackoverflow.com/q/25002416
has answer: http://stackoverflow.com/a/25002856
accepted answer: http://stackoverflow.com/a/25002540
has comment: http://stackoverflow.com/comment/38874901
has comment: http://stackoverflow.com/comment/38874922
type: Question
has comment: http://stackoverflow.com/comment/38874752
tagged with: javascript
has body: I have an array of two objects like this: x = { word: "Gun", pic: "&lt;img id='pic' src='images/stimuli/gun.gif'/&gt;", }, { word: "Hammer", pic: "&lt;img id='pic' src='images/stimuli/hammer.gif'/&gt;", } I have to compare the first element of this array via the src attribute to another image tag y: &lt;img id="pic11" height="115" width="90" src="images/stimuli/gun.gif"/&gt; And I tried this comparison and it gives "undefined is not a function": x[0].pic.attr('src') == pic11.src If I log to console like this: console.log($(x[0].pic).attr('src')) it works I get images/stimuli/gun.gif but I cannot access via the variable x in my script. In other words, I fail to access the src attribute of the img tag of the object in my array. How do I do that?
has title: How to access an attribute of an img tag in an object within an array?
score: 0
has answer: http://stackoverflow.com/a/25002679
answer count: 3
has comment: http://stackoverflow.com/comment/38875041
tagged with: jquery
has answer: http://stackoverflow.com/a/25002540
possible better answer: http://stackoverflow.com/a/25002679
has comment: http://stackoverflow.com/comment/38874749
type: AnsweredQuestion

http://stackoverflow.com/q/24986729
accepted answer: http://stackoverflow.com/a/24986759
answer count: 3
score: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24986755
favorite count: 0
has answer: http://stackoverflow.com/a/24986759
type: AnsweredQuestion
upvote count: 2
type: Question
has title: What sort of monster is this?
possible better answer: http://stackoverflow.com/a/24986747
has body: I came across some javascript that looked like this, and I wondered what is was. It functions like a singleton class defined and instanced inside of a variable declaration. What do I call this type of construction? &lt;script&gt; var abacus= { runningSum:0 ,addSum:function(i){ this.runningSum += i; return this.runningSum; } ,subtractSum:function(i){ this.runningSum -= i; return this.runningSum; } } console.log(abacus.addSum(3)); console.log(abacus.subtractSum(2)); &lt;/script&gt;
has answer: http://stackoverflow.com/a/24986747
tagged with: javascript

http://stackoverflow.com/q/24930553
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38739451
has comment: http://stackoverflow.com/comment/38743724
type: Question
has body: Its not like this question has not been asked anywhere. But I need some specific implementation of the mentioned problem. I need to know if the 'video' tag has registered event handler or not in the application. I tried it using the jQuery methods but it simply does not work. I am new to jQuery, so may be I am doing it in a wrong way. Here is what I referred How to check if element has click handler? var ev = $._data(element, 'events'); I implemented it like this var ev = $._data($('video')[0], 'volumechange'); where $('video')[0] holds the HTML video tag. The above query always returns unidentified So, where am I going wrong? My application has an event handler registered to it &lt;script&gt; video.addEventListener('volumechange', handleVideoEvent, false); &lt;/script&gt; I expect var ev = $._data($('video')[0], 'volumechange'); to return handleVideoEvent object. And moreover is jQuery the only way to get the registered event handlers. Is there a way in Javascript itself?
tagged with: html5-video
linked to: http://stackoverflow.com/q/2741493
tagged with: javascript
tagged with: jquery
tagged with: dom-events
has comment: http://stackoverflow.com/comment/38739395
has title: How to identify if element has a registered event Handler or not
score: 0
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/14072042
answer count: 0

http://stackoverflow.com/a/24912803
downvote count: 0
has comment: http://stackoverflow.com/comment/38706815
accepted answer of: http://stackoverflow.com/q/24912725
has comment: http://stackoverflow.com/comment/38706226
type: Answer
answers question: http://stackoverflow.com/q/24912725
upvote count: 2
score: 2
has body: You'll need to use a IIFE: Replace: for(var i=0; i &lt; returnArray.length; i++) { // Loop through the array $http.get('getOtherValues/' + returnArray[i].value).then(function (res) { console.log("WHAT'S IN IT: ", returnArray[i].value); // Shows 'undefined' error }); } With: for(var i=0; i &lt; returnArray.length; i++) { // Loop through the array (function(data){ $http.get('getOtherValues/' + data.value).then(function (res) { console.log("WHAT'S IN IT: ", data.value); // Shows 'undefined' error }); }(returnArray[i])) } This ensures that, for the current iteration of the for loop, the data variable will be set to the current raturnArray item.
has comment: http://stackoverflow.com/comment/38707617
type: AcceptedAnswer

http://stackoverflow.com/a/24916095
has body: $(".item").hover(function () { $(this).siblings().addClass("hovering"); }, function () { $(this).siblings().removeClass("hovering"); }); Fiddle
type: Answer
answers question: http://stackoverflow.com/q/24915998
score: 0

http://stackoverflow.com/a/24963734
answers question: http://stackoverflow.com/q/24963474
has comment: http://stackoverflow.com/comment/38803291
has body: Wrap your &lt;div class="menu-wrapper" id="menu-wrapper"&gt; by another div (placeholder) and set height to 84px by CSS (equals to fixed menu height) or using JS. You've met this problem because fixed elements excluded from position calculation.
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24963474

http://stackoverflow.com/q/25042211
type: Question
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/38950204
tagged with: function
downvote count: 0
has title: Calling multiple JS files and functions
favorite count: 0
type: UnansweredQuestion
has body: I'm trying to do the following: - from an HTML page I want to call a .js file in the header. I want this file to contain 2 functions, A and B, that I want to call at different times as the page loads. This first part I have ready, my problem is: -Function B is supposed to call another .js file, wait for it to complete loading and run some code specific to function B. This is what I have so far: &lt;head&gt;&lt;script type="text/javascript" src="first.js"&gt;&lt;/script&gt;&lt;/head&gt; I have this to call the different functions that are inside first.js &lt;script language="JavaScript" type="text/javascript"&gt; functionA (); &lt;/script&gt; Now inside first.js: function functionA () { alert("A runs!"); } function functionB () { alert("B runs!"); var script = document.createElement('script'); script.type = 'text/javascript'; script.src = "http://www.URL.com" ; --some additional code-- } Suggestions? Thanks!
linked to: http://stackoverflow.com/q/11160948
score: 1
has answer: http://stackoverflow.com/a/25042419
upvote count: 1
has answer: http://stackoverflow.com/a/25042348
linked to: http://stackoverflow.com/q/6989020

http://stackoverflow.com/comment/38990695
type: AnswerComment
has text: Why are you doing `settings.channels + " " + settings.password`? `settings.channels` is an Array, not a string, so if you have more than one value, it'll mess up.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25046661

http://stackoverflow.com/a/25057429
downvote count: 1
has comment: http://stackoverflow.com/comment/39007472
has body: Firstly, consider using jQuery rather than plain Javascript (it's de facto standard now - many people claim they know jQuery not knowing Javascript). Action flow would go like this: (JS) Select all elements from container using jQuery's $("#parent").children(), (JS) Create an plain JS object containing needed data for each image, user data, etc., using jQuery's .each() method, for example: myDataObject = { userid: 0, images: [] }; $("#parent").children().each(function(elem){ myDataObject.images.push({ left: $(elem).css("left"), top: $(elem).css("top"), zindex: $(elem).css("z-index") }); }); (JS) Send object using jQuery's AJAX methods, e.g. $.post( "mysite.com/save.php", myDataObject, function( data ){ alert("Saved! Received response: " + data); } ); (PHP) in save.php parse POST data (using $_POST array) and run SQL queries to add it to database. After completion, echo some information which will be displayed to user: &lt;?php $images_array = $_POST['images']; $userid = $_POST['userid']; foreach( $images_array as $image ) { // run here query for each image } echo "Image data successfully saved."; ?&gt;
upvote count: 0
type: Answer
score: -1
has comment: http://stackoverflow.com/comment/38978830
has comment: http://stackoverflow.com/comment/38978214
answers question: http://stackoverflow.com/q/25057053

http://stackoverflow.com/a/25039222
has body: I don't know if this copies the function or just uses the reference for the function? window.localStorage is no function but an object. In JavaScript, objects are passed by reference. That means you're just creating an alias for that objects. I see no problems by doing it this way.
upvote count: 1
answers question: http://stackoverflow.com/q/25039029
score: 1
downvote count: 0
type: Answer

http://stackoverflow.com/q/25007558
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38884542
type: UnansweredQuestion
tagged with: path
has answer: http://stackoverflow.com/a/25020730
has title: 404 for javascript file
score: 0
has body: I am having a weird issue where my jquery.js script is found but my personal javascript file is not even though it's in the same directory (same level too in the directory) as the jquery.js script. My lines of code are: &lt;script type="text/javascript" src="jquery-1.11.1.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="injectLastCell.js"&gt;&lt;/script&gt; The first script loads, but the second spits out a "code 404, message File not found". The injectLastCell.js is composed of the following of the code (I have tested it on jsfiddle so I know it works): function createForm(i, value) { return $('&lt;input/&gt;').attr({ type: 'text', id: i, name: i, value: value}); } $("table tr td:last-child").each(function(i, e) { createForm(i, "v"+i).appendTo($(e)); }); Anyone have an idea of what is going wrong? Thanks
type: Question
has comment: http://stackoverflow.com/comment/38884487

http://stackoverflow.com/a/24935776
answers question: http://stackoverflow.com/q/24934867
type: Answer
score: 0
has body: Allow me to rephrase your question: How do I rerender react when external data changes? In order to do this, you need to be able to run some code when the external data changes. If you can't do this, then you can't update the view. There's no magic. get/set One way is with a getter and setter. renderOnChange({ key: 'testdata', element: document.getElementById('test'), render: function(data){ return Test({data: data.testdata}); } }); function renderOnChange(params){ var source = params.source || window, key = params.key, element = params.element, render: params.render; var value = source[key]; delete source[key]; Object.defineProperty(source, key, { get: function(){ return value }, set: function(newValue){ value = newValue; React.renderComponent(render(source), element); } }); } I might add more methods here later on

http://stackoverflow.com/comment/38797178
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24960989
has text: Wats the problem with http://codepen.io/anon/pen/qfulj ?

http://stackoverflow.com/comment/38962823
comment on: http://stackoverflow.com/q/25048294
type: Comment
type: QuestionComment
score: 0
has text: Works perfectly for me on Opera 21, screen res 1600x900

http://stackoverflow.com/comment/38892232
has text: If you want dynamically added elements to have listeners, then you need to add listeners. You can do that dynamically, add listeners in–line and clone the elements, or use event delegation. Your choice.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25011456

http://stackoverflow.com/comment/38838435
has text: thanks. I've edited the code according to your suggestion. I may be really off here - I don't fully understand how files are linked to one another in GO yet. Anyway, I ran this on my server and got a 404 page not found message.Appreciate any guidance. thanks!
comment on: http://stackoverflow.com/a/24983021
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38863304
type: Comment
comment on: http://stackoverflow.com/q/24996329
has text: Is `Real` in the global scope or is it enclosed within a function?
score: 0
type: QuestionComment

http://stackoverflow.com/a/25005908
has comment: http://stackoverflow.com/comment/38881888
answers question: http://stackoverflow.com/q/25005869
score: 5
accepted answer of: http://stackoverflow.com/q/25005869
downvote count: 0
has comment: http://stackoverflow.com/comment/38881861
type: AcceptedAnswer
upvote count: 5
has body: The reason window.x "works" (but it shouldn't satisfy the if condition) is because when accessing a nonexistant property of an object, undefined is returned, and not an exception. The opposite is true for directly accessing variables. This is most likely because if a variable is accessed before it is defined, chances are the program has a bug that shouldn't be left unnoticed. Also, var defines a variable that can only be accessed in the enclosing scope. Omission of the keyword results in the creation of a global variable.
type: Answer

http://stackoverflow.com/a/25029097
has comment: http://stackoverflow.com/comment/38930738
score: 0
has comment: http://stackoverflow.com/comment/38932328
answers question: http://stackoverflow.com/q/25028365
has comment: http://stackoverflow.com/comment/38932621
has body: What if you use the new Promise constructor to resolve the promise? return new Promise(function(resolve, reject) { resolve(faye_client); });
type: Answer
has comment: http://stackoverflow.com/comment/38925318
has comment: http://stackoverflow.com/comment/39139039

http://stackoverflow.com/comment/93013878
type: AnswerComment
has text: @kleinfreund You might need to use a version of EmberJs from 2014 for this to work
comment on: http://stackoverflow.com/a/24923770
score: 0
type: Comment

http://stackoverflow.com/comment/38750506
has text: Your contentType is wrong, you're not sending json but url encoded form data. Temove contentType and the correct one will be set. See http://stackoverflow.com/questions/13735869/datatype-application-json-vs-json/13735890#13735890
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24936212
score: 1

http://stackoverflow.com/q/24913733
has body: i'm having a problem using hammer.js and an SVG file. It seems that the svg does not react on inputs by hammer. Here is my problem narrowed down in a code-example: html-snippet: My div svg-snippet: <set attributeName="fill" to="yellow" begin="click" /> Using the "object"-tag to load the svg file into html, i can use the "onclick" event of SVG to change the color, but hammer won't see the circle and doesn't log the "svg tap". It logs the "tap div" above perfectly though, so hammer works as intended. An alternative would be to use the "img src"-tag to load the svg file into html. Then, i can "hammer" on the object (it logs the text), but the color won't switch. Problem: I need both things to work, hammer-multitouch as well as svg-interactivity... Is there another way to load the file so hammer can interact with it and the SVG-interactivity won't get lost? Thx for your help :)
score: 1
upvote count: 1
type: Question
has title: hammer.js and SVG interactivity
downvote count: 0
tagged with: javascript
tagged with: hammer.js
has answer: http://stackoverflow.com/a/24987839
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38708839
accepted answer: http://stackoverflow.com/a/24987839
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
type: AnsweredQuestion
tagged with: object
has comment: http://stackoverflow.com/comment/38708410

http://stackoverflow.com/comment/38867685
comment on: http://stackoverflow.com/q/24998659
score: 0
has text: And do you have a valid API key etc. [**Read this**](https://developers.google.com/maps/documentation/business/geolocation/) and follow the TOS
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38708367
type: QuestionComment
comment on: http://stackoverflow.com/q/24913564
has text: @sWW well of course I'm not an IE fan but actually `.append()` is damn slow. If you remove it and you directly set inner HTML through `innerHtml` code performance will be decent also in IE. **Here problem isn't browser but code...**
score: 0
type: Comment

http://stackoverflow.com/q/24966490
has title: How to report JavaScript errors during functional tests using Intern?
upvote count: 3
tagged with: selenium
accepted answer: http://stackoverflow.com/a/25129602
type: AnsweredQuestion
score: 3
tagged with: saucelabs
type: Question
downvote count: 0
answer count: 1
tagged with: intern
tagged with: javascript
has body: How can I report JavaScript errors that occur during test execution using Intern? Basically, if there are any JavaScript errors on the page (even as part of things that aren't explicitly tested) I want to know. Background I'm just getting started with Intern and testing in general and I'm trying to test all major pages on my site in all browsers because I just changed all our JavaScript to load via require.js. While it looks good in Chrome, I've had issues with require.js and random browsers in the past so I wanted to automate everything. The most likely issue that will arise is that some random JS will fail to execute due to asynchronous loading and load of an expected global. Since there are no current tests setup, I basically want to start by running a 'test' go to through all major pages and report any JavaScript errors.
favorite count: 0
has answer: http://stackoverflow.com/a/25129602

http://stackoverflow.com/q/24980478
has comment: http://stackoverflow.com/comment/38833315
upvote count: 1
accepted answer: http://stackoverflow.com/a/24980504
has comment: http://stackoverflow.com/comment/38833298
downvote count: 1
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38833305
linked to: http://stackoverflow.com/q/500431
tagged with: document-ready
answer count: 1
tagged with: javascript
tagged with: jquery
has body: Why am I getting Uncaught ReferenceError: i is not defined in my javascript file? So here's how I did it. app.js $(function() { var i = 1; }); some.js $(function() { alert(i); }); and here's how I sequence my files. // included jquery here How can I execute or access variables from app.js or to other javascript files? I thought they should be listed in sequence. Where did I go wrong? Any help would be much appreciated. Thanks
duplicate of: http://stackoverflow.com/q/500431
has title: Uncaught ReferenceError: {var} is not defined. Files are created separately
has answer: http://stackoverflow.com/a/24980504
score: 0
favorite count: 0

http://stackoverflow.com/comment/44048191
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/25006700
type: Comment
has text: @bencripps that's not very useful.

http://stackoverflow.com/q/25030454
has comment: http://stackoverflow.com/comment/38928437
score: 0
has title: get value javascript from Session variable and convert into date
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38928244
has body: i am trying to get value from Session Variable in javascript and want to convert into time format i have tried is function SessionTime() { var someSessionVariable = new Date('&lt;%= Session["LogInTime"].ToString() %&gt;'); //Date.parseDate(@Session["LogInTime"],"dd/MM/yyyy"); alert(someSessionVariable); document.getElementById("SessionTime").innerHTML = someSessionVariable.toLocaleTimeString(); window.setTimeout("SessionTime()", 1000); // Here 1000(milliseconds) means one 1 Sec } i am getting invalid date on alert(someSessionVariable); all i wanted to do is show a user a elapsed time from the time of login which i am getting in: &lt;%= Session["LogInTime"].ToString() %&gt; please help!!!
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38927943
has comment: http://stackoverflow.com/comment/38928938
answer count: 0
has comment: http://stackoverflow.com/comment/38929868
type: Question
has comment: http://stackoverflow.com/comment/38927871
tagged with: session
tagged with: javascript
has comment: http://stackoverflow.com/comment/38932964

http://stackoverflow.com/q/24943159
has comment: http://stackoverflow.com/comment/38764663
type: Question
has comment: http://stackoverflow.com/comment/38764620
has comment: http://stackoverflow.com/comment/38863022
tagged with: javascript
linked to: http://stackoverflow.com/q/24936749
score: 0
has body: I have an aspx page that executes another aspx page through Server.Execute() since I need the called aspx page to postback in order to grab a session variable. However, I have noticed in my code that when the Server.Execute() is called, it does not wait for the called page to load up and posback, the code just goes on and the page is only loaded after the function is finished? Does anyone know how to fix this? Below is the code I am using in the parent page to call the page I want to load. Imports System.IO Public Class TriggerPage Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Server.Execute("SvgForm.aspx", False) 'This variable is only populated after the SvgForm.aspx executes and posts back since the Session variable is initialized there Dim htmlCode As String = Session("svgVariable") End Sub End Class Aspx page code: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TriggerPage.aspx.vb" Inherits="TelerikChart.TriggerPage" %> <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js"> </asp:ScriptReference> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js"> </asp:ScriptReference> <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js"> </asp:ScriptReference> </telerik:RadScriptManager> <telerik:RadWindowManager ID="RadWindowManager1" runat="server"></telerik:RadWindowManager> <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server"> </telerik:RadScriptBlock>
answer count: 1
has comment: http://stackoverflow.com/comment/38764250
has comment: http://stackoverflow.com/comment/38764166
tagged with: asp.net
has answer: http://stackoverflow.com/a/51128609
has title: Server.Execute() does not wait for the second aspx page to finish executing?
has comment: http://stackoverflow.com/comment/38764189
has comment: http://stackoverflow.com/comment/38764432
has comment: http://stackoverflow.com/comment/45756345
tagged with: telerik
has comment: http://stackoverflow.com/comment/38764230
has comment: http://stackoverflow.com/comment/38764538
tagged with: vb.net
type: UnansweredQuestion

http://stackoverflow.com/comment/38728203
score: 0
comment on: http://stackoverflow.com/a/24924155
type: Comment
has text: OK, just edited to add how to stub a function to test that particular parameters were used.
type: AnswerComment

http://stackoverflow.com/comment/38935240
type: QuestionComment
has text: Thanks spryno, works a treat. If you put that in to an answer, then I can mark it as accepted.
comment on: http://stackoverflow.com/q/25034503
score: 0
type: Comment

http://stackoverflow.com/q/25060907
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25061603
tagged with: ajax
linked to: http://stackoverflow.com/q/19959072
has comment: http://stackoverflow.com/comment/38985971
score: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38985995
has comment: http://stackoverflow.com/comment/38985030
upvote count: 1
has comment: http://stackoverflow.com/comment/38985964
has body: I'm trying to send compressed data to a server. To do this I'm attempting to pass it into jQuery's ajax function as a UInt8Array. I've based this on a related answer. But it's not worked. When I look at the content through Wireshark, I see it's tried to do a .toString() on it, getting "[object Uint8Array]". There's very little other info on this around. var dataCompressed = LZW.compressToByteArray(data); $.ajax({ data: dataCompressed, processData: false, contentType: "application/octet-stream", url: window.localStorage.getItem('servername') + '/Form/SaveData2?formId=' + results.rows.item(x).id, headers: { 'Authorization': 'Basic ' + credentials }, type: "POST", async: true, success: function (data) { } });
has comment: http://stackoverflow.com/comment/38985350
linked to: http://stackoverflow.com/q/6965107
has comment: http://stackoverflow.com/comment/38987916
has comment: http://stackoverflow.com/comment/38986581
has answer: http://stackoverflow.com/a/25061134
has title: Sending UInt8Array through $.ajax
type: Question
has comment: http://stackoverflow.com/comment/38985163
answer count: 2

http://stackoverflow.com/comment/38963358
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25049020
has text: Target options overrides task options. See updated answer. Omitting the target will execute all the targets in order.

http://stackoverflow.com/comment/38783142
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24953053
type: AnswerComment
has text: This is the same code as the other answer, came later as the other answer and does not contain a description.

http://stackoverflow.com/comment/38746273
type: Comment
comment on: http://stackoverflow.com/a/24933232
has text: This is tricky, you need to set rules before that. For ex. consider only input action on textfield, only click action on button etc. After you setup rules, you can then use my above mentioned solution.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38928583
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25030949
type: Comment
has text: Could you show my where in my current code should I place `$().qtip();` ? Thank you.

http://stackoverflow.com/q/25030195
type: UnansweredQuestion
tagged with: node.js
downvote count: 0
score: 1
type: Question
upvote count: 1
tagged with: mean-stack
tagged with: javascript
has body: I have a Mean stack application and i want to add jenkins CI to it. I am not sure as to how to achieve this. I am using bower to install front end packages and npm for other stuff.
answer count: 1
has title: How to integrate jenkins with mean stack application
favorite count: 0
has answer: http://stackoverflow.com/a/25046921
tagged with: jenkins

http://stackoverflow.com/comment/38741134
has text: you can even use $("tr").on("click", function(){ var selected_tr = $(this); // Now tr on which you have clicked is 'selected_tr' })
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24929710
type: Comment

http://stackoverflow.com/q/24987854
type: Question
upvote count: 2
possible better answer: http://stackoverflow.com/a/25002632
downvote count: 0
tagged with: javascript
answer count: 2
favorite count: 0
has comment: http://stackoverflow.com/comment/38883064
tagged with: backbone.js
tagged with: handlebars.js
has answer: http://stackoverflow.com/a/25002632
tagged with: requirejs
has comment: http://stackoverflow.com/comment/38881147
accepted answer: http://stackoverflow.com/a/25007632
score: 2
type: AnsweredQuestion
has title: Handlebars sometimes not print {{this}} in each helper
has answer: http://stackoverflow.com/a/25007632
has body: I iterate an object and try to print value of object and sometimes it works and sometimes it does not. This mainly happen in Chrome and Firefox and IE9 is working as it should be. Somehow the generated function from handlebars get different when it works and when it does not. Data is the same for both time. When i use log helper to print {{this}}, i can see correct value print in console. If you are wondering what is underscoretodash, it is a simple helper and even when i remove that it does not make any different. My application using Backbone, Marionette, Handlebars and requireJs. If anyone came across such a issue or know how to fix this, it would be very helpful. Data structure as follows var errors = { "custom_agent": "You can't be an agent.", "min_length": "Occupation must be at least 2 characters." }; Handlebar code as follows {{#each error_messages}} {{this}} {{log this}} {{/each}} Handlebar generated functions as follows. When works. *** "Invalid Branch." handlebars.js:469 *** prog: "function program8(depth0,data) { var buffer = "", helper, options; buffer += "\n " + escapeExpression((typeof depth0 === functionType ? depth0.apply(depth0) : depth0)) + "\n "; return buffer; }" When does not works *** "Invalid Branch." handlebars.js:468 *** prog: "function program8(depth0,data) { var buffer = "", stack1, helper, options; buffer += "\n "; if (helper = helpers.undefined) { stack1 = helper.call(depth0, {hash:{},data:data}); } else { helper = (depth0 && depth0.undefined); stack1 = typeof helper === functionType ? helper.call(depth0, {hash:{},data:data}) : helper; } buffer += escapeExpression(stack1) + "\n "; return buffer; }"

http://stackoverflow.com/a/24961024
accepted answer of: http://stackoverflow.com/q/24960989
score: 6
type: Answer
upvote count: 6
has body: You need to change this line var newColor = "(" + r + "," + g + ", 0)"; to this var newColor = "rgb(" + r + "," + g + ", 0)";
answers question: http://stackoverflow.com/q/24960989
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/25043534
has title: AngularJS : Scope issue in $http success callback
has answer: http://stackoverflow.com/a/25043595
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38957913
downvote count: 1
has answer: http://stackoverflow.com/a/25043633
type: AnsweredQuestion
score: 3
tagged with: angularjs-controller
has body: I'm using PHP to get data into my factory, which shows correctly in the success callback function within the controller. However, even after assigning the returned data to $scope.customers, it's not there if I do a console.log($scope.customers) after the callbacks, and my view's [ng-repeat] isn't picking it up either. Any idea why the scope of my data would be restricted to just inside the success callback if I'm assigning the returned data to my $scope object? var customersController = function($scope, customersFactory) { $scope.customers = []; customersFactory.getAllData() .success(function(customers) { $scope.customers = customers; console.log($scope.customers); // Object with correct data }); // No errors so only showing happy path console.log($scope.customers); // empty [] }; customersModule.controller('customersController', ['$scope', 'customersFactory', customersController]);
tagged with: angularjs-scope
type: Question
upvote count: 4
answer count: 2
has comment: http://stackoverflow.com/comment/38952445
accepted answer: http://stackoverflow.com/a/25043633
tagged with: javascript
favorite count: 0
tagged with: angularjs-factory
possible better answer: http://stackoverflow.com/a/25043595

http://stackoverflow.com/comment/38869639
comment on: http://stackoverflow.com/q/24999675
has text: It's not "fire-and-forget" when you don't forget about it
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25039586
type: AcceptedAnswer
score: 0
type: Answer
has body: When the top of .slide is at the top of the viewport set opacity to 1, then by the time the bottom of .slide is at the top of the viewport, it should have animated from 1 through to 0 That would be I should fade out NOT I should fade out http://jsfiddle.net/wj2XG/2/
answers question: http://stackoverflow.com/q/25025308
accepted answer of: http://stackoverflow.com/q/25025308

http://stackoverflow.com/q/25012153
type: Question
type: AnsweredQuestion
has title: Show image on mouse over for elements of a table
has answer: http://stackoverflow.com/a/25012534
answer count: 3
has answer: http://stackoverflow.com/a/25012415
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has body: I have a table of my favourite movies. I would like to display the poster of the movie when the user hovers over the name of the movie. I managed to do it for one element: My Top 10 Movies Rank Title Director Year 01 Drive Nicolas Winding Refn 2011 My question is, how can I do the same for multiple items without writing X functions for each of my movie? I tried using classes, but it does not seem to work (and even if it does, it would show all the pictures when the user hovers over any of the titles).
has answer: http://stackoverflow.com/a/25012241
accepted answer: http://stackoverflow.com/a/25012241
possible better answer: http://stackoverflow.com/a/25012534

http://stackoverflow.com/comment/38710513
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24914626
has text: Ok, then how come the isset is still false?

http://stackoverflow.com/a/25001596
type: Answer
answers question: http://stackoverflow.com/q/25000239
upvote count: 2
has body: In case, that the JSON contains "stringId" (e.g. "1", "2") as an identificator, we can define that object as a dictionary (see it <a href="http://www.typescriptlang.org/Playground#src=interface%20IData%20%7B%0A%20%20%20%20topicId%3A%20number%3B%0A%20%20%20%20subTopicId%3A%20number%3B%0A%20%20%20%20topicName%3A%20string%3B%0A%20%20%20%20subTopicName%3B%20string%3B%0A%7D%0Ainterface%20IDataSet%0A%7B%0A%09%5Bkey%3A%20string%5D%20%3A%20IData%3B%0A%7D%20%0A%0Avar%20source%20%3D%20%0A'%7B%20%20%221%22%3A%7B%22topicId%22%3A1%2C%22subTopicId%22%3A1%2C%22topicName%22%3A%22x%22%2C%20%22subTopicName%22%3A%22x%22%7D%2C'%2B%0A'%20%20%20%222%22%3A%7B%22topicId%22%3A1%2C%22subTopicId%22%3A2%2C%22topicName%22%3A%22x%22%2C%22subTopicName%22%3A%22x%22%7D%2C'%2B%0A'%20%20%2262%22%3A%7B%22topicId%22%3A10%2C%20%22subTopicId%22%3A62%2C%22topicName%22%3A%22x%22%2C%22subTopicName%22%3A%22x%22%7D'%2B%0A'%7D'%3B%0A%0Avar%20a%20%3D%20%3CIDataSet%3EJSON.parse(source)%3B%0A%0Afor(var%20key%20in%20a)%0A%7B%0A%09var%20elm%20%3D%20document.createElement('div')%3B%0A%09elm.innerText%20%3D%20%22key%3A%20%22%20%2B%20key%20%2B%20%22%2C%20topicId%3A%20%22%20%2B%20a%5Bkey%5D.topicId%09%0A%20%20%20%20document.body.appendChild(elm)%3B%0A%7D" rel="nofollow">here): interface IData { topicId: number; subTopicId: number; topicName: string; subTopicName; string; } // IDictionary with a key of type string // and a value of type IData interface IDataSet { [key: string] : IData; } var source = '{ "1":{"topicId":1, "subTopicId":1, "topicName":"x","subTopicName":"x"},'+ ' "2":{"topicId":1, "subTopicId":2, "topicName":"x","subTopicName":"x"},'+ ' "62":{"topicId":10,"subTopicId":62,"topicName":"x","subTopicName":"x"}'+ '}'; var a = <IDataSet>JSON.parse(source); for(var key in a) { var elm = document.createElement('div'); elm.innerText = "key: " + key + ", topicId: " + a[key].topicId document.body.appendChild(elm); } Check this <a href="http://www.typescriptlang.org/Playground#src=interface%20IData%20%7B%0A%20%20%20%2…
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25000239

http://stackoverflow.com/q/24949847
score: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/24949848
has body: I have written a simple AngularJS based HTML. It has an array of predefined items and Add and Delete buttons are provided for adding or removing the items from the list. Delete button is a custom directive. Below is the code sample: ( is a custom directive) HTML Item Price Add Item Name Item Price Action {{item.name}} Remove Javascript $scope.addItems = function() { $scope.start(); var newItem = {name: $scope.name , price: $scope.price}; $scope.items.push(newItem); $scope.complete(); }; myModule.directive("deleteButton", function() { return { restrict: "E", transclude: true, template: " " }; }); The code runs fine on Chrome and Firfox, but when I tried to run it on IE 8, it gave "Error: Unknown Runtime Error"in the console. There is no other log.
possible better answer: http://stackoverflow.com/a/24950389
has answer: http://stackoverflow.com/a/24950389
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24949848
tagged with: internet-explorer-8
has title: Unknown Runtime Error in IE 8 with AngularJS
answer count: 2
tagged with: javascript

http://stackoverflow.com/a/24986517
score: 0
accepted answer of: http://stackoverflow.com/q/24976812
answers question: http://stackoverflow.com/q/24976812
type: Answer
has body: I solved this problem using setTimeout which delays creation on Moveable object, //using lang.hitch for passing the context setTimeout(lang.hitch(this,new function(){ //vertex from the context var moveableHandle = new Moveable(vertex); console.log("priting moveable object before passing to adapter",moveableObject); //do stuff with moveable ..... }),1000);
type: AcceptedAnswer

http://stackoverflow.com/comment/38788045
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24949639
has text: And we are at r68 so you should really move to that.

http://stackoverflow.com/a/24956162
type: Answer
has comment: http://stackoverflow.com/comment/38801382
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24954861
score: 1
answers question: http://stackoverflow.com/q/24954861
has comment: http://stackoverflow.com/comment/38801460
type: AcceptedAnswer
downvote count: 0
has body: I'm not super familiar with the lightbox library you're using. I couldnt quite figure out how to hide the original div and keep the overlay content showing up. It's weird, because it duplicates the elements, so what's happening is you're binding to the original, but the new ones that get created do not have it. http://jsfiddle.net/fRuhn/940/ Updated the fiddle, but here's the code: Fruit Animal Bird Car Banana Apple Orange Wolf Fox Bear Eagle Hawk BWM Changed to classes over ids, so i could bind to the proper select. Then i put your event binding into a function: function bindEvents() { $(".select1").change(function() { if($(this).data('options') == undefined){ /*Taking an array of all options-2 and kind of embedding it on the select1*/ $(this).data('options',$('#select2 option').clone()); } var id = $(this).val(); var options = $(this).data('options').filter('[value=' + id + ']'); $('.select2').html(options); }); } Then in the featherlight call, add an afterOpen: $('a').featherlight({ targetAttr: 'href', afterOpen: function () { bindEvents(); } });

http://stackoverflow.com/comment/38783536
score: 0
has text: @isnot2bad no the merged cells go from left to right, if the cells on the lift are different we dont merge the cells
type: Comment
comment on: http://stackoverflow.com/q/24953856
type: QuestionComment

http://stackoverflow.com/q/24973881
has comment: http://stackoverflow.com/comment/38821671
has comment: http://stackoverflow.com/comment/38821310
type: AnsweredQuestion
has title: Is it possible to change elements in Object tag in HTML? If yes, how?
has comment: http://stackoverflow.com/comment/38821634
type: Question
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38821514
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38821657
has answer: http://stackoverflow.com/a/24973946
accepted answer: http://stackoverflow.com/a/24973946
has body: I have a HTML page where part of its contents is an external web page loaded into it with a HTML object tag like this: Now, through jQuery or similar, I want to manipulate the contents of in the page that someUrl represents. Is that possible? If yes, how? Thanks :-)

http://stackoverflow.com/q/24974509
tagged with: three.js
has title: Three.js, Imported Camera from Collada can not look at an object scene
has comment: http://stackoverflow.com/comment/38824532
score: 1
tagged with: collada
upvote count: 1
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38824817
accepted answer: http://stackoverflow.com/a/24977223
tagged with: javascript
has comment: http://stackoverflow.com/comment/38824099
has answer: http://stackoverflow.com/a/24977223
answer count: 1
downvote count: 0
has body: Im struggling with Three.js to understand how Collada Animation workout ! I got an animation with a moving camera in 3Dsmax, and i exported the scene into Collada. loader.load( ColladaName, function ( collada ) { model = collada.scene; model.updateMatrix(); animations = collada.animations; kfAnimationsLength = animations.length; model.scale.x = model.scale.y = model.scale.z = 0.001; // 1/8 scale, modeled in cm document.getElementById('preload').style.opacity = '0'; callback() } ); I capture the camera object from the collada : model.traverse(function(child) { if (child instanceof THREE.PerspectiveCamera) { camera = child; camera.near = 1; camera.fov = 30; camera.castShadow = true; } if (child instanceof THREE.SpotLight) { child.castShadow = true; child.shadowBias = 0.02; child.shadowCameraNear = 1; child.shadowCameraFov = 60; child.intensity = 1.2; child.shadowMapWidth = 1024; // default is 1024 child.shadowMapHeight = 1024; // default is 1024 child.shadowDarkness = 0.06; // default is 512 } }); camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); Then i render it in my scene : camera.lookAt(scene.position) renderer.render(scene, camera); Everything show up, i can see my model, with my imported camera, but my camera doesnt look at the scene and doesnt reproduce the x-rotation like in my 3Dsm zoom in, and zoom out ! If i log the camera position it always show : 0,0,0. Better, if i log the model.children[0] position, wich correspond to the perspective camera imported into the collada, it always show 0,0,0 What am i doing wrong ? EDIT 1 : I tried to set my camera matrix with the imported camera from the collada : camera.matrixNeedsUpdate = true; model.children[0].matrixNeedsUpdate = true; model.children[0].lookAt(model.position) camera.matrix.elements = model.children[0].matrix.elements but no results unfortunately..
favorite count: 0

http://stackoverflow.com/comment/39040136
comment on: http://stackoverflow.com/q/25065548
type: QuestionComment
has text: I'm a little unsure. I'm still hearing that "x-axis should be a timestamp", right? And the y-axis is the percentage? No? Please @-me to notify of responses.
score: 0
type: Comment

http://stackoverflow.com/comment/38962355
type: AnswerComment
score: 0
type: Comment
has text: No worries. GO TEAM! ... I would totally not have solved this without your answer. I feel that I should share half my check mark with you!
comment on: http://stackoverflow.com/a/25026462

http://stackoverflow.com/comment/38904469
comment on: http://stackoverflow.com/q/25018080
type: Comment
has text: You can't. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures
type: QuestionComment
score: 2

http://stackoverflow.com/a/64708195
downvote count: 2
has comment: http://stackoverflow.com/comment/135238938
answers question: http://stackoverflow.com/q/24991072
score: 15
has comment: http://stackoverflow.com/comment/134818110
has comment: http://stackoverflow.com/comment/135243130
upvote count: 17
has comment: http://stackoverflow.com/comment/134376541
has comment: http://stackoverflow.com/comment/135242630
type: Answer
has body: Minimal HTML 5 version The example below has the benefit of no dependencies or external script needed. The tag is handy when opened with showModal as it displays a backdrop over the top of DOM declared around it even with display: relative | absolute on its direct parent. dialog { pointer-events: none; opacity: 0; transition: opacity 0.5s; display: flex; flex-direction: column; align-items: center; justify-content: center; } dialog[open] { opacity: 1; pointer-events: inherit; } dialog::backdrop { background-color: rgba(0,0,255, 0.2); } show dialog hi i'm a dialog! Close Using a with method=dialog accomplishes closing the modal without having to handle the close event. These two references are most enlightening: https://css-tricks.com/some-hands-on-with-the-html-dialog-element/ https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog Closing points As of 11-6-2020, Safari in general does not support this This makes React portals obsolete for modal purposes
has comment: http://stackoverflow.com/comment/135242568

http://stackoverflow.com/comment/38716982
type: Comment
type: QuestionComment
has text: btw in this code you dont have syntax errors
comment on: http://stackoverflow.com/q/24918203
score: 0

http://stackoverflow.com/a/25074289
score: 3
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: In index.html, try to place all the script tags at the end (just before the closing body tag). This should solve the problem.
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25068844
answers question: http://stackoverflow.com/q/25068844

http://stackoverflow.com/q/24921529
tagged with: php
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38724819
has comment: http://stackoverflow.com/comment/38724485
has answer: http://stackoverflow.com/a/24922306
type: Question
has comment: http://stackoverflow.com/comment/38723574
has body: I am trying to do a basic AJAX implementation to send some form data to a php script and db. I'm just doing this for learning purposes, and have taken it as far as I could. When I hit the "Create Profile" button, nothing is happening. From my code below, does anything obvious jump out at anyone in my syntax/structure? Note* I've yet to implement the code to retrieve the data using AJAX, will do this later once I get the send working. EDIT*** I made some slight changes to the sendFunction(), and have seen some success. Values are now being added to my database, but they values are blank, instead of the values in the form data. Thank you for all help/suggestions ahead of time! HTML doc: Ajax Form Create Profile First Name: Last Name: Search for Profile First Name: And here is my PHP script: <?php // Connect to the database $con = mysqli_connect('localhost', 'root', 'intell', 'ajax_profile'); // GET variables from xmlhttpCreate $fName = $_POST['fName']; $lName = $_POST['lName']; // Escape the user input to help prevent SQL injection $fName = mysqli_real_escape_string($fName); $lName = mysqli_real_escape_string($lName); // Build the query $query = "INSERT INTO users (firstName, lastName) VALUES ('$fName', '$lName')"; mysqli_query($con, $query); mysqli_close($con); $success = "Profile added to the database"; echo $success; ?>
tagged with: javascript
has comment: http://stackoverflow.com/comment/38723405
tagged with: ajax
has comment: http://stackoverflow.com/comment/38723383
score: 0
has comment: http://stackoverflow.com/comment/38723420
has comment: http://stackoverflow.com/comment/38723375
tagged with: mysqli
has comment: http://stackoverflow.com/comment/38724844
answer count: 1
accepted answer: http://stackoverflow.com/a/24922306
favorite count: 0
has title: Using AJAX to send form data to php script (without jQuery)
upvote count: 1

http://stackoverflow.com/a/25004857
answers question: http://stackoverflow.com/q/25004807
has comment: http://stackoverflow.com/comment/38879558
upvote count: 5
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25004807
has comment: http://stackoverflow.com/comment/38879501
score: 5
has body: Using the &lt; or &gt; operators with strings will compare the values alphabetically, which is probably not what you want. You need to compare these as numbers, not as strings. JavaScript allows you to easily cast a string to a number using +, like so: var qty = +itemqty.value; var isv = +iss.value; if(qty &gt; isv) { // ... } However, you can also use parseInt (which will return NaN if the value is invalid) if you want to add more error checking in your code.
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38879608

http://stackoverflow.com/q/25010228
downvote count: 0
score: 1
has title: Is it possible to limit the search of Google Map autocomplete to borough
type: Question
tagged with: javascript
tagged with: google-maps
upvote count: 1
has body: I have been looking at this documentation of Google Map API.It restricts the user search to a country. https://developers.google.com/maps/documentation/javascript/reference?hl=sv-SE#ComponentRestrictions Now, Is it possible to limit the search of Google Map to specific region(borough) of a particular city.I was looking for a demo example to limit my search to specific borough of New York City.E.g if the user has selected Manhattan, then the search should display addresses related to Manhattan.
answer count: 1
has answer: http://stackoverflow.com/a/25013912
accepted answer: http://stackoverflow.com/a/25013912
favorite count: 0
type: AnsweredQuestion

http://stackoverflow.com/a/25021818
score: 0
has comment: http://stackoverflow.com/comment/38911997
has comment: http://stackoverflow.com/comment/38912640
type: Answer
has body: I'm not sure what your browser requirements are, or how archaic the technology you're developing for is, but you might check out blur.js I could see it not being too heavy, dependent on how much content you have. Worst case you could probably put a full-width, full-height div between your active area and the rest of the site using absolute positioning and a z-index, and then run blur on that so that the active area has the appearance of being the only unblurred thing.
has comment: http://stackoverflow.com/comment/38912436
has comment: http://stackoverflow.com/comment/38912197
has comment: http://stackoverflow.com/comment/38912906
has comment: http://stackoverflow.com/comment/38914480
has comment: http://stackoverflow.com/comment/38914041
answers question: http://stackoverflow.com/q/25021678

http://stackoverflow.com/q/24985136
has title: How to scroll horizontal Only div on mouse wheel
has answer: http://stackoverflow.com/a/24985592
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/2346958
has comment: http://stackoverflow.com/comment/38842988
type: Question
has comment: http://stackoverflow.com/comment/38842303
answer count: 2
has answer: http://stackoverflow.com/a/24985174
has body: HTML markup: &lt;div class="big"&gt; long width text &lt;/div&gt; CSS rule: .big{ height:200px; background: red; } How to scroll horizontal Only BIG div on mouse wheel http://jsfiddle.net/cxD55/
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38842454
tagged with: css

http://stackoverflow.com/comment/38949310
score: 0
type: AnswerComment
type: Comment
has text: what if the dash was at the end of the url/word?
comment on: http://stackoverflow.com/a/25040966

http://stackoverflow.com/q/24917282
has title: Click on safari web page button using AppleScript
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm trying to figure out how to click on the button in a webpage. For example click on the "I'm Feeling Lucky" button in google web page. This is what I have tried: tell application "Safari" make new document with properties {URL:"https://www.google.com/"} do JavaScript "eval(document.getElementById('I'm Feeling Lucky').parentNode.href.substring(11))" in document 1 delay 1 end tell But it doesn't work. Any of you knows how can I click on the button using applescript? I'll really appreciate your help
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24921155
upvote count: 3
type: UnansweredQuestion
downvote count: 1
linked to: http://stackoverflow.com/q/24643251
tagged with: applescript
tagged with: safari
score: 2
type: Question

http://stackoverflow.com/a/24960656
has body: You don't need a to write a counting loop. txt.people.length will give you the count, as txt.people is an array object. See my revised fiddle for an example: http://jsfiddle.net/rsBYb/5/ Your loop was counting the elements in txt - of which there is only one (the people array). It would work fine if you instead use txt.people in the loop. You really want to count the elements in txt.people, not txt. Example of this: http://jsfiddle.net/rsBYb/8/
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38796296
type: Answer
accepted answer of: http://stackoverflow.com/q/24960645
score: 3
upvote count: 3
has comment: http://stackoverflow.com/comment/38796312
answers question: http://stackoverflow.com/q/24960645
downvote count: 0

http://stackoverflow.com/a/25018412
has body: You can keep a reference to the currently playing song. var current_audio; function play_wav(audio_name) { if (current_audio) { current_audio.stop(); } var src = document.querySelector('.'+audio_name).innerHTML = "&lt;audio src='audio/"+classs+".wav' class='audio_"+audio_name+"'&gt;"; current_audio = document.querySelector('.audio_'+audio_name); current_audio.play(); } I've never used audio in javascript before, but I'm assuming there is a stop function if there is a play function. Hope this helps!
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25018179
downvote count: 0
type: Answer

http://stackoverflow.com/a/25009829
type: Answer
has body: Others have given solutions, and you already have accepted one. But none of them have told you what is wrong with your code. Fristly, you have a body element inside your head element. This is invalid markup. Please correct it: Secondly, you need to have an idea about the execution order of JavaScript inside browser windows. Consider this example: Lorem Ipsum Which alert do you thing will get executed first? See the JSFiddle. So as you can see, inline JavaScript will be executed first, and then the browser will call whatever code is in <body onload=. Also, onload function is called immediately after the page is loaded. And user has not entered anything when the function is executed. That is why you get null for url. function func() var url = document.getElementById("url_id").value; var fullUrl = "http://".concat(url); alert(fullUrl); // or window.open(fullUrl); }
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25009023
accepted answer of: http://stackoverflow.com/q/25009023

http://stackoverflow.com/q/24989688
has comment: http://stackoverflow.com/comment/38850902
type: Question
has comment: http://stackoverflow.com/comment/38850927
tagged with: jsp
tagged with: javascript
tagged with: jquery
tagged with: image
score: 0
answer count: 2
tagged with: http://stackoverflow.com/tag/html
has body: I've provided a link with every image uploaded by the user which takes the user to a Slider to scroll through all the images that a user has uploaded on my site.The path of all the images uploaded by the user has been stored in a database. Now, what I want is that when a user clicks on a particular image the slider directly scrolls to that image and all the other images are arranged according to their respective positions in the database,i.e., those uploaded before that particular image are displayed before and similarly those uploaded after the image are displayed after the particular image in the slider. The slider uses the &lt;li&gt; tag to list the images in order. How can I perform the required task? I'll also put up my code below: &lt;% String lnk6 = "slider2.jsp?posted_id="+image_id; %&gt; &lt;a href = "&lt;%=lnk6%&gt;" &gt;&lt;img src = "&lt;%=lnk%&gt;" width = "500px" height = "400px" /&gt; &lt;/a&gt; This is the page where my image is being displayed. The string variable "lnk6" provides a link to the Slider. "image_id" is a variable, which is obtained above in the code(which I'm not displaying), provides the ID for a particular image.Now my code in Slider: int id_show = Integer.parseInt(request.getParameter("image_id")); PreparedStatement pstmt_show = conn.prepareStatement("select image,text from post where posted_id=?"); pstmt_show.setInt(1, id_show); ResultSet rst_show = pstmt_show.executeQuery(); while(rst_show.next()) { img_show = rst_show.getString(1); text_show = rst_show.getString(2); if(!(img_show.equals(""))) { link_show = "./postimages/"+img_show; %&gt; &lt;li&gt;&lt;img src="&lt;%=link_show%&gt;" title="&lt;%=text_show%&gt;" /&gt; &lt;/li&gt; &lt;% } } %&gt; "post" is the table where all the images uploaded by the user are stored.
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25017490
has answer: http://stackoverflow.com/a/24989740
has comment: http://stackoverflow.com/comment/38857314
has title: Directly scroll to a particular image

http://stackoverflow.com/a/25055705
downvote count: 0
has comment: http://stackoverflow.com/comment/38978792
has comment: http://stackoverflow.com/comment/38976087
has comment: http://stackoverflow.com/comment/38975322
has comment: http://stackoverflow.com/comment/38975499
has comment: http://stackoverflow.com/comment/38976604
has body: Object.observe, "sadly" (read next), doesn't perform a synchronous task. It sends notifications of the changes as soon as a "micro-task" ends. This is explained here. Years of experience on the web platform have taught us that a synchronous approach is the first thing you try because its the easiest to wrap your head around. The problem is it creates a fundamentally dangerous processing model. If you're writing code and say, update the property of an object, you don't really want a situation having update the property of that object could have invited some arbitrary code to go do whatever it wanted. It's not ideal to have your assumptions invalidated as you're running through the middle of a function. So, your "micro-task" ends after console.log("Output") has been called, then Object.observe notifies the changes on the object. The classic method to have synchronous events is using getters and setters instead: Person.prototype.setName = function(name) { this.name = name; console.log("Name Changed"); }; p.setName("Bob"); Of course, that would force you to create getters and setters for every property you want to watch, and forget about events on deleting and adding new properties.
score: 2
has comment: http://stackoverflow.com/comment/38975284
has comment: http://stackoverflow.com/comment/38977580
has comment: http://stackoverflow.com/comment/38980580
upvote count: 2
has comment: http://stackoverflow.com/comment/38975619
has comment: http://stackoverflow.com/comment/38979939
has comment: http://stackoverflow.com/comment/38975353
has comment: http://stackoverflow.com/comment/38977395
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38977361
has comment: http://stackoverflow.com/comment/38975383
accepted answer of: http://stackoverflow.com/q/25055589
has comment: http://stackoverflow.com/comment/38975446
has comment: http://stackoverflow.com/comment/38977773
type: Answer
has comment: http://stackoverflow.com/comment/38976989
answers question: http://stackoverflow.com/q/25055589
has comment: http://stackoverflow.com/comment/38975664

http://stackoverflow.com/comment/39005600
has text: You really need to revisit angular first. The way you are using JQuery selectors is really incorrect.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25056441

http://stackoverflow.com/q/24981521
score: 0
answer count: 3
possible better answer: http://stackoverflow.com/a/24981541
has answer: http://stackoverflow.com/a/24981575
has answer: http://stackoverflow.com/a/24981541
tagged with: angularjs
has answer: http://stackoverflow.com/a/24981775
has body: Say I have a URL like this: www.mysite.com?account=23&amp;token=asdu756sdg65sdf Now, I need to access those URL parameters individually using Angular JS. I've tried using location.search inside my controller: console.log(location.search); Which nicely returns the full query string: ?account=23&amp;token=asdu756sdg65sdf But it seems to return a string, not an object. Is there an easy way to access the individual ids and values in the string? I've also tried: console.log($location.search()); Which seems to return an empty object.
tagged with: url-parameters
type: AnsweredQuestion
has title: Search URL parameters with Angular JS
type: Question
accepted answer: http://stackoverflow.com/a/24981775
tagged with: javascript

http://stackoverflow.com/comment/38724949
type: AnswerComment
type: Comment
score: 1
has text: Okay. Then you can still use the getElementById stuff but set up your function the way I described at the bottom. That should make sure it all doesn't change at once
comment on: http://stackoverflow.com/a/24922328

http://stackoverflow.com/comment/49723482
type: Comment
comment on: http://stackoverflow.com/a/25277594
has text: the answer is very clear. thanks for that. I tried it with the latest version of slickgrid. The totals came along with the heading correctly. however if I collapse and expand some group, the functionality is lost.
score: 0
type: AnswerComment

http://stackoverflow.com/q/25035516
tagged with: jquery
score: 0
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/38948816
type: UnansweredQuestion
has title: Backbone dangling event callbacks in trigger function
has comment: http://stackoverflow.com/comment/38938458
answer count: 0
has body: I have a playerWrapper model which triggers playing event like so: playerWrapper.trigger('playing') Then, in a separate window's view called popupView, I listen to the event on initialize: this.listenTo(playerWrapper, 'playing', function() { doSomething() }); One peculiarity of my app is that it's a chrome extension that is separated into two windows, a popup window and a background window. They communicate with each other using chrome runtime methods. The problem I am having is that whenever I close the popup and re-open it, the above trigger throws the following error: Uncaught TypeError: Cannot read property '0' of undefined I debugged and pinned it down to Backbone source code's trigger and triggerEvents functions. triggerEvents function takes events argument, which is a list of event callbacks. In my case, there should be only one callback in the list. However, every time I re-open the popup, I get a duplicate event callback stacked inside the events argument, and that has been causing the problem. I suspected that this was caused from dangling Backbone views that are usually referred as zombie views so I tried this.stopListening() on popupView.initialize() function but I had no luck. Does anyone have insight on this problem? Thank you.
type: Question
tagged with: javascript

http://stackoverflow.com/comment/38967711
type: Comment
has text: In this case `asd` isn't an array key though. It's just an added property. Also, does not answer question.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25051661

http://stackoverflow.com/a/24978760
score: 1
has comment: http://stackoverflow.com/comment/38830416
has comment: http://stackoverflow.com/comment/38837941
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24977996
has comment: http://stackoverflow.com/comment/38830315
has comment: http://stackoverflow.com/comment/38830450
answers question: http://stackoverflow.com/q/24977996
has comment: http://stackoverflow.com/comment/61789145
type: Answer
upvote count: 1
has body: Here's one way to do the effect. Apply a fast blur (by Mario Klingemann) to your image, Overlay a "frost" made by a white rectangle at 25% opacity. The blur script is here: http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html Example code and a Demo: http://jsfiddle.net/m1erickson/PA9NC/ var canvas = document.getElementById("canvas"); var ctx = canvas.getContext("2d"); var img = new Image(); img.crossOrigin = "anonymous"; img.onload = start; img.src = "https://dl.dropboxusercontent.com/u/139992952/multple/Dog-With-Cute-Cat.jpg"; function start() { canvas.width = img.width; canvas.height = img.height; // draw the image ctx.drawImage(img, 0, 0); // blur the image with blur radius=10 stackBlurCanvasRGB("canvas", 0, img.height/2+30, img.width, img.height / 2, 10); // draw a white rectangle at 25% opacity ctx.globalAlpha = 0.25; ctx.fillStyle = "white"; ctx.fillRect(0, img.height/2+30, img.width, img.height / 2); // draw some text at 40% opacity ctx.globalAlpha = 0.40; ctx.font = "102px arial"; ctx.fillText("Us", 225, 275); }

http://stackoverflow.com/comment/38755335
comment on: http://stackoverflow.com/a/24937336
has text: Thanks for your reply. The following link is from IdeaBlade: http://www.breezejs.com/documentation/multiple-managers#CreateMultipleManagers, which explains that my methodology (which I took directly from them) is acceptable for very complex situations, such as the one I'm working with.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24923798
answers question: http://stackoverflow.com/q/24921829
has body: If you want to do some searching, first of course build the proper URL first, then from there search/scrape the site, actually the base code is already working so its time to build on that. You can do something like this: Sample Demo $main_url = 'http://www.mp3skull.com/mp3/'; $results = array(); if(isset($_POST['submit'])) { // handle input (sample: hot mallets) $input = preg_replace('/[\s]+/', '_', strtolower(trim($_POST['input']))); $main_url .= $input . '.html'; // turns to hot_mallets.html $contents = @file_get_contents($main_url); if($contents !== false) { // simple error checking $dom = new DOMDocument(); libxml_use_internal_errors(true); $dom->loadHTML($contents); libxml_clear_errors(); $xpath = new DOMXpath($dom); $search_results = $xpath->query('//div[@id="song_html"]'); if($search_results->length > 0) { foreach($search_results as $result) { // each row result, put it inside the array $results[] = $xpath->query('//div[@id="right_song"]/div[3]/div[1]/div[1]/a', $result)->item(0)->getAttribute('href'); } } else { echo 'Zero results'; } } else { echo 'Some error on getting results from external site.'; exit; } } ?> Song Name: <?php if(!empty($results)): ?> Search Results: <?php foreach($results as $result): ?> <?php echo $result; ?> <?php endforeach; ?> <?php endif; ?>
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24921829
type: Answer

http://stackoverflow.com/q/25034756
possible better answer: http://stackoverflow.com/a/25034841
tagged with: javascript
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25034841
linked to: http://stackoverflow.com/q/11510502
has answer: http://stackoverflow.com/a/25034888
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25034888
tagged with: asp.net
has body: I have a list of radio buttons generated dynamically by a list view. The user selects one radio button and click the Update button to update his data. I want to keep the button disabled until the user makes his selection. How can I accomplish that? &lt;asp:ListView ID="ListView1" runat="server" DataKeyNames="ID_BG" DataSourceID="SqlDataSource_BGlist"&gt; &lt;ItemTemplate&gt; &lt;itemtemplate&gt; &lt;label&gt;&lt;input id="Radio1" name="BG_list" type="radio" runat="server" value='&lt;%# Eval("BG_fileName") %&gt;'/&gt; &lt;img alt="" style="width:150px" src="/Members/images/BG/icons/&lt;%# Eval("BG_fileName") %&gt;"&gt;&lt;/label&gt; &lt;/itemtemplate&gt; .... &lt;asp:Button disabled="disabled" CssClass="btn btn-default" ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Change" OnClientClick="return confirm('Are you sure you want to change your Background Image?');" /&gt;
has title: Enable click button when a radio button is selected
type: AnsweredQuestion
type: Question

http://stackoverflow.com/comment/38918091
type: Comment
type: QuestionComment
has text: Did you do any research?
score: 0
comment on: http://stackoverflow.com/q/25022327

http://stackoverflow.com/comment/38824125
has text: @hugomg - the browser (Chrome) inserted closing , , and tags (in that order), which were then followed by the existing and tags.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24975330

http://stackoverflow.com/comment/139044752
type: Comment
has text: This should really be the answer as all the others seem to have unneeded guff or assume that everyone speaks english and\or is american...
comment on: http://stackoverflow.com/a/77274590
score: 0
type: AnswerComment

http://stackoverflow.com/a/24952812
type: Answer
has body: You should load scripts in order, jquery, underscore and then Backbone
answers question: http://stackoverflow.com/q/24952502
score: 0

http://stackoverflow.com/comment/38856359
comment on: http://stackoverflow.com/q/24992578
has text: If names are not unique how users can choose the right person from the suggestions?
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25026702
tagged with: angularjs
has body: I'm trying to create an AngularJS Directive to manage the promps of a input. The 3 different modes are as follows: Don't allow a blank option This is the default behavior Allow a blank option with no text Achieved by setting allow-blank="true" on the directive Allow a blank option with prompt text Achieved by setting allow-blank to any value other than "true" However, the blank options are never available. Demo on Plunker Template {{allowBlank}} Directive myApp.directive('mySelector', ['$http', function($http) { return { templateUrl:'my-selector-template.html', restrict: 'E', scope: { allowBlank: '@?' }, replace: true, controller: function ($scope) { $scope.myTags = [ {"name":"aliquam in","id":1}, {"name":"massa velit","id":2}, {"name":"nec vestibulum","id":3} ]; } }; }]);
tagged with: angularjs-ng-options
tagged with: angularjs-directive
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25027417
has title: Why are the blank options not being set for ng-options within a directive
type: Question
has comment: http://stackoverflow.com/comment/38922114
has comment: http://stackoverflow.com/comment/38924108
answer count: 1
has answer: http://stackoverflow.com/a/25027417
tagged with: javascript
upvote count: 1
favorite count: 0

http://stackoverflow.com/comment/38797839
type: QuestionComment
comment on: http://stackoverflow.com/q/24961378
has text: i have been searching this topic from round about 5 hours finally i came here and ask
score: 0
type: Comment

http://stackoverflow.com/q/25038858
has comment: http://stackoverflow.com/comment/38943317
tagged with: javascript
has body: I'm trying to trigger a keydown of the tab key in JavaScript. Scenario: 2 HTML input elements. Initially focus is on the 1st input, then wait 3 seconds, then simulate pressing of the tab key, which should set focus to the 2nd input. Issue: Dispatching a tab keydown event does nothing. Fiddles: Using KeyboardEvent & dispatchEvent - http://jsfiddle.net/dH9ZE/ Using simulant.js - http://jsfiddle.net/3E5dB/ I am after a JavaScript solution. No jQuery thanks. Fiddle example using simulant.js below: HTML: Dispatching Tab keydown event in 3 seconds... JavaScript: //simulates keydown of the tab key function simulateTab() { var TAB_KEY = 9; simulant.fire(document, 'keydown', { keyCode: TAB_KEY }); } //focus 'first' input document.getElementById('first').focus(); //focus 'second' input after 3 seconds setTimeout(function(){ simulateTab(); document.getElementById('done').innerHTML = 'Done!'; }, 3000);
tagged with: dom-events
favorite count: 0
upvote count: 8
has title: How to simulate/trigger keydown of tab in JavaScript?
type: UnansweredQuestion
score: 6
has comment: http://stackoverflow.com/comment/38944223
has comment: http://stackoverflow.com/comment/38943887
answer count: 0
downvote count: 2
type: Question
linked to: http://stackoverflow.com/q/17323279
tagged with: automation

http://stackoverflow.com/a/24918811
accepted answer of: http://stackoverflow.com/q/24917221
has comment: http://stackoverflow.com/comment/38720080
answers question: http://stackoverflow.com/q/24917221
has body: Demo:http://jsfiddle.net/robschmuecker/pznnj/1/ jQuery(document).ready(function ($) { var сlicked, clone; $(".gallery li").click(function () { clicked = this; $(".modal-content").fadeIn(); var clone = $(this).find('img').clone(true); clone.css({ opacity: 0 }); $('.modal-content').append(clone); clone.animate({ opacity: 1 }, 1000); }); $(".modal-close").click(function () { $(".modal-content").fadeOut(); }); $('.btnModal-right').click(function () { if ($(clicked).next('li').length) { nextImage = $(clicked).next('li').find('img'); clicked = $(clicked).next('li'); nextClone = nextImage.clone(true); nextClone.css({ opacity: 0 }); $('.modal-content').append(nextClone); nextClone.animate({ opacity: 1 }, 1000, 'swing', function () { $(this).prev().remove(); }); } }); $('.btnModal-left').click(function () { if ($(clicked).prev('li').length) { prevImage = $(clicked).prev('li').find('img'); clicked = $(clicked).prev('li'); prevClone = prevImage.clone(true); prevClone.css({ opacity: 0 }); $('.modal-content').append(prevClone); prevClone.animate({ opacity: 1 }, 1000, 'swing', function () { $(this).prev().remove(); }); } }); });
has comment: http://stackoverflow.com/comment/38895504
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38896225
upvote count: 1
has comment: http://stackoverflow.com/comment/38895870
has comment: http://stackoverflow.com/comment/38839405
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38853366

http://stackoverflow.com/comment/38967080
type: Comment
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/25051212
has text: Have the server calculate the expiration date and time and give that to the client, letting the client handle the countdown.

http://stackoverflow.com/comment/38708329
has text: you want to add the total for that particular item only or for all the items. make the question a bit more clear.
type: QuestionComment
type: Comment
score: 2
comment on: http://stackoverflow.com/q/24913888

http://stackoverflow.com/a/24945039
downvote count: 0
score: 1
type: AcceptedAnswer
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24944409
type: Answer
answers question: http://stackoverflow.com/q/24944409
has comment: http://stackoverflow.com/comment/38951609
has comment: http://stackoverflow.com/comment/38951719
has body: Is there a problem with this callback implementation for a module? Not if this what you want. Or with the module implementation? Your instantiation of the options property should probably use a deep extend, the current one is overwriting the complete callbacks object. I'm not sure what this other code I found is supposed to do. Is it intended to return data to the callback function Yes. It does support multiple arguments, using the arguments object … I registered when instantiating the module? No, it does not have to do with registration. It will call the method that is passed as a parameter to this callback function. Using this code will release you from the need to do that typeof check every time. You would just write helper.callback(this.options.callbacks.start, /* optional arguments */) // instead of if (typeof this.options.callbacks.start == "function") this.options.callbacks.start(/* arguments */) However, until you think that you need this helper you will not need this helper.

http://stackoverflow.com/comment/38963634
has text: Like this? http://jsfiddle.net/92PCR/3/
comment on: http://stackoverflow.com/a/25049132
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24922131
has comment: http://stackoverflow.com/comment/38728524
downvote count: 0
has body: I have tested try catch block and try catch block less method in angularjs. But why performance differ from one another. Please describe me. var format = 'yyyy-MM-dd HH:mm:ss Z' $scope.time1 = new Date(); $scope.time2 = new Date(); $scope.dif = 0; $scope.TestMethod = function () { var a = 0; $scope.time1 = new Date(); for (var i = 0; i &lt; 1000000000; i++) { a +=i; } $scope.time2 = new Date(); calculateDif(); } $scope.TryCatchMethod = function () { try { var a = 0; $scope.time1 = new Date(); for (var i = 0; i &lt; 1000000000; i++) { a +=i; } $scope.time2 = new Date(); calculateDif(); } catch (e) { throw e; } } function calculateDif(){ $scope.dif = $scope.time2-$scope.time1; } http://plnkr.co/edit/rb1IGuq7x1LIkj1G0R4G?p=preview
favorite count: 0
has title: Why try catch block performance differ from general block in Javascript
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38728529
has comment: http://stackoverflow.com/comment/38724679
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript

http://stackoverflow.com/comment/38776256
type: Comment
has text: chrome. I'm using it to open twitter sharing. maybe it's something they do that sets different sizes ...
type: QuestionComment
comment on: http://stackoverflow.com/q/24941131
score: 0

http://stackoverflow.com/comment/38978639
type: QuestionComment
comment on: http://stackoverflow.com/q/25056856
score: 0
has text: [___It is working___](http://codeshare.io/5qdfB)
type: Comment

http://stackoverflow.com/q/24942308
type: Question
upvote count: 2
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/38762435
has comment: http://stackoverflow.com/comment/38762337
has comment: http://stackoverflow.com/comment/38762542
answer count: 1
tagged with: platform
has answer: http://stackoverflow.com/a/24943181
has comment: http://stackoverflow.com/comment/38762960
tagged with: polymer
has title: Platform.js (Polymer), jQuery 2.x.x and Bootstrap - error
tagged with: javascript
tagged with: jquery
score: 2
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24943181
downvote count: 0
favorite count: 0
has body: I have a strange error after I've included Platform.js (v0.3.4) (Polymer), jQuery (v2.x.x) and Bootstrap.js (v3.2.0) on an empty page. With Safari and Firefox, on some events, such as click or keyup, on the (empty) page, it throws an error : TypeError: 'undefined' is not a function (evaluating 'elem.getAttribute( name )') There is no problem with jQuery v1.11.1, and I didn't try other versions of Platform. Neither with Chrome or Opera. If I replace all the 'click' by 'dblclick' in Bootstrap, there is no more error on click (it occurs on dblclick of course). Well, it's no big deal but it is surprising. Here is the code to test: PJB If anyone have any idea of how to avoid this error without breaking Bootstrap, jQuery of Platform, I'ld be glad to know. Thanks.

http://stackoverflow.com/comment/38844311
type: AnswerComment
type: Comment
score: 0
has text: Thanks. I'll have a look on this then.
comment on: http://stackoverflow.com/a/24986113

http://stackoverflow.com/q/24982675
type: Question
tagged with: javascript
score: 11
possible better answer: http://stackoverflow.com/a/45565720
answer count: 2
accepted answer: http://stackoverflow.com/a/26718701
has answer: http://stackoverflow.com/a/45565720
downvote count: 0
favorite count: 0
tagged with: http://stackoverflow.com/tag/svg
has title: Importing full SVG with PDFKit
upvote count: 11
type: AnsweredQuestion
tagged with: pdfkit
has body: Does anyone know if it's possible to import a full SVG into a PDFKit document? I can see from the docs that it has full SVG support, and there are methods for drawing paths etc, but I cannot see a method for importing a full SVG document.
has answer: http://stackoverflow.com/a/26718701

http://stackoverflow.com/comment/38944719
comment on: http://stackoverflow.com/a/25039477
score: 0
type: Comment
has text: I would have thought someone using Angular would be very likely to also be using jQuery.
type: AnswerComment

http://stackoverflow.com/comment/38710643
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24914889
has text: This is perfect and does exactly what I want it to do, with the exception of it not looking like a button anymore. Is there anyway to achieve that? I lied, I just added success and it looks like a button now.
score: 0

http://stackoverflow.com/a/25038439
answers question: http://stackoverflow.com/q/25038003
score: 0
has body: How about this? $("figure").hover(function() { $("#showhere").text($(this).find(".text").text()); }, function() { $(this).find(".text").fadeOut(); });
type: Answer

http://stackoverflow.com/q/24956261
type: Question
tagged with: google-apps-script
has answer: http://stackoverflow.com/a/24959401
answer count: 1
tagged with: javascript
type: UnansweredQuestion
score: 0
has body: I'm getting the following error in my app's script when replacing strings in a template file to generate reports. Index (-1) value must be greater or equal to zero. The function is listed bellow. /** * Search a String in the document and replaces it with the generated newString, and sets it Bold */ function replaceString(doc, String, newString) { var ps = doc.getParagraphs(); for(var i=0; i&lt;ps.length; i++) { var p = ps[i]; var text = p.getText(); //var text = p.editAsText(); if(text.indexOf(String) &gt;= 0) { //look if the String is present in the current paragraph //p.editAsText().setFontFamily(b, c, DocumentApp.FontFamily.COMIC_SANS_MS); p.editAsText().replaceText(String, newString); // we calculte the length of the string to modify, making sure that is trated like a string and not another ind of object. var newStringLength = newString.toString().length; // if a string has been replaced with a NON empty space, it sets the new string to Bold, Logger.log([newString,newStringLength]); if (newStringLength &gt; 0) { // re-populate the text variable with the updated content of the paragraph text = p.getText(); Logger.log(text); p.editAsText().setBold(text.indexOf(newString), text.indexOf(newString) + newStringLength - 1, true); } } } } When it errors out [newString,newStringLength] = [ The Rev Levels are at ZGS 003 on the electric quality standard. The part has a current change to ZGS 005!,108] Does anyone have any suggestions? Thanks in advance, Michael
has comment: http://stackoverflow.com/comment/38788383
has comment: http://stackoverflow.com/comment/38789053
has title: Replacing Stings, Index (-1) value must be greater or equal to zero.?

http://stackoverflow.com/comment/38739833
type: AnswerComment
comment on: http://stackoverflow.com/a/24930237
has text: This is a solution but shouldn't be strictly necessary look at the simple example the OP posted to a similar question yesterday http://jsfiddle.net/mohamedmusthafac/x5E2Y/1/
type: Comment
score: 0

titanium
type: Tag
tags question: http://stackoverflow.com/q/25063206
tags question: http://stackoverflow.com/q/24995086
tag name: titanium

http://stackoverflow.com/comment/38864492
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24996841
has text: Can you post a fiddle?
score: 0

http://stackoverflow.com/a/25038659
score: 0
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38943470
accepted answer of: http://stackoverflow.com/q/25038364
answers question: http://stackoverflow.com/q/25038364
has body: Use jQuery.getScript() instead $.getScript( 'example-external.js', function( data, textStatus, jqxhr ) { //done });

instantiation
type: Tag
tags question: http://stackoverflow.com/q/25067195
tag name: instantiation

http://stackoverflow.com/q/24952887
answer count: 3
has answer: http://stackoverflow.com/a/24953041
has comment: http://stackoverflow.com/comment/38782475
favorite count: 0
has answer: http://stackoverflow.com/a/24953191
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38781870
tagged with: authentication
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/38781984
has comment: http://stackoverflow.com/comment/38781848
type: Question
has comment: http://stackoverflow.com/comment/38782581
has title: Login via AJAX, no errors but no results
has answer: http://stackoverflow.com/a/24953145
has comment: http://stackoverflow.com/comment/38782766
has comment: http://stackoverflow.com/comment/38781735
has comment: http://stackoverflow.com/comment/38782131
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have this code: Log In Log In function submitLogin() { username = $("#login-username").val(); password = $("#login-password").val(); $.ajax({ type: "POST", url: "login.php", data: "name=" + username + "&pwd=" + password, success: function(html) { if (html == 'true') { //$("#add_err").html("right username or password"); window.location="dashboard.php"; } else { $("#error").css('display', 'inline', 'important'); $("#error").html(" Wrong username or password"); } }, beforeSend: function() { $("#error").css('display', 'inline', 'important'); $("#error").html(" Loading...") } }); return false; } This is login.php: <?php require_once 'config.php'; session_start(); $uName = $_POST['login-username']; $pWord = md5($_POST['login-password']); $qry = "SELECT usrid, username, password FROM users WHERE username='".$uName."' AND password='".$pWord."'"; $res = mysql_query($qry); $num_row = mysql_num_rows($res); $row = mysql_fetch_assoc($res); if( $num_row == 1 ) { echo 'true'; $_SESSION['uName'] = $row['username']; } else { echo 'false'; } ?> When I click login the page seems to reload or at least update. There are no errors but also there is no success. For the life of me can't work out whats wrong. Help would be greatly appreciated.
has comment: http://stackoverflow.com/comment/38782258
score: 0

http://stackoverflow.com/a/25037145
answers question: http://stackoverflow.com/q/25036059
type: AcceptedAnswer
downvote count: 0
has body: I would recommend using CSS for this. The browser would then identify if the snip-it appears within an element defined as the modal and the correctly apply the style. Assuming you are using LESS with your bootstrap implementation an example is below. But it should give you a general idea either way. LESS CSS markup: div.content { .col-lg-5 } modal { div.content { .col-sm-9; } } HTML: Heading content...
accepted answer of: http://stackoverflow.com/q/25036059
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/comment/38818859
type: Comment
has text: You have your php code in a function, are you calling that function -> `selectPartName();` after you have defined it? Also, which alert works, the `alert("AJAX");`, the `alert("SOURCE");` or both?
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24972510

http://stackoverflow.com/comment/38769764
type: AnswerComment
comment on: http://stackoverflow.com/a/24946246
has text: Technically the answers that say the return value is an array are not 100% correct, since it's not an array.
type: Comment
score: 1

http://stackoverflow.com/a/25047780
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38983986
has body: Change line 64 from .attr("x", function(d) { return x (d.values); }) to .attr("x", 0) since that is what sets the x position of the bar. EDIT: Ah, so what you want is actually to fill the negative space, instead, so you also wanted to change the length of the bars. If you want to change the width, modify the width attribute. .attr("width", function(d) { return width - x(d.values); }); should be .attr("width", function(d) { return x(d.values); });
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25047562
has comment: http://stackoverflow.com/comment/38988408
answers question: http://stackoverflow.com/q/25047562
score: 3
has comment: http://stackoverflow.com/comment/38964011
upvote count: 3

http://stackoverflow.com/a/25111124
has body: Here is my implementation and use this method everywhere. function trans(callback, done) { sequelize.transaction(function (t) { function commit(callback) { t.commit().done(function (err) { console.log('commited') if (callback) callback(err) }) } function rollback(rollbackErr, callback) { t.rollback().done(function (err) { if (callback) callback(err || rollbackErr) }) } t.done(function () { if (done) done() }) callback(commit, rollback, t) }) } function someExecution(data, callback){ trans(function(commit, rollback, t){ Model.create(data, {transaction: t}).done(function(err, obj){ if (err) return rollback(err, callback) Model.findAll({where: {some: 1}}, {transaction: t}).done(function(err, list){ if (err) return rollback(err, callback) commit(callback) }) }) }) }
upvote count: 1
has comment: http://stackoverflow.com/comment/39089289
answers question: http://stackoverflow.com/q/25064698
downvote count: 0
type: Answer
score: 1

http://stackoverflow.com/a/24915948
answers question: http://stackoverflow.com/q/24915581
score: 0
has body: When You execute Your script runner.php for the first time You can create a file and lock it until script ends, so when there is another request to that script You can check if file is locked - and then You have information if You can run script again, example: $fo = fopen('lock.txt', 'r+'); if (flock($fo, LOCK_EX)) { // File was not locked, You have locked it successfully right now, do your logic flock($fo, LOCK_UN); // unlock file afer script logic } else { // File is locked right now, don't run script } After that You can send message to user that he can try later (cause first script is running) instead of killing first script. I think this is design problem when it comes to killing script, it doesn't look well. What about data when You kill script in middle of its execution? This can lead to some serious issues.
type: Answer
has comment: http://stackoverflow.com/comment/38712690
has comment: http://stackoverflow.com/comment/38712556

http://stackoverflow.com/comment/38843702
type: QuestionComment
has text: I commented the code to see if I could get a simple alert to fire.
comment on: http://stackoverflow.com/q/24985815
score: 0
type: Comment

http://stackoverflow.com/comment/38824958
comment on: http://stackoverflow.com/a/24973026
type: AnswerComment
score: 0
type: Comment
has text: @guest271314 - This is the best I can find in terms of references about the future of `.progress` [here](http://stackoverflow.com/questions/23403814/how-do-promises-a-implementations-vary/23404096#23404096) and [here](http://stackoverflow.com/questions/23865481/how-to-call-q-promise-notify-within-the-promise-chain/23866364#23866364).

http://stackoverflow.com/q/25044974
has comment: http://stackoverflow.com/comment/38983382
answer count: 1
tagged with: ajax
has body: I am trying to post data to an action with ajax in yii. Currently I am hard coding true and false in the action to see if I am even posting data, and it's not getting there. I can't seem to figure out where I am going wrong. Any Information would help, Thank you JS/AJAX below: function printObject(o) { // alerts an object var out = ''; for (var p in o) { out += p + ': ' + o[p] + '\n'; } alert(out); } $(function() { var dialog, form, //select ticket_code, I don't know if this is working properly ticket_code = $( "#ticket_code"), allFields = $( [] ).add( ticket_code ), tips = $( ".validateTips" ); function addTicket() { var valid = false; //alert ticket_code (however, it only alerts a long error message) //saying that the length is 1, but not sure if that is correct //see link at the end for error message. printObject(ticket_code); $.ajax({ type: "POST", url: '<?php echo Yii::app()->createUrl('ticket/addTicket'); ?>', data: {ticket_code : ticket_code}, success: function(){ alert('got here'); valid = true; } }); alert("after ajax"); if ( valid ) { dialog.dialog( "close" ); alert('yay'); } } actionAddTicket below: public function actionAddTicket(){ if(isset($_POST['ticket_code'])){ return true; } return false; } form view below: Please Enter Ticket Number Ticket Code #
has comment: http://stackoverflow.com/comment/38966568
has answer: http://stackoverflow.com/a/25062262
has comment: http://stackoverflow.com/comment/38980384
has comment: http://stackoverflow.com/comment/38957226
accepted answer: http://stackoverflow.com/a/25062262
type: AnsweredQuestion
has title: yii, ajax, javascript not calling action
type: Question
has comment: http://stackoverflow.com/comment/38955495
has comment: http://stackoverflow.com/comment/38958132
has comment: http://stackoverflow.com/comment/38983331
tagged with: yii
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38955643

http://stackoverflow.com/comment/69081012
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24997626
has text: setting the canvas handling in the onrendered variable tells it to process it after rendering all of the images. I use this library the same way as in this answer.
type: AnswerComment

http://stackoverflow.com/q/24995938
favorite count: 0
type: UnansweredQuestion
tagged with: requirejs
upvote count: 1
has body: I know it is recommended not to use them, but let's say just for fun I'd like to use module with custom name. How can I load it? I have following structure: -- ./index.html -- ./js/app.js -- ./js/test.js In HTML, I'm loading RequireJS (2.1.14) &lt;script src="js/require.js" data-main="js/app" type="text/javascript"&gt;&lt;/script&gt; In app.js: require(["dummy"], function(){ window.console.log("ready"); }) In test.js: define("dummy", [], function(){ window.console.log("dummy loaded"); }) But RequireJS is trying to load dummy.js. What am I missing here? Update: I know I can use require.config to load the file require.config({ paths: { "dummy" : "test" } }) But then I don't understand why is one able to define custom name if he has to re-declare it again in paths...
score: 1
type: Question
has answer: http://stackoverflow.com/a/24996065
tagged with: javascript
has title: How to load custom named module in RequireJS
downvote count: 0
answer count: 1

http://stackoverflow.com/comment/128383083
score: 0
type: Comment
has text: "*prefer boolean properties over adding and deleting an indicator property.*" - or set the indicator property to `null`/`undefined` for the states where it shouldn't have any normal value
comment on: http://stackoverflow.com/a/72592730
type: AnswerComment

http://stackoverflow.com/comment/38777869
comment on: http://stackoverflow.com/a/24942776
score: 0
type: AnswerComment
has text: I'm not sure to have understood... But it's right . `_self` valued inside the __A__ & __B__ instance is a property of `window`. That's is the answer of my question. You're suggesting to use `B.method()` and `A.method()` directly?
type: Comment

http://stackoverflow.com/comment/38892581
score: 0
type: AnswerComment
has text: hey but your answer is not prefect because i am .item-active is scroll when i am click leftarrow..
type: Comment
comment on: http://stackoverflow.com/a/25011593

http://stackoverflow.com/comment/38801907
type: Comment
type: QuestionComment
has text: You could make it very simple and send the data you want to fill in via the URL as a GET parameter. The other page then has to read the parameter and fill the form. This could be done server or client side.
comment on: http://stackoverflow.com/q/24963047
score: 0

http://stackoverflow.com/comment/38827724
comment on: http://stackoverflow.com/a/24953105
score: 0
type: AnswerComment
type: Comment
has text: The edited version works, although I have to preserve sign through the cos^2,sin^2, and sqrt calculations when angles are more than pi/2. The whole Etot=Ex+Ey is strange, but works, I guess it's no longer a typical vector as normal vector magnitude doesn't apply. My "v = e * vtot / Etot" method I believe is exactly equivalent and appears the same when I run the "game", but required a lot less code and the same number of complex calculations (1 cos, 1sin, 2 sqrt). I'll paste the final code into my question soon.

http://stackoverflow.com/a/24981755
has comment: http://stackoverflow.com/comment/38835772
downvote count: 0
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38835799
type: AcceptedAnswer
has body: 1) You must have a unique name attribute on each element. This is a requirement of the jQuery Validate plugin. 2) The first option must have value="" and not value="0". Working DEMO: http://jsfiddle.net/hTPY7/1436/ 3) OP's demo is broken because he keeps using the same id twice. For valid HTML, every id must be unique on a page. DEMO with ID: http://jsfiddle.net/hTPY7/1441/
has comment: http://stackoverflow.com/comment/38835832
has comment: http://stackoverflow.com/comment/38835816
accepted answer of: http://stackoverflow.com/q/24981189
type: Answer
answers question: http://stackoverflow.com/q/24981189

http://stackoverflow.com/a/25027268
has comment: http://stackoverflow.com/comment/38922253
has body: Might as well add yet another answer... typeof obj.style === 'object' &amp;&amp; Object.keys(propertyObj).forEach(function(key) { obj.style[key] = propertyObj[key]; }); IMO, Object.keys is superior to a for ... in loop as it is immune from Object prototype injection problems. This also ensures that obj has a style property to begin with. Update Because some people are in to micro-optimisation, here it is without the Array.forEach if (typeof obj.style === 'object') { var keys = Object.keys(propertyObj); for (var i = 0, l = keys.length; i &lt; l; i++) { var key = keys[i]; obj.style[key] = propertyObj[key]; } }
has comment: http://stackoverflow.com/comment/38922160
has comment: http://stackoverflow.com/comment/38922126
has comment: http://stackoverflow.com/comment/38922132
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38922448
has comment: http://stackoverflow.com/comment/38922416
has comment: http://stackoverflow.com/comment/38922265
accepted answer of: http://stackoverflow.com/q/25027120
type: Answer
has comment: http://stackoverflow.com/comment/38922243
answers question: http://stackoverflow.com/q/25027120
has comment: http://stackoverflow.com/comment/38922094
score: 0
has comment: http://stackoverflow.com/comment/38922140
upvote count: 1
has comment: http://stackoverflow.com/comment/38922294
has comment: http://stackoverflow.com/comment/38922212
downvote count: 1
has comment: http://stackoverflow.com/comment/38922149

http://stackoverflow.com/comment/38717335
score: 0
type: QuestionComment
has text: @tymeJV i want to suspend other activity unless i get response from fun2..how to achieve this ?
type: Comment
comment on: http://stackoverflow.com/q/24918393

http://stackoverflow.com/a/24964087
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38803431
upvote count: 2
has body: Unless the script contains an algorithm with high time or space complexity, the execution should be near instant (less than 10 milliseconds). The css will probably take effect even faster. The only thing concerning speed or performance to consider is the loading itself of these files. If they are cached, it should also be very fast. However, if they are not cached and have not been accessed previously then their loading time will depend on several factors (such as connectivity, bandwidth, etc.). These factors of downloading the actual files are all that should be considered with regards to speed and performance. To alleviate it, the files could be preloaded just to trigger the cache. If that is accomplished, there should be no negative hits to performance or speed using or swapping css and javascript files.
accepted answer of: http://stackoverflow.com/q/24964020
answers question: http://stackoverflow.com/q/24964020

infinite-scroll
tag name: infinite-scroll
type: Tag
tags question: http://stackoverflow.com/q/25016943

http://stackoverflow.com/q/25069412
has body: Is there a built in way in javascript that formats a date object in a format like “Y-m-d H:i:s”? I use var since= new Date(xhr.getResponseHeader("Last-Modified")); alert("modified:: " +since.getDate()+'.'+(since.getMonth()+1)+'. '+ since.getHours()+':'+since.getMinutes()) But that cuts off all leading zeros
has comment: http://stackoverflow.com/comment/39001609
type: Question
has title: print date like 'Y-m-d H:i:s"in javascript
has answer: http://stackoverflow.com/a/25069495
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25069495
answer count: 2
possible better answer: http://stackoverflow.com/a/25069572
has answer: http://stackoverflow.com/a/25069572
type: AnsweredQuestion

http://stackoverflow.com/comment/38736684
type: Comment
score: 1
has text: He say I *don't* need to add div into the proper dropdownlist controller.
type: AnswerComment
comment on: http://stackoverflow.com/a/24929089

http://stackoverflow.com/comment/38965774
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25050597
has text: @user3593878 - Regular arrays always start at 0 and go till their `length - 1` - You can choose to explicitly store values from index `1` - but it doesn't change the fact that they start from `0`.

http://stackoverflow.com/comment/38925453
has text: whts your IE version ?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25013942

http://stackoverflow.com/comment/38801582
type: Comment
type: QuestionComment
has text: Are your views tied to different collections or one collection?
score: 0
comment on: http://stackoverflow.com/q/24963160

http://stackoverflow.com/q/25025530
has comment: http://stackoverflow.com/comment/38919453
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has title: MVC 5 Html.ValidationSummary still visible after AJAX post
linked to: http://stackoverflow.com/q/17844156
has answer: http://stackoverflow.com/a/25042284
upvote count: 2
type: UnansweredQuestion
has body: When using Html.ValidationSummary and Html.BeginForm, you typically reload or navigate away from the page when all fields validate and the controller can perform the next steps. In this situation, there is no need to clear the validation summary. However, when using Ajax.BeginForm the user might never leave the page. Once the form is validated, control goes to the controller live above but the controller may send the user back to the calling form as some server-side validation needs to be addressed. In this situation, an apparent bug in .NET does not clear the ValidationSummary. Yes, I can hide/clear it via JavaScript/JQuery using the OnBegin property of the form, but then it never unhides if it's needed on the form at a later step, say when you invalidate the client side validation. A snippet of my form: @using (Ajax.BeginForm("ExistingLogin", "Home", null, new AjaxOptions { HttpMethod = "Post", OnBegin="onBegin", OnSuccess = "onSuccess", OnFailure = "onError" }, new { @class = "form-horizontal", role = "form" })) { @Html.AntiForgeryToken() @Html.ValidationSummary("Please correct the following errors:", new { @class = "alert alert-danger", @role = "alert" }) &lt;div id="controllerResponse" class="alert alert-danger" role="alert" style="display:none;"&gt;&lt;/div&gt; How do you handle this?
tagged with: asp.net-mvc
tagged with: javascript
type: Question
score: 2

http://stackoverflow.com/q/24984359
answer count: 1
downvote count: 0
accepted answer: http://stackoverflow.com/a/24984393
favorite count: 0
upvote count: 2
tagged with: three.js
tagged with: animation
has answer: http://stackoverflow.com/a/24984393
score: 2
type: AnsweredQuestion
has title: js Model Animation Using three.js r68
type: Question
tagged with: javascript
has body: As stated in the title, I cannot get animation to work. I'm pretty sure I'm missing something in my code because it works here, but not where I'm testing. I create the animation object in playerCharacter.js with this.init = function(){ for (var k in this.mesh.material.materials) {this.mesh.material.materials[k].skinning = true;} this.animation = new THREE.Animation(this.mesh, this.mesh.geometry.animations[0].name); this.animation.play(); } In the update function I use: this.animation.update(0.017); And when I look at the console log I get: Uncaught TypeError: Cannot read property 'length' of undefined So it seems that in THREE.AnimationHandler, data.hierarchy is undefined, so I'm guessing that if I can somehow make it defined, the problem will be fixed. Except I don't know how, or even why it is not defined. Any help?

http://stackoverflow.com/comment/38818573
has text: You can access it as `result[40]neededNode` (`var a = {40: {neededNode: 'f'}}; console.log(a[40].neededNode);` outputs `f`). I don't know if that answers your question though.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24972412
score: 1

http://stackoverflow.com/q/24980513
has answer: http://stackoverflow.com/a/24980541
has title: Ajax call does not invoked the controller
type: Question
has comment: http://stackoverflow.com/comment/38833494
tagged with: asp.net-mvc
tagged with: javascript
has comment: http://stackoverflow.com/comment/38833508
has comment: http://stackoverflow.com/comment/38833554
score: 0
accepted answer: http://stackoverflow.com/a/24980541
answer count: 1
tagged with: asp.net
tagged with: ajax
has comment: http://stackoverflow.com/comment/38833686
has body: Im using the following code to call to controller action and I get interanl server error 500 in the console, the path lookes fine so what can be the problem. the entryId have value of 1... Here is the AJAX CALL $.ajax({ type:'POST', url: "../../user/DeleteConfirmed", dataType: "json", contentType: "application/json; charset=utf-8", data: 'id=' + entryId }); Here is the controller action code [HttpPost, ActionName("DeleteConfirmed")] public JsonResult DeleteConfirmed(int id) { .. The error is POST https://127.0.0.1/user/DeleteConfirmed 500 (Internal Server Error) jquery-2.1.1.js:8623 jQuery.ajaxTransport.send jquery-2.1.1.js:8623 jQuery.extend.ajax jquery-2.1.1.js:8152 (anonymous function) Index:519 jQuery.event.dispatch jquery-2.1.1.js:4409 jQuery.event.add.elemData.handle
tagged with: asp.net-mvc-4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38833623

http://stackoverflow.com/a/24963612
type: Answer
downvote count: 0
has body: When you return from a function, you return $("#maincontainer").load("index.php #container", "null" , function(){ return false; // YOU RETURNED HERE, NOTHING BELOW IS EXECUTED alert("contents loaded"); }); There's no need to return anything from load()
score: 1
answers question: http://stackoverflow.com/q/24963580
upvote count: 1

http://stackoverflow.com/comment/38992899
comment on: http://stackoverflow.com/q/25064986
score: 0
type: Comment
type: QuestionComment
has text: *"Can I write a jQuery function that will fire when the text is clicked and perform a .post() method to the item.php page passing along the item ID ?"* Yes. Try out your code and see how it works out.

http://stackoverflow.com/q/24953431
type: AnsweredQuestion
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/24954872
type: Question
linked to: http://stackoverflow.com/q/27308367
tagged with: javascript
has body: Today I'm using parse.com and I would like to perform an asynchronous programming in javascript. I found the npm async module: https://www.npmjs.org/package/node-async But parse.com doesn't accept npm modules. Would you know any alternative to async module for parse.com ? Thanking you in anticipation
answer count: 2
accepted answer: http://stackoverflow.com/a/24954872
downvote count: 0
tagged with: asynchronous
has title: An alternative to npm async module?
favorite count: 0
tagged with: parse-platform
tagged with: npm
possible better answer: http://stackoverflow.com/a/27308397
has answer: http://stackoverflow.com/a/27308397

http://stackoverflow.com/comment/38978784
has text: But I don't want to explicitly define it because this is an update and the $id is already defined on the original document.
comment on: http://stackoverflow.com/a/25057713
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24978473
has comment: http://stackoverflow.com/comment/38830110
has comment: http://stackoverflow.com/comment/38831006
score: 16
tagged with: google-chrome
type: Question
has comment: http://stackoverflow.com/comment/38830415
has body: I am really confused here. I am trying to understand the file architecture of chrome extension. I am reading this doc: https://developer.chrome.com/extensions/overview#arch My situation: I want to setup the oauth flow so that user can log in inside the extension (the other endpoint is my django backend). Till now, I have these files: background.js content.js popup.html manifest.json where my content.js sends message to background.js and gets response back. so far so fine! But now while reading the doc for oauth, i am confused not knowing what the background.html is. is it actually the file which should contain all js code of my background.js? but, if i change this in manifest to .html, like: "background": { "persistent": false, "scripts": ["jquery111.js", "background.html"] extension isnot working anymore. In OAuth doc, it says: Place the four library files in the root of your extension directory (or wherever your JavaScript is stored). Then include the .js files in your background page... Your background page will manage the OAuth flow. but in the architecture doc, it says: This figure shows the browser action's background page, which is defined by background.html and has JavaScript code that controls the behavior of the browser action in both windows. what is the difference between background.html and background.js?
answer count: 1
downvote count: 0
tagged with: javascript
has title: background.html vs. background.js - chrome extension
favorite count: 0
type: UnansweredQuestion
tagged with: google-chrome-extension
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/56061710
upvote count: 16

http://stackoverflow.com/comment/38878155
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25004122
has text: Shouldn't `if (j = 0)` be `if (j == 0)`?
score: 4

http://stackoverflow.com/comment/38763212
type: AnswerComment
comment on: http://stackoverflow.com/a/24937344
score: 0
has text: Well, I've tried the code (I'm less familiar with jquery than I am with javascript, so...) and now the script is not even being hit. See below. Any help would be very much appreciated!!
type: Comment

http://stackoverflow.com/a/24916701
type: AcceptedAnswer
downvote count: 0
has body: Two things I have noticed: 1.Your checked property on your first radio button should be checked="checked" 2.This code seems to work when hovering over the radio buttons. If you would like it to work when hovering over the label, you will want to add onmouseover and onmouseout event handlers to the labels also. For example: Door http://jsfiddle.net/puddinman13/Mh7PZ/
type: Answer
upvote count: 6
accepted answer of: http://stackoverflow.com/q/24916342
score: 6
answers question: http://stackoverflow.com/q/24916342
has comment: http://stackoverflow.com/comment/38713900

http://stackoverflow.com/q/24951608
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
has body: In my ASP.NET MVC view, @using (Html.BeginForm("MyAction","MyController",FormMethod.Post)) { &lt;input type="submit" id="submitSelectedItems" value="Add to Items" /&gt; } Also I have a Jquery onclick event for the submit button, $a("#submitSelectedItems").on("click", function () { if (SelectedItem.length &lt;= 0) { alert("Please select a style to proceed!!"); return flase; } else { return true; } return flase; }); Here I am successfully getting the alert when ever there is no items selected, however after the alert eventhough I am returning false, here the post to the action method is not stopped, it continuous with that? How can I stop posting? I even tried with e.preventDefault();, but no luck.
score: 0
has title: Returning false not working with MVC post
has answer: http://stackoverflow.com/a/24951691
accepted answer: http://stackoverflow.com/a/24951691
upvote count: 1
has comment: http://stackoverflow.com/comment/38779600
downvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38779581
has comment: http://stackoverflow.com/comment/38779778
has comment: http://stackoverflow.com/comment/38779664
type: AnsweredQuestion
tagged with: asp.net-mvc

http://stackoverflow.com/a/25064744
upvote count: 2
has body: I've just answered a similar question here: https://stackoverflow.com/questions/25059168/java-websocket-client-in-jsp-possible/25059382#25059382 The generic answer is: JSP can contain anything that a regular HTML page can contain. JSP is an HTML extended with JSP tags that are processed on a server. After the JSP tags are processed and a response is generated there is no any difference between that response and a regular HTML. So, the question really is where to store the java scripts in an HTML. I think, the cleanest way would be to put them to a separate file or files and then use a &lt;script&gt; tag with an 'src' attribute: &lt;script src="&lt;java-script-url&gt;"&gt;&lt;/script&gt; But in cases when java scripts are not that big and complicated, it's OK to include them to the page itself under &lt;head&gt; element of your page.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25064011
score: 2
answers question: http://stackoverflow.com/q/25064011
downvote count: 0

http://stackoverflow.com/q/25009960
downvote count: 2
has comment: http://stackoverflow.com/comment/38889648
has comment: http://stackoverflow.com/comment/38888992
has comment: http://stackoverflow.com/comment/38889029
has comment: http://stackoverflow.com/comment/38889463
upvote count: 1
has comment: http://stackoverflow.com/comment/38889236
has comment: http://stackoverflow.com/comment/38889085
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38889181
has comment: http://stackoverflow.com/comment/38889618
has title: Call a var object form another var in JavaScript
has comment: http://stackoverflow.com/comment/38889210
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38889432
type: Question
has body: I have a var: var main= { init: function (model) { // model is an object test.init(); main.model = model; } } var test = { init: function () { **Solved** my problem is when i loged it, what i actualy did was: console.log('result:' + main.model); //and it failed to concrate string with object } } 'main.model' is not found. How can i access an object from 'main' in 'test'? Edit The actual code calling main.init() is within the cshtml: $(document).ready(function () { var model = @Html.Raw(Json.Encode(Model)) main.init(model); });
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/25010010
has comment: http://stackoverflow.com/comment/38889341
accepted answer: http://stackoverflow.com/a/25010010

http://stackoverflow.com/comment/39059211
has text: why can't you stream it in a loop from your phone..? why does the file has to be on the internet?
comment on: http://stackoverflow.com/q/25003269
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38782061
comment on: http://stackoverflow.com/q/24953034
type: QuestionComment
score: 0
has text: go to jsbin.com.. and you can create a fiddle with the html,js you are using
type: Comment

http://stackoverflow.com/comment/38863807
score: 0
type: Comment
type: QuestionComment
has text: Make sure `#banner-slide` is on the apge and make sure you are calling that library
comment on: http://stackoverflow.com/q/24996612

http://stackoverflow.com/comment/38955542
score: 0
type: Comment
has text: I already have the domain class. Do the fields need to be named the same as they are in the JSP form? Does the constructor need to do anything, or will setters work? How should the controller change to access the JSON?
comment on: http://stackoverflow.com/a/25045030
type: AnswerComment

http://stackoverflow.com/q/24987737
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24987849
type: Question
tagged with: ember-data
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
tagged with: ember.js
accepted answer: http://stackoverflow.com/a/24987849
has title: emberjs split promise array
type: AnsweredQuestion
has body: I am trying to split an ember store record into 3 columns for display purposes. I am attempting to do this in a controller action but I have a feeling this is wrong due to the way promises are filled. Gist of how I would like my data to look (handlebar friendly). var events = [ {column: ['work1','work2','work3']}, {column: ['priv1','priv2','priv3']}, {column: ['mail1','mail2','mail3']} ]; Below is the code I am running. When I attempt to arrange the events into a different object no data is stored. //app/controllers/index.js import Ember from 'ember'; export default Ember.Controller.extend({ columns: function(){ var events = this.store.find('event'); var columns = [[],[],[]]; var count = 0; events.forEach(function(item, index, enumerable){ columns[count].push(item); count++; if (count === 4){ count = 0; } }); columns = [{column: columns[0]}, {column: columns[1]}, {column: columns[2]}]; return columns; }.property() }); . //app/templates/index.hbs &lt;div class="row"&gt; {{#each 'columns'}} &lt;div class="col-lg-4"&gt; {{#each 'column'}} {{this}} {{/each}} &lt;/div&gt; {{/each}} &lt;/div&gt;

bootstrap-typeahead
tags question: http://stackoverflow.com/q/24928384
tag name: bootstrap-typeahead
tags question: http://stackoverflow.com/q/25041613
tags question: http://stackoverflow.com/q/25058076
type: Tag

http://stackoverflow.com/a/24976141
has comment: http://stackoverflow.com/comment/38829524
has comment: http://stackoverflow.com/comment/38825489
answers question: http://stackoverflow.com/q/24976039
has comment: http://stackoverflow.com/comment/38825755
accepted answer of: http://stackoverflow.com/q/24976039
score: 0
has comment: http://stackoverflow.com/comment/38825366
has comment: http://stackoverflow.com/comment/38825458
type: AcceptedAnswer
has body: Using jQuery: $('.combobox').change(function(e) { var selectedVal = $(this).val(); $('.table').append('&lt;tr&gt;&lt;td&gt;' + selectedVal + '&lt;/td&gt;&lt;/tr&gt;'); }); I hope you get the idea.
type: Answer

http://stackoverflow.com/q/24982991
has answer: http://stackoverflow.com/a/24983843
has answer: http://stackoverflow.com/a/24983171
accepted answer: http://stackoverflow.com/a/24983843
has comment: http://stackoverflow.com/comment/38838295
score: 1
has answer: http://stackoverflow.com/a/24983101
has comment: http://stackoverflow.com/comment/38838542
upvote count: 2
answer count: 3
has comment: http://stackoverflow.com/comment/38838366
downvote count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38838273
has comment: http://stackoverflow.com/comment/38838258
favorite count: 0
has comment: http://stackoverflow.com/comment/38838195
has comment: http://stackoverflow.com/comment/38838200
has comment: http://stackoverflow.com/comment/38838389
tagged with: php
possible better answer: http://stackoverflow.com/a/24983101
type: AnsweredQuestion
has body: so I have this javascript function on my page which computes date. Now, I want to access the result thrown by the function in a php variable so that I can use that variable to insert value in a database. The function should be called on page load. I have been trying to get this done from past 4 hours but upto no solution, any suggestions and solutions are welcome. My JS Code:- &lt;script language="JavaScript"&gt; // function to calculate local time // in a different city // given the city's UTC offset function calcTime(city, offset,selDate,selHours,selMinutes) { //alert(selDate); //alert(selHours); //alert(selMinutes); //alert(offset); var str = selDate; var res = str.split("/"); //07,26/2014 //0,1,2 var d = new Date(res[2], res[0], res[1], selHours, selMinutes, 0, 0); // create Date object for current location //alert(d); // var d = new Date(); //alert(d); // convert to msec // add local time zone offset // get UTC time in msec utc = d.getTime() + (d.getTimezoneOffset() * 60000); // create new Date object for different city // using supplied offset nd = new Date(utc + (3600000*offset)); // return time as a string return nd.toLocaleString(); } function testTime(){ var selDate = document.getElementById("datepicker").value; var selHours = document.getElementById("hours").value; var selMinutes = document.getElementById("minutes").value; var selTimeZone = document.getElementById("timezone").value; alert(selDate); alert(selHours); alert(selMinutes); alert(selTimeZone); } &lt;/script&gt;
has title: Get value from a javascript function in a php variable
type: Question

http://stackoverflow.com/comment/38841411
has text: Thx. I'm slowly getting it. let's say I have two divs having same class both of which can be dragged around. Finally they both will have a particular value of left or right or both. How can I save those values automaically and when the page reloads the two div get to the same position where they were left before.
comment on: http://stackoverflow.com/a/24984540
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25039243
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38947773
type: Question
has answer: http://stackoverflow.com/a/25046206
has comment: http://stackoverflow.com/comment/38944053
has comment: http://stackoverflow.com/comment/38945922
downvote count: 0
answer count: 1
tagged with: javascript
has body: This is my test set-up. I'm adding two elements to the $document, and want them to be available to my directive for testing beforeEach(inject(function ($compile, $rootScope, $document) { var scope = $rootScope.$new(); var element = $compile('&lt;div id="inputId"&gt;&lt;/div&gt;')(scope); var myDirective = $compile('&lt;div my-directive my-directive-attr="inputId"&gt;&lt;/div&gt;')(scope) angular.element($document[0].body).append(element); angular.element($document[0].body).append(myDirective); scope.$digest(); }); This is part of my directive below. I'm trying to reference the element on the $document based on the ID passed to the directive attribute. angular.module('myModule',[]) .directive('myDirective', function ($document) { return { restrict: 'A', link: function (scope, el, attrs) { var inputId = attrs.myDirectiveAttr; var fromDocument = $document[0].getElementById(inputId); console.log(fromDocument); }; }); The console log is picking up null in the directive. Is the only way to have elements within the $document to mock the entire $document service?
has comment: http://stackoverflow.com/comment/38957697
favorite count: 0
has comment: http://stackoverflow.com/comment/38944911
has comment: http://stackoverflow.com/comment/38944602
has title: Setting up angular unit test on directive that links to external DOM element
accepted answer: http://stackoverflow.com/a/25046206
has comment: http://stackoverflow.com/comment/38947120
tagged with: angularjs
upvote count: 2
has comment: http://stackoverflow.com/comment/38946990
tagged with: unit-testing

http://stackoverflow.com/q/24938894
has body: The goal is simple when a username gets too long on an account drop down menu how to make the search field reduce in width to make room for the longer name; the same is true when the name is short, how to make the form field fill up the empty space when a name is shorter. I've started a pen here: http://codepen.io/MARS/pen/qtJsr I'll be working on it throughout the day so there's no JS there now, but really i'm looking for ideas more than someone telling me exactly how to do it. In pseudo code i'm guessing it would be something like this: var username = $('#usernameID").length(); var search = $('#searchFieldId'); if(username &gt; 34) { make search bar this width (can be fixed because we have a cap of 34 characters so it will never get bigger than that) } if(username &lt; 34){ make search field as wide as need be to be next to the elements without there being significant space } Here are some screenshots: I'm almost thinking a while statement might be best but i'm new to javascript and my thinking is slow when putting the dots together. There are icon placeholders that are to the right of the form field and to the left of the username, this is not so much part of the problem as it is something i need to account for. Can anyone provide any suggestions? Thanks. SOLUTION CODE THAT WORKED: var userWidth = $('#userOptions'); var searchField = $('#txtFamilySearch'); var icons = $('.icons'); $('#txtFamilySearch').css("width", 740 - (userWidth.width() + icons.width()));
has comment: http://stackoverflow.com/comment/38757345
has comment: http://stackoverflow.com/comment/38756423
answer count: 4
has answer: http://stackoverflow.com/a/24939417
accepted answer: http://stackoverflow.com/a/24939276
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38757709
has title: How to think of a script that auto widens a search field when a username next to it gets too long
possible better answer: http://stackoverflow.com/a/24939411
type: Question
has answer: http://stackoverflow.com/a/24939411
has comment: http://stackoverflow.com/comment/38786635
has comment: http://stackoverflow.com/comment/38790946
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24939276
score: 0
has answer: http://stackoverflow.com/a/24939705

http://stackoverflow.com/a/24999130
score: 0
type: AcceptedAnswer
type: Answer
has body: I solved the problem handling the keyboard from outside the validate function $('.num-pad').keyboard({ layout: 'num', validate: function(keyboard, value, isClosing) { var data = $(keyboard['el']).attr('id').split('_'); var var_index = data[data.length - 1]; var var_name = data[0]; for (var i = 1; i &lt; data.length - 1; i++) { var_name += '_'; var_name += data[i]; } socket.emit('debugVar', { var_value: value, var_name: var_name , var_index: var_index }); kb = keyboard; } }); Then ... socket.on('debugReturn', function(msg) { if (msg == 1) { $('.ui-keyboard input').css('box-shadow', 'inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)'); kb.options.validate = true; kb.accept(); kb.options.validate: function(keyboard, value, isClosing) { var data = $(keyboard['el']).attr('id').split('_'); var var_index = data[data.length - 1]; var var_name = data[0]; for (var i = 1; i &lt; data.length - 1; i++) { var_name += '_'; var_name += data[i]; } socket.emit('debugVar', { var_value: value, var_name: var_name , var_index: var_index }); kb = keyboard;; } else { $('.ui-keyboard input').css('box-shadow', 'inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(255,0,0,.6)'); } });
accepted answer of: http://stackoverflow.com/q/24972729
answers question: http://stackoverflow.com/q/24972729

http://stackoverflow.com/q/25057053
has body: I have a system where the users can manipulate the images. It is very similar to this: http://jsfiddle.net/Thaikhan/fGJ59/9/show/ My goal is to grab user and positional data (i.e., userid, frame_ID, imageid, width, height, top, left, and z-index) and store it in a database. A new row would have to be inserted into the database for every image in the manipulation frame. I eventually want users to be able to save/edit the images that they have arranged. So far, I've been able to generate a merged array with all the data using: function getCSS() { var id_data = $(".frame div img").map(function() { return $(this).attr("id"); }).get(); var width_data = $(".frame div img").map(function() { return $(this).css("width"); }).get(); var height_data = $(".frame div img").map(function() { return $(this).css("height"); }).get(); var top_data = $(".frame div:has(img)").map(function() { return $(this).css("top"); }).get(); var left_data = $(".frame div:has(img)").map(function() { return $(this).css("left"); }).get(); var zindex_data = $(".frame div:has(img)").map(function() { return $(this).css("z-index"); }).get(); var images_array = []; $.each(id_data, function (index, value) { images_array.push(value); images_array.push(width_data[index]); images_array.push(height_data[index]); images_array.push(top_data[index]); images_array.push(left_data[index]); images_array.push(zindex_data[index]); }); document.getElementById("demo").innerHTML = images_array; ////////////Post Data $.post( "/save.php", images_array, function( data ){ alert("Saved! Received response: " + data); } ); } Post Data currently doesn't seem to do anything. The array outputs: 100,101px,101px,22px,126px,9998,103,96px,96px,152px,30px,9997,104,60px,60px,auto,auto,9996 It outputs values of image_id, width, height, top, left, zindex. They repeat without a colon. I don't know if that will make it significantly harder. Note that the default position is not numeric. Trying to use the suggestion of @Marcin Koziarz, save.php …
score: 1
tagged with: mysql
has comment: http://stackoverflow.com/comment/38977666
tagged with: arrays
downvote count: 0
answer count: 1
tagged with: javascript
favorite count: 0
has title: Store CSS data into a MySQL database
has comment: http://stackoverflow.com/comment/38977665
tagged with: css
type: UnansweredQuestion
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/25057429
type: Question

http://stackoverflow.com/comment/38948377
has text: I'm not sure if what you want is copy the checkboxes from one form to another? In that case do it: $("input[name='record_update[]']:checked").each(function(){ $(this).clone().appendTo('#idOfOtherForm'); }); let me know
score: 0
comment on: http://stackoverflow.com/q/25040756
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/39002457
type: AnswerComment
has text: I dont see that it works. I checked in two Regex's testers and nothing works.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25069552

http://stackoverflow.com/comment/38718811
score: 0
type: Comment
has text: `values.forEach` is native Javascript. No need for underscore or jQuery here.
comment on: http://stackoverflow.com/a/24919174
type: AnswerComment

http://stackoverflow.com/comment/38980239
has text: I think this is exactly what is causing problem to OP. You are splitting in "," in say c(d(),e()) as well. What I can understand from OP s question is, OP wants that c(d(),e()) as a different part
type: Comment
comment on: http://stackoverflow.com/a/25058431
type: AnswerComment
score: 4

http://stackoverflow.com/q/24936457
has body: In JavaScript, the addEventListener() method is used like this: object.addEventListener("click", myScript); In Scala.js: I have a canvas, and I want to listen to clicks only on the canvas, not the entire document. In the Scala.js.dom library, addEventListener is defined as: def addEventListener(`type`: String, listener: js.Function1[Event, _], useCapture: Boolean = ???): Unit = ??? I'm not sure what "useCapture" refers to. But I tried: dom.document.getElementById("canvas").addEventListener("click", { (e:dom.MouseEvent) =&gt; { /*do something*/ } }, false) And the error message I got: found : org.scalajs.dom.MouseEvent =&gt; Unit required: scala.scalajs.js.Function1[org.scalajs.dom.Event, _] Can someone explain what "useCapture" refers to, and how to correctly use addEventListener in Scala.js?
favorite count: 0
has comment: http://stackoverflow.com/comment/74567443
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/7398290
has title: Scala.js: Using addEventListener to add events to objects
downvote count: 0
score: 7
possible better answer: http://stackoverflow.com/a/24936595
has answer: http://stackoverflow.com/a/24936595
has answer: http://stackoverflow.com/a/24939516
type: Question
accepted answer: http://stackoverflow.com/a/24939516
tagged with: addeventlistener
tagged with: javascript
answer count: 2
tagged with: scala.js
upvote count: 7

http://stackoverflow.com/comment/38970668
score: 0
comment on: http://stackoverflow.com/q/25053230
type: Comment
has text: specify what output you want on an input with example.
type: QuestionComment

http://stackoverflow.com/a/25067700
has comment: http://stackoverflow.com/comment/39020474
score: 0
has comment: http://stackoverflow.com/comment/39008406
type: Answer
has body: I think that what is not working is the code inside changeMessage function, because Firefox doesn't understand element.innerText, and you have to change to element.textContent
answers question: http://stackoverflow.com/q/25067266

http://stackoverflow.com/q/25029546
type: UnansweredQuestion
downvote count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38926065
type: Question
has comment: http://stackoverflow.com/comment/38926126
has body: I am curious why it doesnt alert 5 when i click the button. anyone know why? http://jsfiddle.net/bm8dd/ Button
has title: Alert not working on button click
score: -1
has answer: http://stackoverflow.com/a/25029703
has comment: http://stackoverflow.com/comment/38926060
has answer: http://stackoverflow.com/a/25029568
tagged with: javascript
linked to: http://stackoverflow.com/q/1661197
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 4
has answer: http://stackoverflow.com/a/25029563
has answer: http://stackoverflow.com/a/25029585

http://stackoverflow.com/q/25002343
type: Question
has title: Questions about views in famo.us
has answer: http://stackoverflow.com/a/25058765
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has body: Im just starting with famo.us and javascript. And i really need some help with the views in famo.us. Could you please tell me how you close a View ? How does your code look like ? Is it true that if I have a view in a view in a view, I have to pass the events from view to view ? Im sorry for my english.
tagged with: famo.us

http://stackoverflow.com/q/25009915
has answer: http://stackoverflow.com/a/25010100
has comment: http://stackoverflow.com/comment/38888940
accepted answer: http://stackoverflow.com/a/25009987
type: AnsweredQuestion
tagged with: validation
type: Question
tagged with: regex
has title: Javascript validation on Floating values
has comment: http://stackoverflow.com/comment/38888986
score: 0
has answer: http://stackoverflow.com/a/25009987
has answer: http://stackoverflow.com/a/25010714
has comment: http://stackoverflow.com/comment/38888934
has answer: http://stackoverflow.com/a/25053377
has body: How to do decimal validation using javascript? There is a text box which should accept only 24.00 or 24 or any value less than 24.00. The text box also must allow if 23.99 is entered. I tried it this way: if (document.forms[0].hours!= undefined) { var val = document.forms[0].hours.value; if (val .match(/^\d{0,6}(?:\.\d{0,2})?$/)) { alert("Invalid" +'${payType}'+" Hours. The hours entered can not have more than 2 decimal places or should be in the range of 0 to 24 "); submitted=false; return false; } } The values can be: 1.00 or 12.25 or 1.25 or 23.99 or 24 but not above these values. Any number below 24.00 or 24.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25010100
answer count: 4

http://stackoverflow.com/q/24976062
answer count: 2
tagged with: javascript
tagged with: firefox-addon
has answer: http://stackoverflow.com/a/24986564
accepted answer: http://stackoverflow.com/a/24986564
has body: It's possible to made popup like this? Not contents in it. The style and position of popuping is interesting for me. Under toolbutton, with arrow up to center of button. The panel widget didn't do the same, it just popup in center of window. How I can do this popup with Add-on SDK?
has answer: http://stackoverflow.com/a/24983026
tagged with: firefox-addon-sdk
favorite count: 0
downvote count: 0
possible better answer: http://stackoverflow.com/a/24983026
tagged with: css
has comment: http://stackoverflow.com/comment/38825892
has title: Addon SDK. How I can make popup like this?
score: 2
type: AnsweredQuestion
tagged with: popup
type: Question
upvote count: 2

http://stackoverflow.com/comment/38956916
has text: @pbrianq Strings are concatenated with `+` (if either expression is a string). Use `parseInt/parseFloat` or the unary `+`.
comment on: http://stackoverflow.com/a/25045717
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24969714
answers question: http://stackoverflow.com/q/24969673
downvote count: 0
type: Answer
has body: You can't append in img element because it is self closing tag instead append it to a element. $("ul.footer-8-flickr li a").append(" Content ");
score: 2
upvote count: 2

http://stackoverflow.com/comment/38996618
comment on: http://stackoverflow.com/q/25066688
has text: I guess I misread your post - anyway, do you get any exception/error in the browser console? What browser are you using? (IE, FF, Chrome, etc)
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24915151
type: Answer
has comment: http://stackoverflow.com/comment/38710848
score: 1
has comment: http://stackoverflow.com/comment/38710871
answers question: http://stackoverflow.com/q/24915044
accepted answer of: http://stackoverflow.com/q/24915044
upvote count: 2
type: AcceptedAnswer
downvote count: 1
has body: IDs are unique. All you need is this: $("#CB_Selected").prop('checked', true); Actually, you don't even need jQuery: document.getElementByID('CB_Selected').checked = true; As others have pointed out, it would be preferred to use a class rather than an ID if there are multiple checkboxes. In addition, an input cannot have children, so the closest function won't work; did you mean find (for children) or siblings?

http://stackoverflow.com/comment/38754314
score: 1
type: QuestionComment
comment on: http://stackoverflow.com/q/24938087
has text: @SimonMathewson Try what Karl-Andre said, or wrap it in a self-executing function, passing jQuery as an argument. `(function($) { /* Code here */ }(jQuery))`
type: Comment

http://stackoverflow.com/comment/38721828
score: 1
type: Comment
comment on: http://stackoverflow.com/a/24920769
type: AnswerComment
has text: Actually, in this case it's Google using `X-Frame-Options: SAMEORIGIN`, so loading a different page inside the frame works. But the principle's the same.

http://stackoverflow.com/comment/38985304
type: AnswerComment
comment on: http://stackoverflow.com/a/25059364
score: 2
has text: Your sourceforge link is to different project with similar name, that works on IE11 (original TrixIE doesn't)
type: Comment

http://stackoverflow.com/a/24923730
answers question: http://stackoverflow.com/q/24923667
has comment: http://stackoverflow.com/comment/38727153
downvote count: 0
upvote count: 2
type: Answer
has body: I would suggest an entirely different approach; one that is more idiomatic to JavaScript: JSON. { "siteConstants" : { "training" : { "staff" : { "fetch" : "someurl" } } } } Then, if you have this object attached to var constantsObject, you can access the constants as such: constantsObject.siteConstants.training.staff.fetch; // returns "someurl" constantsObject["siteConstants"]["training"]["staff"]["fetch"] // returns "someurl"
score: 2
has comment: http://stackoverflow.com/comment/38727175
has comment: http://stackoverflow.com/comment/38727136
has comment: http://stackoverflow.com/comment/38727122

http://stackoverflow.com/a/24942920
upvote count: 1
has comment: http://stackoverflow.com/comment/38765741
has body: Right now there is no way to add your own cookies to Worklight requests. Like your edit says, any Cookie header added using addGlobalHeader() gets replaced with only the cookies WL adds. A feature request has been opened to see if this functionality could be added in future versions.
has comment: http://stackoverflow.com/comment/38765567
answers question: http://stackoverflow.com/q/24942101
downvote count: 0
has comment: http://stackoverflow.com/comment/38764946
has comment: http://stackoverflow.com/comment/38764267
has comment: http://stackoverflow.com/comment/38764579
type: Answer
score: 1

http://stackoverflow.com/a/25021943
type: Answer
downvote count: 0
score: 1
has body: Try this on for size. To me this really has nothing to do with Angular (function(array1, array2) { var tlc = function(a) { return a.toLowerCase(); }; array2 = array2.map(tlc); array1 = array1.map(tlc); return array1.filter(function(n) { return array2.indexOf(n) != -1; }).length &gt; 0; })(array1, array2);
answers question: http://stackoverflow.com/q/25021396
upvote count: 1

http://stackoverflow.com/q/24978426
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/38830486
tagged with: internet-explorer
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38831321
linked to: http://stackoverflow.com/q/10149963
type: UnansweredQuestion
has title: function addevent not working for IE 8 and less
has comment: http://stackoverflow.com/comment/38831284
linked to: http://stackoverflow.com/q/6348494
has comment: http://stackoverflow.com/comment/38830140
has body: I am using function addEvent(element,myEvent,fnc) {return((element.attachEvent)?element.attachEvent('on'+myEvent,fnc):element.addEventListener(myEvent,fnc,false));} as detailed at addEventListener vs onclick . Now to attach a click event to the window element I am using addEvent(window,'click',myfunc); where myfunc is a callback function. The problem is that IE 8 is not attaching the click event using this function how can I modify this function for IE 8 ? Thanks
has comment: http://stackoverflow.com/comment/38829924

http://stackoverflow.com/a/25051902
upvote count: 5
answers question: http://stackoverflow.com/q/25051759
accepted answer of: http://stackoverflow.com/q/25051759
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38968180
downvote count: 2
type: Answer
score: 3
has body: Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at the url. This can be fixed by moving the resource to the same domain or enabling CORS. It means you should have api (url in your code) and the file which has your script must be in same domain Or Add the Access-Control-Allow-Origin header in the API(url in your code) domain &lt;FilesMatch "\.(php)$"&gt; &lt;IfModule mod_headers.c&gt; Header set Access-Control-Allow-Origin "*" &lt;/IfModule&gt; &lt;/FilesMatch&gt; * to allow all cross domainrequests
has comment: http://stackoverflow.com/comment/131294055

http://stackoverflow.com/comment/38949941
has text: Table rows don't have children or parent rows, rows are all siblings of each other. The parent of the row is the table. Use .prev() or .next instead of .parent()
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25042094
score: 1

http://stackoverflow.com/comment/38783346
has text: Can you put your html?
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24953457
type: Comment

http://stackoverflow.com/comment/38937119
comment on: http://stackoverflow.com/a/25035131
type: AnswerComment
has text: did you add these code ? .Selectable(selectable => selectable .Mode(GridSelectionMode.Multiple) .Type(GridSelectionType.Cell))
type: Comment
score: 0

http://stackoverflow.com/comment/38771922
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24947331
type: QuestionComment
has text: @epascarello exactly what I've been looking for, can you please post an answer I'll accept. I was trying self, victim of multiple languages I guess. Thank you, sorry about sloppy question statement

http://stackoverflow.com/q/24975388
tagged with: javascript
favorite count: 0
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38827142
upvote count: 1
has comment: http://stackoverflow.com/comment/38833547
has comment: http://stackoverflow.com/comment/38827599
has comment: http://stackoverflow.com/comment/38976371
has body: The issue I'm seeing is regarding the execution of the if-statement in the last if-statement in the code that I've listed below (if (this._sortDirection === 'desc') ...). If I run this code in Chrome (36.0.1985.125), things function as they should, but when run in Firefox (v31.0 on Mac OSX 10.9.4) the if-statement evaluates the condition incorrectly and always evaluates as if the condition was true. I've verified that this is not happening in Chrome and that it is indeed isolated to Firefox. As part of my debugging, I replaced @reverse() if @_sortDirection == 'desc' with the following in the CoffeeScript code: `if (this._sortDirection === 'desc') { this.reverse(); }` Which generates the following JavaScript: if (this._sortDirection === 'desc') { this.reverse(); }; After doing this, everything worked! I'm wondering if perhaps there is an encoding issue that Firefox isn't handling well and Chrome is because this code (except for the trailing ; after the if-statement) is identical but one works and the other does not. I even placed both the inline code and the coffeescript code in the CoffeeScript file at the same time and verified that one is evaluated correctly while the other is not. I obviously have a work around for this, but I want to know if this is an issue with CoffeeScript or with Firefox or with my code and if it is an issue with my code...how do I fix it? Obviously, I have a mountain of if-statements in my code and using this workaround is not a feasible solution, I would love to report it to be fixed if I can. I've already checked the CoffeeScript project issues and couldn't find anything there that resembled this issue. Thanks for the help. Here is my CoffeeScript code (for a full example see my JSFiddle): sortObjects: -&gt; return unless @_sortOn? @sort (obj1, obj2) =&gt; return 1 if obj1[@_sortOn] &gt; obj2[@_sortOn] return -1 if obj1[@_sortOn] &lt; obj2[@_sortOn] return 0 @reverse() if @_sortDirection == 'desc' # This is the line that is causing proble…
tagged with: if-statement
score: 1
tagged with: coffeescript
has comment: http://stackoverflow.com/comment/38962202
type: Question
has title: If-statement generated by CoffeeScript always evaluates TRUE in Firefox
tagged with: firefox
downvote count: 0

http://stackoverflow.com/comment/77900456
has text: I was not aware of this method existing at all at the time of posting my solution. Very nice solution indeed. It's also nice that this directly provides internationalisation. Also, it's nice to learn something new :P
type: AnswerComment
score: 4
type: Comment
comment on: http://stackoverflow.com/a/45464959

http://stackoverflow.com/comment/38978366
comment on: http://stackoverflow.com/a/25056828
type: Comment
has text: How async.series ensures no more than the "modulo limit" of documents are in process at any time? What I see here is that objects gets queued up and written to db in 1000's. And if the next 1000 objects gets ready before the previous bulk.execute() completes, it will fire another bulk.execute(). Am I missing something here?
score: 0
type: AnswerComment

http://stackoverflow.com/a/24944902
has comment: http://stackoverflow.com/comment/38767236
has body: Your code should work if you change your overlay from: panes.overlayLayer.appendChild(div); to: panes.overlayMouseTarget.appendChild(div); From the docs: overlayMouseTarget contains elements that receive DOM mouse events, such as the transparent targets for markers. It is above the floatShadow, so that markers in the shadow of the info window can be clickable. Working js fiddle example (Updated to contain styles of your overlay). Cheers.
accepted answer of: http://stackoverflow.com/q/24944412
answers question: http://stackoverflow.com/q/24944412
score: 3
downvote count: 0
type: AcceptedAnswer
upvote count: 3
type: Answer

http://stackoverflow.com/q/24966742
tagged with: variables
favorite count: 0
has comment: http://stackoverflow.com/comment/38807904
has comment: http://stackoverflow.com/comment/38808360
answer count: 5
has answer: http://stackoverflow.com/a/24966947
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24966838
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38807856
tagged with: dynamic
possible better answer: http://stackoverflow.com/a/24966890
upvote count: 3
type: Question
score: 3
has body: I keep hearing about how I should use arrays and objects to accomplish having dynamic variable names. I'm not sure how to get this to work with my current project. I need dynamic variable names for html boxes, and dynamic names for scores entered. How do I accomplish this with my current code? Below is the Javascript prompt for each of the 5 separate scores for each player. var hole1 = prompt("Enter Hole 1 score:"); var hole2 = prompt("Enter Hole 2 score:"); var hole3 = prompt("Enter Hole 3 score:"); var hole4 = prompt("Enter Hole 4 score:"); var hole5 = prompt("Enter Hole 5 score:"); Below here is declaring a variable to store all of the 6 boxes that will hold the scores, and the score total. var makeScoreBoxes ='&lt;input type ="text" placeholder="Hole 1" id="hole1" /&gt; &lt;input type ="text" placeholder="Hole 2" id="hole2" /&gt; &lt;input type ="text" placeholder="Hole 3" id="hole3" /&gt; &lt;input type ="text" placeholder="Hole 4" id="hole4" /&gt; &lt;input type ="text" placeholder="Hole 5" id="hole5" /&gt; &lt;input type ="text" placeholder="Total Score" id="totalScore" /&gt;' newdiv.innerHTML = makeScoreBoxes; ni.appendChild(newdiv); It then adds them all up here and stores the total inside of the totalScore variable: totalScore = parseInt(parseFloat(hole1) + parseFloat(hole2) + parseFloat(hole3) + parseFloat(hole4) + parseFloat(hole5)); It then takes hole1, hole2, hole3, hole4, and hole5, and the sum of them all, and puts them all in my index.html input boxes like this: addTotal = document.getElementById('totalScore').value=totalScore; addhole1 = document.getElementById('hole1').value=hole1; addhole2 = document.getElementById('hole2').value=hole2; addhole3 = document.getElementById('hole3').value=hole3; addhole4 = document.getElementById('hole4').value=hole4; addhole5 = document.getElementById('hole5').value=hole5; hole1, hole2, hole3, hole4, hole5, all are fashioned to prompt the user, asking what their score was. And then puts them all in html input boxes…
has title: Dynamic Variable names Javascript
has answer: http://stackoverflow.com/a/61027475
tagged with: javascript
has answer: http://stackoverflow.com/a/24966890
downvote count: 0
has answer: http://stackoverflow.com/a/26765945
accepted answer: http://stackoverflow.com/a/24966838

http://stackoverflow.com/a/24990459
has body: Finally it works for me in chrome. Here is my code var newWin = window.open("","",'width=0,height=0'); $.ajax({ type: "POST", async: true, url: '/BarcodePrintTest/PrintBarcodeLabel1', data: JSON.stringify(dataToSend), contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data != "") { debugger if (navigator.userAgent.toLowerCase().indexOf('chrome') &gt; -1) { // Chrome Browser Detected? newWin.PPClose = false; // Clear Close Flag newWin.onbeforeunload = function () { // Before Window Close Event if (newWin.PPClose === false) { // Close not OK? return 'Leaving this page will block the parent window!\nPlease select "Stay on this Page option" and use the\nCancel button instead to close the Print Preview Window.\n'; } } newWin.document.write('&lt;/head&gt;&lt;body &gt;'); newWin.document.write(JSON.stringify(data.replace(/\r\n/g, "&lt;br/&gt;"))); newWin.document.write('&lt;/body&gt;&lt;/html&gt;'); newWin.document.close(); // newWin.resizeTo(0, 0); //newWin.moveTo(0, window.screen.availHeight + 10); // newWin.focus(); newWin.print(); // Print preview newWin.close(); newWin.PPClose = true; // Set Close Flag to OK. }
score: 0
accepted answer of: http://stackoverflow.com/q/24990017
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24990017
type: Answer

http://stackoverflow.com/q/24923751
type: AnsweredQuestion
tagged with: switch-statement
has answer: http://stackoverflow.com/a/24924334
type: Question
tagged with: for-loop
score: 2
downvote count: 0
tagged with: javascript
favorite count: 0
has body: I'm relatively new to coding and working on a text based RPG game in JavaScript. The following code allows me to progress through the different scenarios where you are approached with a different bad guy. I used a For loop in conjunction with a Switch statement and had it working prior, but then I re factored my code to make it more OO &amp; prototypal. Now my For loop continues looping and does not exit. I checked the value of [i] throughout and see it properly goes 0-4, but then it restarts at 0 and I can't figure out why? var scenario = new Array(); //simple function to create the number of scenarios function Scenario () { howManyScenarios = function(number) { for (i=0; i &lt;= number; i++) { scenario[i] = ("Scenario " + (1 + i)); }; }; howManyScenarios(4); //if you change the argument, add additional switch cases //iterating through my howManyScenarios function to build out scenarios using a switch case createScenarios = function () { var ii = scenario.length; for (i=0; i &lt; ii; i++) { switch(scenario[i]) { case 'Scenario 1': alert("You run into a troll"); b = 0; break; case 'Scenario 2': alert("You find a store to purchase goods from"); ItemShop(); break; case 'Scenario 3': alert("You run into a ogre"); b = 1; break; case 'Scenario 4': alert("You run into a warewolf"); b = 2; break; case 'Scenario 5': alert("You run into a wizard"); b = 3; return; break; }; //close out switch cases }; //close out my for loop }; //close out createScenarios function createScenarios(); }; //close out Scenario function Scenario();
has comment: http://stackoverflow.com/comment/38727237
answer count: 1
accepted answer: http://stackoverflow.com/a/24924334
has title: JavaScript - For loop with switch statement continually looping
upvote count: 2
has comment: http://stackoverflow.com/comment/38727211
has comment: http://stackoverflow.com/comment/38742300

hash
tags question: http://stackoverflow.com/q/24941475
type: Tag
tags question: http://stackoverflow.com/q/25005275
tags question: http://stackoverflow.com/q/25010011
tag name: hash

http://stackoverflow.com/comment/38728919
has text: can you come to chat?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24924251

http://stackoverflow.com/comment/38980804
score: 0
has text: @Brian World and Hello are strings, not variables
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25058453

http://stackoverflow.com/comment/38920002
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25026115
score: 1
has text: Then you need to talk to whoever is providing this file and ask them either make it valid JSON(fits your situation best, imo) or do as James mentions and export it as a module.

http://stackoverflow.com/a/24921185
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24920061
has body: The code for the tabs works without fail. The problem is actually in your platform.js script. After checking the console output for the page via Firebug, the script breaks inside that script. You can see here: http://jsfiddle.net/Au7EJ/3/ that your tabs.js script runs as you would expect. Only made one change to your code because there is no need to initialize 'content' with a value, so I changed it in the fiddle. $(document).ready(function () { var content; // just a declaration is enough here $('#tabs .tab-list li').each(function () { $(this).on('click', function () { // buttons $(this).addClass('active').siblings().removeClass('active'); // content if (content !== undefined) { content.hide(); } var currentAttrValue = $("a", this).attr('href'); content = $(currentAttrValue); content.show(); }); }); }); Hope this sheds some light on your problem!
accepted answer of: http://stackoverflow.com/q/24920061
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38729392
downvote count: 0

http://stackoverflow.com/a/24923483
answers question: http://stackoverflow.com/q/24923366
score: 4
downvote count: 0
has body: as suggested by Sterling in the comment section, it's not good practice to use onclick but if you really need to do this, place the function in the global namespace window.log = (message) -&gt; console.log(message) in cases like this, it's better to create a namespace for the app and add functions there. @MyNamespace = {} class MyNamespace.CommonFunctions @log = (message) -&gt; console.log(message) Then in your view &lt;span onclick='MyNamespace.CommonFunctions.log("abc")'&gt; This keeps things organized and you don't clog the global namespace. LISTENER APPROACH A better way to do this is to use event listeners (using jquery). # view &lt;span class='msg'&gt;&lt;/span&gt; # js log = (message) -&gt; console.log(message) $('.msg').on 'click', -&gt; log('abc')
type: Answer
upvote count: 4
accepted answer of: http://stackoverflow.com/q/24923366
type: AcceptedAnswer

http://stackoverflow.com/comment/38842732
score: 1
has text: The parent vs closest statement here is incorrect. The benchmark links to a benchmark of .parents() vs .closest(). .parents() is very different from .parent(). .parent() is a single instruction and fast. .parents() does something else entirely, and is very expensive - it gets ALL the parents up the entire DOM chain, not just the immediate parent: http://api.jquery.com/parents/ `.parent()` is much faster than `.closest()`, which is faster than `.parents()`
type: Comment
comment on: http://stackoverflow.com/a/24983720
type: AnswerComment

http://stackoverflow.com/comment/38856938
score: 1
comment on: http://stackoverflow.com/a/24992926
type: AnswerComment
has text: The names are not unique as the OP says.
type: Comment

http://stackoverflow.com/comment/38731174
comment on: http://stackoverflow.com/q/24925336
has text: Don't make us go looking for your code. Please include it in the body of your question. By all means provide a fiddle in addition but always provide your code in the question. Make it as easy as possible for us to help you.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38861577
type: QuestionComment
comment on: http://stackoverflow.com/q/24963808
score: 0
has text: @Ondkloss, yes. I have to define limits (ie, min: 0, max: 100) and the points that are outside the limits should be shown as data labels inside it.
type: Comment

http://stackoverflow.com/a/25006404
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25006306
upvote count: 3
answers question: http://stackoverflow.com/q/25006306
type: Answer
score: 3
downvote count: 0
has body: Bind it with an event listener instead of inlining it in your html. For example instead of: HTML Test JS var main = function() { /* Do something */ } Use New JS var main = function() { console.log("Here!"); } window.addEventListener("load", main); Then you can remove onload="main()" from your HTML. This is also considered good practice in JavaScript.

http://stackoverflow.com/comment/38916010
type: Comment
score: 1
comment on: http://stackoverflow.com/q/25023365
type: QuestionComment
has text: Tokbox support doesn't respond. The code I'm using is simply their demo 'session.on("signal"' code but I'm not sure where the errors are arising because my code isn't logging any console errors. The only problems I see (as reported above) are in their code.

http://stackoverflow.com/comment/38959531
type: Comment
comment on: http://stackoverflow.com/a/25046309
has text: This isn't really relevant to the question asked, as I'm pretty sure the embedded YouTube player doesn't have jQuery click event registered.
type: AnswerComment
score: 0

http://stackoverflow.com/a/24963405
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/24963043
has comment: http://stackoverflow.com/comment/38802651
has comment: http://stackoverflow.com/comment/38801790
has comment: http://stackoverflow.com/comment/38801967
has comment: http://stackoverflow.com/comment/48970517
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38802014
has body: If you wish to return json from PHP, I believe you need to either specify contentType in the PHP file or in the ajax call: In PHP file, before the echo json_encode(...: header('Content-Type: application/json'); or in the ajax call, specify contentType somewhere before the success property: contentType: 'application/json',
has comment: http://stackoverflow.com/comment/38802128
has comment: http://stackoverflow.com/comment/38802065
has comment: http://stackoverflow.com/comment/38803833
downvote count: 0
answers question: http://stackoverflow.com/q/24963043
type: Answer

http://stackoverflow.com/q/25035454
accepted answer: http://stackoverflow.com/a/25071669
upvote count: 7
tagged with: webrtc
favorite count: 0
has body: I'm using WebRTC to stream video between peers, but changes in network conditions for some clients often produce quality changes in the received video stream. People blame the service for these quality drops and clearly I (the service) cannot do anything about their network conditions. But showing an indication that the quality dropped due to network conditions on the client's end would most likely alleviate this problem. I've been searching Google &amp; Stackoverflow for a while now and haven't seen any questions related to quality detection of incoming audio or video stream. Is there a way to monitor the quality (current bitrate or dropped frames, anything) during the live stream?
type: AnsweredQuestion
downvote count: 0
score: 7
has comment: http://stackoverflow.com/comment/38940152
type: Question
has title: Monitor WebRTC video (media) stream quality in Javascript
tagged with: video-streaming
has answer: http://stackoverflow.com/a/76989854
linked to: http://stackoverflow.com/q/23591225
tagged with: javascript
tagged with: html5-video
possible better answer: http://stackoverflow.com/a/76989854
answer count: 2
has answer: http://stackoverflow.com/a/25071669

http://stackoverflow.com/comment/39140678
comment on: http://stackoverflow.com/a/24980784
has text: i have many items each has a price...for each item i pull the price using the get_field into the variable $price...which i want to display when the corresponding "click here" is clicked.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24985485
has answer: http://stackoverflow.com/a/25568548
accepted answer: http://stackoverflow.com/a/25568548
tagged with: requirejs
upvote count: 1
tagged with: bower
possible better answer: http://stackoverflow.com/a/25557104
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/39891838
type: Question
answer count: 2
tagged with: jquery-ui
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25557104
has body: I am using Jquery UI, Bower, and RequireJS in a project and am having difficulty configuring Jquery UI with Require. Basically Jquery UI is trying to find its dependencies in the root directory, and not where they are located, giving me an error. I understand as of 1.11 Jquery UI supports AMD and the documentation notes that it works with a directory like so: ├── index.html ├── js │ ├── app.js │ ├── jquery-ui │ │ ├── accordion.js │ │ ├── autocomplete.js │ │ ├── button.js │ │ ├── core.js │ │ ├── datepicker.js │ │ ├── dialog.js │ │ └── ... │ ├── jquery.js │ └── require.js However, using Bower, the directory is more like ├── index.html ├── js │ ├── app.js |── bower_componenents │ ├── jquery-ui │ │ ├── accordion.js │ │ ├── autocomplete.js │ │ ├── button.js │ │ ├── core.js │ │ ├── datepicker.js │ │ ├── dialog.js │ ├── jquery │ │ ├── jquery.js │ └── require │ │ ├── require.js How does one configure Require so that Jquery UI can find its dependencies?
has title: Cant find Jquery UI dependencies using Bower, Jquery UI, and RequireJS
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/24946749
tagged with: javascript
has answer: http://stackoverflow.com/a/24946854
score: 0
has comment: http://stackoverflow.com/comment/38770803
answer count: 2
has title: How to show php passed results to ajax without refreshing
has body: I want to do is when a user type an email to the inputbox ajax will pass the value automatically to php. My problem is the result only show if I try to refresh the page html: &lt;input type="text" id="email" name="email" /&gt; script: $(document).ready(function(){ var countTimerEmailName = setInterval( function () { emailName(); }, 500); var data = {}; data.email = $('#email').val(); function emailName(){ $.ajax({ type: "POST", url:"Oppa/view/emailName.php", data: data, cache: false, dataType:"JSON", success: function (result) { $("#imageLink").val(result.user_image); $("#profileImage").attr('src', result.user_image); $("#emailNameResult").html(result.user_lname); $("#emailCodeResult").val(result.user_code); } }); }; });
tagged with: jquery
tagged with: ajax
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has answer: http://stackoverflow.com/a/24946800
type: Question
has comment: http://stackoverflow.com/comment/38770632

http://stackoverflow.com/comment/38899981
comment on: http://stackoverflow.com/a/24988713
score: 0
type: AnswerComment
type: Comment
has text: @Benjamin Meh, nah. Also, your edit would fail if the spec defined the arguments for a future `replaceAll` different from mine.

http://stackoverflow.com/q/24981753
answer count: 0
type: Question
tagged with: performance
has body: If I have a 2d ndarray with side lengths of x1, y1 and some data in it, how do I resize it to sidelengths x2,y2 (where x2 &gt;= x1 &amp;&amp; y2 &gt;= y1) so that the original data stays on the same indices and the operation doesn't always require allocating a new TypedArray and copying the data over and over.
tagged with: javascript
score: 0
has title: Resize ndarrays
has comment: http://stackoverflow.com/comment/38839358
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38839502
tagged with: typed-arrays
has comment: http://stackoverflow.com/comment/38839224

http://stackoverflow.com/q/25041613
tagged with: javascript
tagged with: bootstrap-typeahead
tagged with: angular-ui-bootstrap
accepted answer: http://stackoverflow.com/a/25041875
has body: I'm using the angular-ui typeahead directive to connect to the Google Maps API and retrieve an array of addresses. Normally when I need to limit the amount of results visible I do something like: &lt;input typeahead="eye for eye in array | filter:$viewValue | limitTo:10"&gt; That works perfectly and the results are limited to 10. However, when I try to do the same thing with asynchronous results, it doesn't work. It will give more results than I specified in the limitTo. Am I doing something incorrectly below? Here is a plunker: HTML: &lt;input ng-model="asyncSelected" typeahead="address for address in getLocation($viewValue) | limitTo:1" typeahead-loading="loadingLocations"&gt; JavaScript: $scope.getLocation = function(val) { return $http.get('http://maps.googleapis.com/maps/api/geocode/json', { params: { address: val } }).then(function(res){ var addresses = []; angular.forEach(res.data.results, function(item){ addresses.push(item.formatted_address); }); return addresses; }); }; Currently i'm doing the following to workaround, i'm just curious why a simple limitTo doesn't work. $scope.getLocation = function(val) { return $http.get('http://maps.googleapis.com/maps/api/geocode/json', { params: { address: val } }).then(function(res){ var addresses = []; var resultNumber = res.data.results.length &gt; 5 ? 5 : res.data.results.length; for(var i = 0; i &lt; resultNumber; i++){ var obj = res.data.results[i]; var addr = obj.formatted_address; addresses.push(addr); } return addresses; }); };
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25041875
tagged with: angularjs
tagged with: twitter-bootstrap
type: AnsweredQuestion
has title: Limit typeahead results
score: 1
upvote count: 1
type: Question

http://stackoverflow.com/q/25040420
has title: Can thousands of objects hurt performance
tagged with: node.js
type: UnansweredQuestion
tagged with: oop
has answer: http://stackoverflow.com/a/25041872
type: Question
has body: Case in point is how RoBrowser handles each incoming/outgoing packet. First off, RoBrowser uses classes for each packet, there are thousands of packets and they will be instantiated every time they are received or sent. The packets are defined here. Let us take #L2681 as an example: // 0x204 PACKET.CA.EXE_HASHCHECK = function PACKET_CA_EXE_HASHCHECK() { this.HashValue = ''; this.build = function() { var pkt_len = 2 + 16; var pkt_buf = new BinaryWriter(pkt_len); pkt_buf.writeShort(0x204); pkt_buf.writeBinaryString(this.HashValue, 16); return pkt_buf; }; }; We can find that packet being instantiated here. pkt = new PACKET.CA.EXE_HASHCHECK(); pkt.HashValue = hash; Network.sendPacket(pkt); Though this is a packet that is only sent once, imagine if this was a packet that is sent thousand times like a Walk or Attack packet. I am no expert in programming, oop or javascript but I have read a thing or two. Notes: Unlike RoBrowser which is written for the browser, my server will be written in node.js, purely server side. RoBrowser is client side so it only handles its request from 1 server. While in my case, it'll handle all connected clients. Questions: Is RoBrowser's way of handling packets slow for a server architecture? Is there a huge difference in performance between using classes and not? I'm looking for references on this topic (packet handling). If you know any, please do tell.
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38946521
score: 0

http://stackoverflow.com/a/25068884
answers question: http://stackoverflow.com/q/25067516
score: 0
has body: i think you can return list buttons in json response public function get_topics() { $topic = $this-&gt;input-&gt;post('input_data'); $topics = $this-&gt;firstcoast_model-&gt;get_topics_like($topic); $response = array('buttons' =&gt; $topics); header('Content-Type: application/json'); echo json_encode( $arr ); } so client can parse which button element to be hide. &lt;script type="text/javascript"&gt; $(document).ready(function(){ $('somEL').on('submit', function() { // This event fires when a somEl loaded $.ajax({ url: 'url to getTopics() controller', type : "POST", data: 'input_data=' + $(this).val(), // change this based on your input name dataType: 'json', // Choosing a JSON datatype success: function(data) { for (var btn in data.buttons) { $(btn).hide(); } } }); return false; // prevent page from refreshing }); }); &lt;/script&gt;
type: Answer

http://stackoverflow.com/q/25060552
type: Question
upvote count: 4
has title: How to speed up rendering table of checkboxes in Angular.js
has answer: http://stackoverflow.com/a/25063667
tagged with: javascript
answer count: 1
favorite count: 0
has body: I'm making a series charting tool. For each series, I have 4 categories. I want the user to be able to choose any combination of series and category to plot. To accomplish this, I created a bootstrap modal with a table of checkboxes for each series/category combination using Angular.js. It works, but I find the rendering of the modal too slow when there are too many series: Series Name {{ col }} select all 0"> {{ name }} Plunker demo of what I have: http://plnkr.co/edit/1zmZMpDsGwaKdyL7dFty?p=preview I'm just learning Angular, so I'm not too sure how to speed this up, or if there is a smarter approach than using a big table of checkboxes.
tagged with: angularjs
tagged with: twitter-bootstrap
type: UnansweredQuestion
downvote count: 2
score: 2

http://stackoverflow.com/q/25041685
tagged with: angularjs
has title: AngularJS nested ng-repeat access to Index
has answer: http://stackoverflow.com/a/25041723
possible better answer: http://stackoverflow.com/a/25041748
has answer: http://stackoverflow.com/a/25041748
tagged with: angularjs-ng-repeat
type: AnsweredQuestion
has body: I have nested array so I had to use 3 times ng-repeat Delete So my problem is that I can't get access to 2nd ng-repeat $index , any ideas ?
type: Question
accepted answer: http://stackoverflow.com/a/25041723
tagged with: javascript
score: 0
answer count: 2

http://stackoverflow.com/q/25068872
possible better answer: http://stackoverflow.com/a/25068947
has comment: http://stackoverflow.com/comment/39000599
has body: I am very new to Javascript/JQuery and I am going through the code of a colleague of mine. He has created the very common "FAQ" list on a website where the answer is not immediately displayed, only the question until the user clicks the arrow, it then shows the answer. I am trying to figure out how he got this to work. I understand all the HTML and the CSS (it looks fine), but I can't seem to understand how to get the Jquery to work or where to call the code when the user press the arrow on the question to display the answer. The code he seemed to use is at the bottom. Once again, all the HTML and CSS is linked up so I think it is a matter of simply how to use the code. If anyone can offer any help, that would be appreciated. Thanks! $("#faq").on("click", "div &gt; a", function() { return $(this).next().toggle().closest("li").toggleClass("arrow_up"), !1 })
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/25069228
accepted answer: http://stackoverflow.com/a/25069228
has comment: http://stackoverflow.com/comment/39000527
has comment: http://stackoverflow.com/comment/39000576
score: 0
answer count: 2
has title: JQuery calling the function
has answer: http://stackoverflow.com/a/25068947
tagged with: jquery
linked to: http://stackoverflow.com/q/10284536
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/comment/38710129
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24913277
has text: It **is** `enableEventPropagation: true,` it should be false. Easy to reproduce -> http://jsfiddle.net/JDVWx/ - setting it to false should never inflict on the closebutton.

http://stackoverflow.com/comment/38871226
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25000333
has text: @ArtjomB. [Please stop linking to the “Zalgo” / anti-Cthulhu regex rant](http://meta.stackoverflow.com/q/261561/471272). It doesn’t help anybody. Thank you.
score: 0

http://stackoverflow.com/comment/38888962
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25009508
has text: @WillemD'haeseleer sorry, you're right. I just can't think clearly now. I didn't add the polyfill originally since MDN says Chrome supports `trunc` but it clearly does not. I'll add it and post the new version of the fiddle and perf.

http://stackoverflow.com/comment/38921397
type: QuestionComment
type: Comment
has text: @AbhishekSalian It does work as I've tried your example **exactly the same way**, could you try something like `http://www.yoursite.com/AjaxPost/task`? Also check with Phil's comment above
score: 1
comment on: http://stackoverflow.com/q/25026663

http://stackoverflow.com/q/25041236
has title: Memory layout in Javascript - data-oriented vs object-oriented design
has comment: http://stackoverflow.com/comment/38948351
score: 22
upvote count: 22
answer count: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38948323
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38948541
has answer: http://stackoverflow.com/a/25043242
has comment: http://stackoverflow.com/comment/38948414
tagged with: data-oriented-design
has comment: http://stackoverflow.com/comment/38949652
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38948232
has comment: http://stackoverflow.com/comment/38947901
possible better answer: http://stackoverflow.com/a/25041672
has answer: http://stackoverflow.com/a/25041672
type: Question
tagged with: memory-layout
has body: Coming from a background of C/C++, memory layout of objects with regards to reducing cache misses is something that is crucial especially when working on consoles. Data-oriented design is often favored over object-oriented design, in order to help keep related objects close to each other in memory (especially in performance critical areas). Recently, I've been doing some Javascript development, and I'm wondering what the general consensus is within the Javascript community. With my limited experience in Javascript, I've often been surprised to see completely unexpected results when profiling. The internal memory layout and implementation of Javascript objects/structures varies so greatly from browser to browser, that I wonder if it is worth the effort to attempt to optimize. I created a simple test case (http://jsperf.com/object-vs-data) on jsPerf to compare the performance of the two methods, and while it shows performance gains on Chrome, there is no noticeable speedup on Safari. In Javascript, should I even concern myself with the memory layout of objects? Or is it more of a 'implement it one way and then optimize if needed' type thing? This second option seems kind of wasteful (in terms of development time), especially if there is some good guideline to follow. Thanks~ Supplemental Information: This is basically how I would implement the two approaches in Javascript. The jsPerf test case above is implemented like this. var objectOriented = [ { foo: 1, bar: 2 }, { foo: 3, bar: 4 } ]; var dataOriented = { foos: [1, 3], bars: [2, 4] }; // Object-oriented access: var a = objectOriented[0].bar; // Data-oriented access: var b = dataOriented.bars[0];
tagged with: oop
accepted answer: http://stackoverflow.com/a/25043242
has comment: http://stackoverflow.com/comment/38948071
has comment: http://stackoverflow.com/comment/38948742

http://stackoverflow.com/q/25068739
score: -1
possible better answer: http://stackoverflow.com/a/25068823
answer count: 2
has title: Can I take HTML, loop through it to change elements, and display the results as plain text?
linked to: http://stackoverflow.com/q/1290321
downvote count: 1
tagged with: jquery
favorite count: 0
accepted answer: http://stackoverflow.com/a/25068916
tagged with: regex
has answer: http://stackoverflow.com/a/25068916
type: AnsweredQuestion
upvote count: 0
has body: I'm trying to develop a script that will take user submitted HTML, loop through it to identify matching tags, make adjustments to those matched tags, and then spit out the resulting HTML as plain text that the user can copy. The end goal here is to replace all href's in a submission and replace them with different URL's. So for example, this: Link A Link B Link C Becomes this: Link A Link B Link C My first thought was to take the submitted HTML from the field and put it in a variable. At this point the HTML becomes a string and I was going to loop through it with a regex to find matching tags. My issue was that I needed to find all tags that did NOT include the attribute data-track="false". And as far as I can tell that's impossible with regex since each link isn't going to be on its own line. My second thought was to loop through it using jQuery where I could use something like this: $("a:not([data-tracking='false'])"); But I can't use jQuery like this on a string, right? It needs to be in the DOM. I'm unsure of the best way to go about doing this. Maybe another language would prove helpful, but other than HTML and CSS, javascript and jQuery are the only ones I'm experienced with. Any and all help would be greatly appreciated.
has answer: http://stackoverflow.com/a/25068823
type: Question
tagged with: javascript

http://stackoverflow.com/a/25036849
downvote count: 0
answers question: http://stackoverflow.com/q/25036737
score: 1
has comment: http://stackoverflow.com/comment/38939516
type: AcceptedAnswer
upvote count: 1
has comment: http://stackoverflow.com/comment/38939554
type: Answer
accepted answer of: http://stackoverflow.com/q/25036737
has body: Working Demo : JSFiddle It should be click event not onclick also you have to include jQuery library you can download from here jQuery 1.11.1 Try this : $(document).ready(function () { var SaveButton = $('#button-sm'); SaveButton.hide(); $('#littleButton').click(function (e) { SaveButton.animate({ 'opacity': 'toggle' }); }); }); For more info about click event see jQuery click event

transclusion
type: Tag
tags question: http://stackoverflow.com/q/24923904
tag name: transclusion

http://stackoverflow.com/q/24985557
has answer: http://stackoverflow.com/a/47139964
tagged with: leaflet
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24986464
has title: How to remove L.Routing.line in leaflet with Leaflet Routing Machine?
possible better answer: http://stackoverflow.com/a/47139964
answer count: 2
has body: I am trying to get a function to work that updates a L.Routing.line with Leaflet Routing Machine whenever a user adds or deletes a waypoint. My code to date (slight adaptation from http://www.liedman.net/leaflet-routing-machine/interaction.html): function routeImplement(){ if (routewpts.length &gt;= 2) { router.route(routewpts, function(err, routes) { if (routeline) { map.removeLayer(routeline); }; if (err) { alert(err); } else { routeline = L.Routing.line(routes[0]).addTo(map); }; }); } else{ if (routeline) { map.removeLayer(routeline); }; }; } routewpts is an array of latLngs, routeline is supposed to be the L.Routing.line, router=L.Routing.osrm();, and map is the leaflet map (all globals). The function works fine for creating a line. The issue that I am having is that the map.removeLayer(routeline); doesn't seem to work. There are two issues it seems: one is that L.Routing.line doesn't seem to return anything, so routeline is remaining undefined. Second, if I dispense with the use of a handle, and try to use map.removeLayer directly on L.Routing.line, I get some crazy error about a bad request to OSRM.org. Thanks for any suggestions.
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24986464
type: AnsweredQuestion
score: 2
upvote count: 2
type: Question

http://stackoverflow.com/comment/38741064
type: AnswerComment
has text: And does the fiddle work? If copy-pasting didn't work it's possible there are some things you could learn, but without seeing your code I can't really help. My bet is you included the JavaScript higher in the document than the `span`s you want to modify.
type: Comment
comment on: http://stackoverflow.com/a/24931196
score: 0

http://stackoverflow.com/q/25006533
type: Question
has title: Issue with displaying the correct output. JS radio button selection and addition
has answer: http://stackoverflow.com/a/25006713
tagged with: javascript
has comment: http://stackoverflow.com/comment/38882583
has comment: http://stackoverflow.com/comment/38882612
has body: So I have this code: &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"&gt; &lt;/script&gt; &lt;input type="radio" id="radiobtn1" name="bubbles" onclick="CalculatePrice();"&gt; Less Than 10 Bubbles&lt;br /&gt; &lt;input type="radio" id="radiobtn2" name="bubbles" onclick="CalculatePrice();"&gt; 10 Bubbles&lt;br /&gt; &lt;input type="radio" id="radiobtn3" name="bubbles" onclick="CalculatePrice();"&gt; More than 10 Bubbles&lt;br /&gt; &lt;br /&gt; &lt;input type="radio" id="radiobtn4" name="hours" onclick="CalculatePrice();"&gt; 1 Hour&lt;br /&gt; &lt;input type="radio" id="radiobtn5" name="hours" onclick="CalculatePrice();"&gt; 2 Hours&lt;br /&gt; &lt;input type="radio" id="radiobtn6" name="hours" onclick="CalculatePrice();"&gt; Any Longer&lt;br /&gt; &lt;br /&gt; &lt;input type="checkbox" id="radiobtn7" name="bubbles" onclick="CalculatePrice();"&gt; Inflatable Goals&lt;br /&gt; &lt;input type="checkbox" id="radiobtn8" name="bubbles" onclick="CalculatePrice();"&gt; Icey Cold Bottled Water&lt;br /&gt; &lt;input type="checkbox" id="radiobtn9" name="bubbles" onclick="CalculatePrice();"&gt; Photo and Video Package&lt;br /&gt; &lt;script&gt; function CalculatePrice() { var a, b; var c = 0; var d = 0; var e = 0; var price; if($(radiobtn1).is(':checked')) { a = 0; // alert(a); } else if($(radiobtn2).is(':checked')) { a = 1; //alert(a); } else if($(radiobtn3).is(':checked')) { a = 0; //alert(a); } if($(radiobtn4).is(':checked')) { b = 350; //alert(b); } else if($(radiobtn5).is(':checked')) { b = 450; //alert(b); } else if($ (radiobtn6).is(':checked')) { b = 0; // alert(b); } if($(radiobtn7).is(':checked')) { c = 50; //alert(b); } else if($(radiobtn8).is(':checked')) { d = 20; //alert(b); } else if($ (radiobtn9).is(':checked')) { e = 50; // alert(b); } if(a == 0) { price = 0; document.getElementById('output').innerHTML = "Contact Us For Pricing."; //alert(price); } else if (b == 0) { price = 0; // alert(price); } else { pric…
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38882602
tagged with: jquery
has comment: http://stackoverflow.com/comment/38882519
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38882721
has comment: http://stackoverflow.com/comment/38882595

http://stackoverflow.com/comment/38993053
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25064619
has text: Why are you setting location.href?
score: 0

http://stackoverflow.com/comment/38895713
score: 0
comment on: http://stackoverflow.com/a/24987076
type: AnswerComment
has text: Yes, my first version first tells the window what it should do after a new page is loaded, and then loads a new page. `a.class1[href]` means "select all `` tags with class `class1` that have a `href` attribute". So `class1` is the name of the class, while the dot `.` signifies that you're looking for a class. `randomtab` is a custom name for the newly opened tab, which `window.open` requires as its second argument.
type: Comment

http://stackoverflow.com/comment/38860536
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24994954
has text: Please post the relevant HTML, bud. : )

http://stackoverflow.com/a/25064323
downvote count: 0
has comment: http://stackoverflow.com/comment/38998583
has body: The browser can handle a large number of values in a dropdown list, but a dropdown list isn't meant for such a task. Not to mention the users will have a hard time selecting an appropriate value, even if you sort them alphabetically. You would be much better off using an input text box instead of a dropdown. jQueryUI has some nice autocomplete features that would improve not only the performance of your web application, but also make the user experience much more bearable. I would any day prefer to type out one of the 10,000 options provided to me than search for them in a dropdown using a mouse and select them. Here's an example on jsfiddle with ~8.5k records for a performance test.
answers question: http://stackoverflow.com/q/25047088
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38993911
has comment: http://stackoverflow.com/comment/38996155
has comment: http://stackoverflow.com/comment/38993979
type: Answer

http://stackoverflow.com/q/24942908
type: Question
has body: I'm working on trying to get a simple pie chart directive created with Angular and D3js. I feel like I'm missing something obvious about JavaScript here but I'm missing it. Any help will be greatly appreciated. Plunkr: http://plnkr.co/lFluzdfLOINBzEGVRHwA My ultimate goal is to have one object acting as the model that my controller(s) can reference but for now I'm just getting the data from a JSON file with a factory. My problem is that I can console log all the data and it appears as you would expect. I can also use handlebars in the HTML, i.e. {{company}}, and the entire object will be printed to the screen. However the line: var arcs = svg.selectAll(".slice") .data(pie); consistently throws the following error: "Error: i is undefined n@http://localhost:63342/explorer/vendor/d3/d3.min.js:4:21667 pa.data@http://localhost:63342/explorer/vendor/d3/d3.min.js:3:11196 link@http://localhost:63342/explorer/app/features/pieChart/pieChartDirective.js:34:1 K@http://localhost:63342/explorer/vendor/angular/angular.min.js:54:390 A/<@http://localhost:63342/explorer/vendor/angular/angular.min.js:61:129 r/f.success/<@http://localhost:63342/explorer/vendor/angular/angular.min.js:72:199 ye/e/l.promise.then/J@http://localhost:63342/explorer/vendor/angular/angular.min.js:99:449 ye/e/l.promise.then/J@http://localhost:63342/explorer/vendor/angular/angular.min.js:99:449 ye/g/<.then/<@http://localhost:63342/explorer/vendor/angular/angular.min.js:101:116 Zd/this.$get</k.prototype.$eval@http://localhost:63342/explorer/vendor/angular/angular.min.js:111:342 Zd/this.$get</k.prototype.$digest@http://localhost:63342/explorer/vendor/angular/angular.min.js:108:411 Zd/this.$get</k.prototype.$apply@http://localhost:63342/explorer/vendor/angular/angular.min.js:112:171 h@http://localhost:63342/explorer/vendor/angular/angular.min.js:72:441 w@http://localhost:63342/explorer/vendor/angular/angular.min.js:77:347 we/</z.onreadystatechange@http://localhost:63342/explorer/vendor/angular/angular.min.js:78:420…
has comment: http://stackoverflow.com/comment/38763709
tagged with: javascript
has comment: http://stackoverflow.com/comment/38763670
score: 0
tagged with: angularjs
answer count: 0
tagged with: d3.js
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38763756
has comment: http://stackoverflow.com/comment/38764017
has title: Issues creating pie chart directive

http://stackoverflow.com/a/73829001
answers question: http://stackoverflow.com/q/24964626
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: Maybe the DONT_WAIT flag might help you. This should throw an error when the receiving party can't receive any more messages, because the queue is full: http://api.zeromq.org/4-1:zmq-send ZMQ_DONTWAIT For socket types (DEALER, PUSH) that block when there are no available peers (or all peers have full high-water mark), specifies that the operation should be performed in non-blocking mode. If the message cannot be queued on the socket, the zmq_send() function shall fail with errno set to EAGAIN.

http://stackoverflow.com/a/24969906
downvote count: 0
score: 1
upvote count: 1
has body: I have updated createCommandPopUpTabs() function. Also removed space in Third Level on var tabsHeader_basic = ["XYZ", "ThirdLevel"]; Check the Updated Fiddle function createCommandPopUpTabs() { var header = " dd "; var commmand = 'dd'; var button = ' Save '; $("#commandInfo").html(button); $("#commandInfoheader").html(header); $("#tabbedSet").html(''); for (var i = 0; i < tabsHeader.length; i++) { var headerId = tabsHeader[i] + "_tab" + commmand; var header = " " + tabsHeader[i] + " "; $("#tabbedSet").append(header); var content; if (tabsHeader[i] == "InputParameter") { content = " yes "; $("#tabbedSet").find("#" + headerId).append(content); } else if (tabsHeader[i] == "basic") { for (var j = 0; j < tabsHeader_basic.length; j++) { var headerId1 = tabsHeader_basic[j] + "_tab" + commmand; var header1 = " " + tabsHeader_basic[j] + " "; var content1 = getcontend(tabsHeader_basic[j]); $("#tabbedSet").find("#" + headerId).append(header1); $("#tabbedSet").find("#" + headerId1).append(content1); } } $("#tabbedSet").collapsibleset("refresh"); } }
type: Answer
answers question: http://stackoverflow.com/q/24968011

http://stackoverflow.com/a/25551219
type: Answer
has body: I have since managed to get this to work. I had to create a field in my sql db to hold the images, then create a folder in my root directory. upload all of the images there, and reference these images in my sql table field. Once this was done the images appeared as expected. Hope it helps.
has comment: http://stackoverflow.com/comment/51124100
downvote count: 0
has comment: http://stackoverflow.com/comment/51124786
has comment: http://stackoverflow.com/comment/51137502
score: 1
answers question: http://stackoverflow.com/q/25035117
has comment: http://stackoverflow.com/comment/51136514
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25035117

http://stackoverflow.com/a/25061795
upvote count: 2
has body: I think the only thing that could cause that error is if emptyCell is bigger than the colunaDias array, i.e. if your sheet is smaller than 16 rows (if the value you show here is correct). Add this line right before the first while : Logger.log('emptyCell = '+emptyCell+' and colunaDias.length = '+colunaDias.length); I tested a copy of your script and it runs without error except if I define emptyCell > 1000 on a 1000 rows Sheet.
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25059641
accepted answer of: http://stackoverflow.com/q/25059641
type: Answer
score: 2

http://stackoverflow.com/comment/38867859
comment on: http://stackoverflow.com/q/24998663
has text: Just ran it on WIN7/IE11 and Win8.1/IE11 -- The code JavasScript itself seems to be running properly, but under Win8.1, the animation isn't running. It just does a boring image switch. Odd -- the 'flipInY' of the animate.css demo page *does* work,, however. http://daneden.github.io/animate.css/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38920074
has text: I am using local storage and not a remote server, also the items are gotten from the form input filed, so I am confused how you mean I should add all data into the variable.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25026119

http://stackoverflow.com/q/25014252
favorite count: 0
has body: The question title might be a little confusing, imagine this: In this diagram, I know the postions of points a and b (their x and y values) - the origin though is in the top left corner, so yb for instance is somewhat at 137 and ya 81. Also, I know the degree value of the angle &lt;) a which defines how much the lighter rectangle is rotated (I also know how much the other one is rotated, if that is of use). So, I want to check if point a is left or right of an imaginary line (axis, the pink line) of point b. How would you do that? I know it's simply maths probably but I'm lost. var isleft = function(xb,yb, xa, ya, degree) { if the point at xa, ya is left from the line starting at point xb, yb using d degrees return true; }; I guess I would have to use a simple linear function to do this, but I dont know how to deal with the degrees, calculate the respective coordinates on that line for a given y value, so help is appreciated.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38898589
has comment: http://stackoverflow.com/comment/38898278
tagged with: coordinate-systems
has comment: http://stackoverflow.com/comment/38898453
has comment: http://stackoverflow.com/comment/38898691
upvote count: 1
has title: How to check if coordinates are left or right of coordinates with given degrees in javascript?
downvote count: 1
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38920846
has answer: http://stackoverflow.com/a/25027854
answer count: 1

http://stackoverflow.com/comment/38802954
type: Comment
has text: Why can't you measure this using your browsers dev tools? The main issue here rather than media queries is that your browser won't be able to use a look ahead scanner to prefetch the css files, that may or may not be an issue.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24964020

http://stackoverflow.com/comment/38700326
comment on: http://stackoverflow.com/q/24909628
type: Comment
type: QuestionComment
has text: Tried that, but no avail...
score: 0

http://stackoverflow.com/comment/38714087
score: 1
type: Comment
type: QuestionComment
has text: a jsFiddle maybe or a jsBin so that we can look at it and debug...
comment on: http://stackoverflow.com/q/24916745

http://stackoverflow.com/q/24969777
tagged with: javascript
has answer: http://stackoverflow.com/a/24973943
has comment: http://stackoverflow.com/comment/38813339
type: AnsweredQuestion
score: 1
tagged with: jquery
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: fancybox
has body: I have an image zoom gallery in a lightbox which the zoom only works once a thumbnail is clicked on. The zoom needs to be working straight away. Any suggestions would be appreciated. Fiddle here http://jsfiddle.net/mbV3T/3/ HTML: JS: $(document).ready(function () { $('.fancybox').fancybox(); $(".inline").colorbox({inline:true, width:"50%"}); $("#zoom_03f").elevateZoom({ constrainType:"height", constrainSize:274, zoomType: "lens", containLensZoom: true, gallery:'gallery_01f', cursor: 'pointer', galleryActiveClass: "active" }); $("#zoom_03f").bind("click", function(e) { var ez = $('#zoom_03f').data('elevateZoom'); ez.closeAll(); // NEW: This function force hides the lens, tint and window $.fancybox(ez.getGalleryList()); return false; }); });
tagged with: css
accepted answer: http://stackoverflow.com/a/24973943
upvote count: 2
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38813392
has title: Image zoom only works in lightbox after thumbnail is clicked

http://stackoverflow.com/comment/38851812
has text: @João - what do you mean advice on where to start? I gave you a list of things to do to debug this yourself in my previous comment. You should do all of them and find out what you learn. You will likely find one or more errors in your code.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24984254
score: 0

http://stackoverflow.com/comment/38840189
score: 0
has text: Do you see any errors in the console? What version of jquery UI are you using?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24983939

http://stackoverflow.com/comment/38965786
type: Comment
score: 0
type: QuestionComment
has text: @ManishMulimani : But I want just only `email` rule in that `keyup` case.
comment on: http://stackoverflow.com/q/25027468

http://stackoverflow.com/a/25062555
type: Answer
has body: use pure javascript: this.id or jquery $(this).attr('id'); as $(this) is jquery object. and you are trying to get javascript property id. You need to first convert the object to javascript. $(this)[0].id;
answers question: http://stackoverflow.com/q/25062515
has comment: http://stackoverflow.com/comment/38988209
score: 0
has comment: http://stackoverflow.com/comment/38988196

http://stackoverflow.com/q/24959692
tagged with: angularjs
type: UnansweredQuestion
tagged with: css
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38796271
has answer: http://stackoverflow.com/a/24959872
has comment: http://stackoverflow.com/comment/38794254
linked to: http://stackoverflow.com/q/11491628
tagged with: dom
type: Question
linked to: http://stackoverflow.com/q/4561845
tagged with: javascript
has comment: http://stackoverflow.com/comment/38795093
answer count: 3
has answer: http://stackoverflow.com/a/24959795
upvote count: 1
has title: Detecting attribute changes in DOM elements
tagged with: events
has body: Is there any way to detect when a CSS class is removed from a DOM element? I have a &lt;ul&gt;, and I need to capture when this &lt;ul class="open"&gt; has its open class removed. Any way to do this in Angular or jQuery
has comment: http://stackoverflow.com/comment/38794455
favorite count: 0
duplicate of: http://stackoverflow.com/q/11491628
has answer: http://stackoverflow.com/a/24959944

http://stackoverflow.com/a/25021833
score: 1
type: Answer
answers question: http://stackoverflow.com/q/25021678
has comment: http://stackoverflow.com/comment/38913369
upvote count: 1
has body: Yeah you can do this with a plugin name Foggy.. Check this...It will help you
downvote count: 0

http://stackoverflow.com/a/25040340
accepted answer of: http://stackoverflow.com/q/25040298
answers question: http://stackoverflow.com/q/25040298
score: 2
type: AcceptedAnswer
has body: You need if($('img.someclass').attr('src').indexOf('-large') !== -1){} BTW, you can just select it by: $('img.someclass[src*="-large"]')
downvote count: 0
has comment: http://stackoverflow.com/comment/38946678
type: Answer
upvote count: 2

http://stackoverflow.com/q/25012991
linked to: http://stackoverflow.com/q/7815232
has title: angularjs datetime-local setting now()
has comment: http://stackoverflow.com/comment/38895079
tagged with: javascript
has body: In template: ending time In controller: var now = new Date(); $scope.latest = new Date(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes()); I'd like to have the latestInput set up to display time when user launched the page, it works in the documentation example but not in my code, nor in this plunker: http://plnkr.co/edit/d91CZS88OsmJMt6oyo9p?p=preview what's wrong with this? Note: I had angular telling me Octal literals are not allowed in strict mode. when I tried to use new Date(2014, 29, 7, 10, 38); this is why I'm using now
answer count: 2
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/25013663
favorite count: 0
tagged with: angularjs
tagged with: datetime
has comment: http://stackoverflow.com/comment/38895344
possible better answer: http://stackoverflow.com/a/25013758
has answer: http://stackoverflow.com/a/25013758
has comment: http://stackoverflow.com/comment/38895548
has comment: http://stackoverflow.com/comment/38894995
type: AnsweredQuestion
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25013663

http://stackoverflow.com/a/24925428
has comment: http://stackoverflow.com/comment/38730668
type: Answer
has body: The reason the text isn't staying there is because once you click the button it runs the onclick method, but still submits the form. This pretty much resets the form. If you don't want the form to get submitted and reset then you have to stop the form submission as well. If you add a "return false;" line to the javascript method it should stop the form submission and make the text stay. &lt;form&gt; Username: &lt;input type="text" id="username"&gt;&lt;span id="val"&gt;&lt;/span&gt; &lt;input type="submit" onclick="return check();"&gt; &lt;/form&gt; &lt;script type="text/javascript"&gt; function check() { var username = document.getElementById("username").value; if(username == ""){ document.getElementById("val").innerHTML = "Empty"; } else { document.getElementById("val").innerHTML = "Full"; } return false; } &lt;/script&gt;
answers question: http://stackoverflow.com/q/24925323
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24925323
has comment: http://stackoverflow.com/comment/38757373
score: 2
has comment: http://stackoverflow.com/comment/38730507
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38842068
comment on: http://stackoverflow.com/q/24984966
has text: `context` is expected to be a function and you are passing a function right there: `http.bananas(function (...) { ... });`. If you call the method with any other value, like `http.bananas(4)`, it won't work. There is no magic going on here. A function is like any other value.
score: 0
type: Comment
type: QuestionComment

parsing
tags question: http://stackoverflow.com/q/25063351
tags question: http://stackoverflow.com/q/24913706
tag name: parsing
tags question: http://stackoverflow.com/q/24986450
tags question: http://stackoverflow.com/q/25033294
type: Tag
tags question: http://stackoverflow.com/q/24997163
tags question: http://stackoverflow.com/q/25058134
tags question: http://stackoverflow.com/q/24977558

http://stackoverflow.com/comment/38977560
has text: @kastormania but its still on html format i believe? ejs is the same as jade?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25054285

http://stackoverflow.com/comment/38807518
score: 0
type: Comment
has text: So that explains why the Outside: was logging before Inside... How can I fix this so I can use specialArray later?
type: AnswerComment
comment on: http://stackoverflow.com/a/24966562

http://stackoverflow.com/q/24995571
has answer: http://stackoverflow.com/a/53989190
type: UnansweredQuestion
tagged with: android
tagged with: http://stackoverflow.com/tag/html
upvote count: 3
has body: I am working on a webapp. I want to count the number of Users that added my webapp to home screen. suppose my website is. http://www.example.com I have added meta tags that allow Mobile users to add it to home screen. I want a count of users that downloaded my webapp. If User has downloaded even if he has not opened that then also I should get notification that User has added it to home screen. So I need any event that should work when an Webapp is added to home screen. My webapp is in HTML5
has answer: http://stackoverflow.com/a/24996112
type: Question
tagged with: javascript
answer count: 2
score: 3
downvote count: 0
has title: How to detect that User has added webapp to the homescreen on mobile device?
favorite count: 0

http://stackoverflow.com/comment/38991488
has text: Do I understand correctly that you just want to add the text "red" inside the COLOR xml element? Like this? red . I added the explanation for doing this to my answer as formatting in comments doesn't seem to work correctly.
comment on: http://stackoverflow.com/a/25062963
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38814444
has text: @NaveenThally This is what I try but I get a console error that I cannot figure out. Here is the fiddle URL (http://jsfiddle.net/ZQ9T3/). If somebody can help to fix the issue please?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24970352

http://stackoverflow.com/a/25038474
has body: Found the problem, it was nothing related to dialog, Found this line on my code, it was resetting everything: jQuery.cache = { };
answers question: http://stackoverflow.com/q/24942224
score: 0
type: Answer

http://stackoverflow.com/comment/38706145
score: 0
has text: Can't tell, maybe your are using a CMS?
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24912602

http://stackoverflow.com/a/24990723
type: AcceptedAnswer
type: Answer
score: 6
has body: This guy had the answer https://groups.google.com/forum/#!msg/google-calendar-api/cnkgXfy_GQQ/SRV1N0TAGtYJ var object = { 'end': { 'dateTime': '2014-07-28T23:00:00',//end, 'timeZone': timeZone }, 'start': { 'dateTime': '2014-07-28T18:00:00',//start, 'timeZone': timeZone } //'summary': artist, //'description': description, //'location': address }; var calendarObject = { 'calendarId': calendarId, 'resource': object }; var request = gapi.client.calendar.events.insert(calendarObject);
downvote count: 0
answers question: http://stackoverflow.com/q/24990486
accepted answer of: http://stackoverflow.com/q/24990486
upvote count: 6

http://stackoverflow.com/comment/38889143
has text: Pick a random number `i` from 0 to 2, and a random number `j` from 0 to 1. Then get `myObject[1][i][j]`.
comment on: http://stackoverflow.com/q/25010032
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38899942
type: Comment
has text: Just added it into the post
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25015572

http://stackoverflow.com/comment/38726349
type: QuestionComment
has text: Thanks for your help, I have simplified the code as much as possible here and on JSFiddle. The Dropdown still does not trigger setData()
comment on: http://stackoverflow.com/q/24922800
score: 0
type: Comment

http://stackoverflow.com/comment/38769904
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24945690
has text: it says undefined on both commands..
score: 0

http://stackoverflow.com/comment/38853745
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24991072
type: QuestionComment
has text: Bart: I updated the question. I'm talking about element that has .show() method.

http://stackoverflow.com/q/25049536
upvote count: 1
has body: I have this form: &lt;form method="post" id="myForm" data-parsley-validate&gt; &lt;input type="text" name="firstName" id="firstName" required&gt; &lt;input type="text" name="lastName" id="lastName" required&gt; &lt;input type="text" name="userName" id="userName" data-parsley-trigger="focusout" data-parsley-remote data-parsley-remote-options='{ "type": "POST" }' data-parsley-remote-validator='validateName' required&gt; &lt;input type="button" id="formSave" name="submit" value="Next"&gt; &lt;/form&gt; And script: var userName = $('#userName').parsley(); var _xsrf = $("[name='_xsrf']").val(); $('#myForm').parsley() .addAsyncValidator('validateName', function(xhr) { window.ParsleyUI.removeError(userName, 'name-exists'); if (xhr.status == '404') { window.ParsleyUI.addError(userName, 'name-exists', "Name already exists."); return 404; } else if (xhr.status == '200') { return 200; } }, '/validate/?country=' + country + '&amp;_xsrf=' + _xsrf); The error message is displayed correctly if user already exists, however the field is still validated as correct. Doing this was so easy in v1 of Parsley.js : /
tagged with: parsley.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25049642
accepted answer: http://stackoverflow.com/a/25049642
linked to: http://stackoverflow.com/q/12272123
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
linked to: http://stackoverflow.com/q/24996452
has title: Parsley.js remote validation response still validates to true after ParsleyUI.addError
score: 1

http://stackoverflow.com/comment/59534689
type: Comment
has text: Yes. A component can listen to an event, and update its state each time the event fires.
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/24943743

http://stackoverflow.com/q/24962780
possible better answer: http://stackoverflow.com/a/24962833
has answer: http://stackoverflow.com/a/24962833
tagged with: javascript
has answer: http://stackoverflow.com/a/24962823
has body: I am calling $.getJSON on a url which containts calendar events in the following format. [{"guid":"53c2d70ae6014","date":"1408161600000","type":"event","title":"Weekend Classes Begin","description":"","url":"" }, {"guid":"53c2d70ae601c","date":"1408248000000","type":"event","title":"Freshman Orientation","description":"","url":"" }, {"guid":"53c2d70ae6022","date":"1408334400000","type":"event","title":"Freshman Orientation","description":"","url":"" }] It gets the JSON and puts it into an array and when I use alert(data); it shows up as [object Object],[object Object],[object Object]... I want to be able to add an one or more events to the data I receive from the $.getJSON call. $.getJSON(eventsOpts.eventsjson + "?limit="+limit+"&amp;year="+year+"&amp;month="+month+"&amp;day="+day, function(data) { if(localStorage.getItem('agenda') === null) { } else { var json = localStorage.getItem('agenda'); var jsonObj = JSON.stringify(json); data.push(json); alert(data); } flags.eventsJson = data; // save data to future filters getEventsData(flags.eventsJson, limit, year, month, day, direction); }).error(function() { showError("error no internet connection."); }); The json I want to append is {"guid":"53c2e0a3d0680","date":"1418922000000","type":"event","title":"Fall 2014 Graduation","description":"","url":"" } What I get is [object Object],[object Object],[object Object],{"guid":"53c2e0a3d0680","date":"1418922000000","type":"event","title":"Fall 2014 Graduation","description":"","url":"" } Not sure what I am doing wrong
answer count: 2
downvote count: 0
favorite count: 0
accepted answer: http://stackoverflow.com/a/24962823
has comment: http://stackoverflow.com/comment/38800587
has comment: http://stackoverflow.com/comment/38800553
tagged with: getjson
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has title: Add to data from getJSON
upvote count: 1
type: Question

http://stackoverflow.com/comment/38769547
type: Comment
has text: So, how do I apply your solution to my problem?
type: AnswerComment
comment on: http://stackoverflow.com/a/24946097
score: 0

http://stackoverflow.com/comment/38897360
score: 0
type: Comment
type: QuestionComment
has text: As an aside, consider using $symbol = $this->input->post('symbol') instead of $symbol = $_POST['symbol']; It pre-processes global input data for security.
comment on: http://stackoverflow.com/q/25006088

http://stackoverflow.com/comment/38914480
has text: To illustrate my idea, here's a [fiddle](http://jsfiddle.net/Morklympious/jDL64/)
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25021818

http://stackoverflow.com/comment/38931131
type: QuestionComment
has text: Do you have an element with id `ribboncountdown`
type: Comment
comment on: http://stackoverflow.com/q/25032253
score: 0

http://stackoverflow.com/a/24964337
has comment: http://stackoverflow.com/comment/38908461
type: AcceptedAnswer
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/24964336
type: Answer
answers question: http://stackoverflow.com/q/24964336
has body: I found the answer so I'll add it here in case it will help someone else. Where in plugin.js I had editor.addCommand( 'sbImageDialog', new CKEDITOR.dialogCommand( 'sbImageDialog', {allowedContent: 'img[src][style]', requiredContent: 'img[src]' } )); I had to change the allowedContent property from 'img[src][style]' to 'img[src][style]{*}' The curly braces indicate what css style properties the element is allowed to have. By putting * I am allowing all css style properties.
upvote count: 1

http://stackoverflow.com/comment/38977990
type: AnswerComment
comment on: http://stackoverflow.com/a/25035728
score: 0
has text: var item = $("#grid1").data("kendoGrid").dataItem($(e.currentTarget).closest("tr")); above code working, Thanks
type: Comment

attachevent
tag name: attachevent
type: Tag
tags question: http://stackoverflow.com/q/25047701

http://stackoverflow.com/comment/38746286
score: 0
has text: @epascarello , why so ?
comment on: http://stackoverflow.com/q/24933863
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25033587
score: 1
upvote count: 1
type: AcceptedAnswer
has body: you can use animate $(".tooltip-toggler").hover(function(e) { $(".social-tooltip", this).animate({'top':'-45px', 'opacity':1},200) }, function(e) { $(".social-tooltip", this).animate({'top':'-100px', 'opacity':0},200) }); DEMO UPDATE Here's link to your jsFiddle
type: Answer
accepted answer of: http://stackoverflow.com/q/25033114
answers question: http://stackoverflow.com/q/25033114
downvote count: 0
has comment: http://stackoverflow.com/comment/38933253

http://stackoverflow.com/q/25034630
has comment: http://stackoverflow.com/comment/38935099
score: 3
downvote count: 0
has comment: http://stackoverflow.com/comment/51293210
type: Question
tagged with: javascript
tagged with: inheritance
has title: Prototypal and Nonprototypal inheritance in Javascript (differences)
tagged with: prototype
upvote count: 3
answer count: 1
has comment: http://stackoverflow.com/comment/51292993
favorite count: 0
has answer: http://stackoverflow.com/a/31675498
tagged with: angularjs
has body: Time after time in different sources I see mentioning about Prototypal inheritance and Nonprototypal inheritance, but I dont understand what does it means. As I know JS have only Prototypal inheritance so what is another one? What differences and what is the main idea?
type: UnansweredQuestion

http://stackoverflow.com/comment/38984221
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25060154
type: Comment
has text: as i mentioned in my question i want to use pure javascript ajax not script method

http://stackoverflow.com/q/24946711
linked to: http://stackoverflow.com/q/13418669
accepted answer: http://stackoverflow.com/a/24946768
tagged with: undefined-behavior
type: AnsweredQuestion
upvote count: 3
duplicate of: http://stackoverflow.com/q/13418669
has body: I have a really simple JavaScript question... I have a function, Pets, that contains three variables: an integer, a string, and an array defined as follows: function Pets() { var index; var name; var animals = ["cat", "dog"]; } In another function just below this one I declare a variable of type Pets and push "mouse" onto the animals array. I then do a console log to see the values. function Test() { ... var pets = new Pets(); pets.index = 1; pets.name = "My Pets"; pets.animals.push("mouse"); console.log(pets); } For whatever reason I didn't see any output from the console. I then added some more console logging before and after calling animals.push: var pets = new Pets(); pets.index = 1; pets.name = "My Pets"; console.log("BEFORE PUSH"); console.log(pets); pets.animals.push("mouse"); console.log("AFTER PUSH"); And here is my output: BEFORE PUSH Pets {index: 1, name: "My Pets"} Note that I only see the first console log and not the second (after the push) which I presume indicates a problem with calling push on animals. Also note that the console output shows that Pets has a property called index and a property called name but nowhere does it indicate that there is also a property called animals which is my array. I tried changing the array declaration to: var animals = new Array(); but that didn't seem to help either. Is there something special that I have to do to initialize the animals array before I can push elements on to it? More generally, why doesn't the property animals even show up as part of the Pets class? Thank you, Jan
has title: Javascript Can't Call Push On Array Inside Another Function
type: Question
score: 3
possible better answer: http://stackoverflow.com/a/24946798
has answer: http://stackoverflow.com/a/24946798
has comment: http://stackoverflow.com/comment/38770829
has comment: http://stackoverflow.com/comment/38770752
tagged with: javascript
has answer: http://stackoverflow.com/a/24946768
answer count: 3
has comment: http://stackoverflow.com/comment/38770907
tagged with: function
tagged with: push
tagged with: arrays
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/24946811
has comment: http://stackoverflow.com/comment/38770722

http://stackoverflow.com/a/46135705
has body: Reference it to a variable i.e: var myAudioCtx = new AudioContext(); Then destroy by calling myAudioCtx.close(); That's it.
downvote count: 0
type: Answer
score: 8
upvote count: 8
answers question: http://stackoverflow.com/q/25046470

http://stackoverflow.com/a/24985494
upvote count: 5
answers question: http://stackoverflow.com/q/24984861
score: 5
downvote count: 0
has body: The .y property can be typed as a separate class: class Y { a() {} b(o, e) {} } class X { y = new Y(); z() {} } By the way, these are not "nested methods". Nested methods would be functions inside functions, more like this: function outer() { function nested() { // code... } }
type: Answer

http://stackoverflow.com/q/24926790
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38732794
favorite count: 0
has answer: http://stackoverflow.com/a/24940812
score: -3
type: AnsweredQuestion
has title: How to Create of list containing links using javascript
has comment: http://stackoverflow.com/comment/38744421
downvote count: 3
has body: Am pretty new to JavaScript and trying to create a list containing links. so how do we achieve it using JavaScript? Assuming the contents that are part of the list are available as an array. What needs to be acheived is LinkList Link1 Link2 Link1 and Link2 are links. Statically in HTML page, it can be acheived as given below LinkList Link1 Link2 if we get Link1 and Link2 as an array, how can the dynamic creation of list containing links be achieved using Javascript?
has comment: http://stackoverflow.com/comment/38732692
type: Question
accepted answer: http://stackoverflow.com/a/24940812
has comment: http://stackoverflow.com/comment/38737829
tagged with: javascript
has comment: http://stackoverflow.com/comment/38734300

http://stackoverflow.com/comment/44249985
type: Comment
has text: @ScorpionKing2k5 I'm not sure if this has been fixed in CK5.
type: AnswerComment
comment on: http://stackoverflow.com/a/26022306
score: 0

http://stackoverflow.com/q/24944830
tagged with: jquery
has comment: http://stackoverflow.com/comment/38952416
has comment: http://stackoverflow.com/comment/38769106
favorite count: 0
has answer: http://stackoverflow.com/a/24946116
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38768398
score: 2
upvote count: 3
has comment: http://stackoverflow.com/comment/38768968
downvote count: 1
type: Question
has title: Emulating African village fractals with JavaScript
tagged with: math
tagged with: javascript
tagged with: fractals
has comment: http://stackoverflow.com/comment/38768125
has comment: http://stackoverflow.com/comment/38768387
has body: (Question inspired by this TED Talk - more info here) I'm developing a jQuery plugin to draw images on a canvas in such a way that suggests the fractal-like layout of certain African villages: (source: eglash at homepages.rpi.edu) Given a list of image sources, the plugin works like this: Generate a orthogonally-oriented, fractal-like structure similar to the image above. For each discrete region (rectangle) in the structure, draw an image from the list in that region. Drawing each image is easy enough, but I'm stuck on how to generate the structure. The math that goes into describing fractals is pretty far over my head. Ideally, getting a fractal representation would be as simple as passing the canvas dimensions to a function, which would return a list of rectangles. Each rectangle would be represented as: X/Y coordinates for the top-left corner (relative to canvas) width height How might I implement such a function?
answer count: 1

http://stackoverflow.com/q/25055051
has body: I have a Kendo grid: how can I reload the whole grid after clicking a button? Here's the button: &lt;input type="button" id="btnReload" name="reload" value="Reload" /&gt; Below is the function that handles the button click: $('#btnReload').click(function (e) { var grid = $("#datagrid_Roads").data("kendoGrid"); //grid.reload(); grid.dataSource.page(1); grid.dataSource.read(); }); OK, the above refreshes the data in the grid. What I want is something like the commented code (in the above block) so the whole grid is reloaded, not just the data in it. How can I do this? EDIT The reason I want this is because I want to make a custom filter to my grid since the built-in filter functionalities of the grid do not work for me in Internet Explorer, as can be seen in this question I asked before to which I still haven't found a solution. The custom filter is a DropDownList with different values for filtering. (in my case, concessions to which the listed roads belong) Here are the grid specifications: &lt;div id="datagrid"&gt; @(Html.Kendo().Grid&lt;SustIMS.Models.RoadModel&gt;() .Name("datagrid_Roads") .Columns(columns =&gt; { columns.Bound(r =&gt; r.RoadCode).Title(ViewBag.lblCode).Width(140); columns.Bound(r =&gt; r.RoadType).Title(ViewBag.RoadType).Width(140); ... columns.Bound(r =&gt; r.ConcessionMediumDescription).Title(ViewBag.Concession); }) .HtmlAttributes(new { style = "height: 534px;" }) ... .DataSource(dataSource =&gt; dataSource .Ajax() .Filter(filters =&gt; { filters.Add(road =&gt; road.ConcessionMediumDescription).Contains(Session["concessionFilter"].ToString()); }) .PageSize(15) .Read(read =&gt; read.Action("GetRoads", "MasterData")) ) ) &lt;/div&gt; As you can see, I set a filter that's a session variable, set as the first item of a DropDownList by default. When the user changes the DropDownList selection, a controller method is called and the session variable is set with a filter value. However, the grid doesn't show any filtered data because it was loaded bef…
linked to: http://stackoverflow.com/q/17205595
answer count: 1
has answer: http://stackoverflow.com/a/25056537
has title: Reload Kendo Grid, not just the data in it
has comment: http://stackoverflow.com/comment/38974491
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/18399805
type: Question
tagged with: kendo-grid
tagged with: javascript
tagged with: jquery
tagged with: kendo-ui
has comment: http://stackoverflow.com/comment/38974218
score: 0
linked to: http://stackoverflow.com/q/24883572

http://stackoverflow.com/q/25049680
has answer: http://stackoverflow.com/a/25072596
type: UnansweredQuestion
has body: Here is the code I am using to build the anchor tag and content within. $('div#right-slide').html(" Click Here for Limited Time Specials "); I am sure there is a much better way to go about this but I am new and am just trying to get it to work right now. When I hover over the text, the bottom of the browser shows the addrress for the link but when I click, nothing happens. Can someone point me in the direction of the error? Thanks for any help.
type: Question
tagged with: anchor
has comment: http://stackoverflow.com/comment/38964186
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38965083
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: JQuery built anchor tag will not redirect

http://stackoverflow.com/comment/38725661
has text: I found a solution that works pretty well. Thanks for your time.
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24922526

http://stackoverflow.com/a/25000774
score: 0
has body: You can do this instead: $(document).ready(function () { $('.mainBar li').mouseover(function () { $(this).find('.subBar').show(); console.log('over'); }); $('.mainBar li').mouseout(function () { $(this).find('.subBar').hide(); }); }); This is the jsfiddle
type: Answer
answers question: http://stackoverflow.com/q/25000551

http://stackoverflow.com/a/24947022
has comment: http://stackoverflow.com/comment/38771331
has comment: http://stackoverflow.com/comment/38771223
score: 0
has comment: http://stackoverflow.com/comment/38771415
has comment: http://stackoverflow.com/comment/38771276
has comment: http://stackoverflow.com/comment/38771741
answers question: http://stackoverflow.com/q/24946772
has comment: http://stackoverflow.com/comment/38771552
has body: $('#name').change(function(){ $('#name2').val( $('#name2').prop('defaultSelected') ); }); $('#name2').change(function(){ $('#name').val( $('#name').prop('defaultSelected') ); }); add one function for that, I tested that, I think it worked. here ur fiddle, `
type: Answer
has comment: http://stackoverflow.com/comment/38771566
has comment: http://stackoverflow.com/comment/38771523
has comment: http://stackoverflow.com/comment/38771178
has comment: http://stackoverflow.com/comment/38771451

http://stackoverflow.com/q/25011095
tagged with: jquery-selectors
tagged with: jquery
tagged with: tinymce
has comment: http://stackoverflow.com/comment/38891283
has comment: http://stackoverflow.com/comment/38891490
type: UnansweredQuestion
has body: I'm trying to make gradual system with tinymce. For example: there is a main div as "editable", when you click editable there are 4 options to add: "Slider, Google map, Content, Photo" than, when you click "Content" it inserts "" div to, main div. If you click "content-area" div, there should be 2 options as "one-column" "two-column". but i doesn't. It gives me again, 4 options like before. Because it defines it as a Editable div. &lt;div class="editable"&gt; &lt;div class="content-area"&gt;&lt;/div&gt; &lt;/div&gt; I need to define selector as "div.editable:not(.content-area)" but i doesn't work for tinymce. How can I make it? How can I add ":not" selector to tinymce. here is an example: http://fiddle.tinymce.com/wqeaab
answer count: 0
type: Question
tagged with: javascript
score: 0
has title: Tinymce (chosing selector)

http://stackoverflow.com/comment/38716701
has text: It is passing the browser address as reference. i.e, http://localhost:8888/# THE NEWS WILL GO HERE However, I need to pass something unique which will help me call a different function for each heading.
comment on: http://stackoverflow.com/a/24918074
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/25009766
has body: Basically, I'm having a javascript file in which there is a ajax function which has its url pointing to a php file named getfile.php. In this php file, I'm reading and storing content of another php file with url: http://xxx.xxx.x.xx/php/getpage.php?mode=opensvc&amp;fx=getPositions&amp;date=2014-04-02&amp;time=0&amp;lat=27.219722&amp;lng=78.019616/ having data in json form to utilise in my javascript file. I am having a problem as now I want to get the json data from php file dynamically by appending date from html input tag to getfile.php, so that the json data will be available according to date as it will append in url to dynamically change the date attribute. our getfile.php code is:- $homepage =file_get_contents('http://xxx.xxx.x.xx/php/getpage.php?mode=opensvc&amp;fx=getPositions&amp;date=2014-04-02&amp;time=0&amp;lat=27.219722&amp;lng=78.019616/'); echo $homepage; ajax code in javascript file:- $.ajax({ url: "getfile.php", type: "POST", dataType: 'json', success: function (data) { var i = 0; while (data[i]) { lat[i] = data[i].latitude; lng[i] = data[i].longitude; latlng1[i] = new google.maps.LatLng(lat[i], lng[i]); } } }); If I change the date attribute in the url then the json data from that url is different so I want to provide the date dynamically.
type: Question
has answer: http://stackoverflow.com/a/25051626
has answer: http://stackoverflow.com/a/25009973
accepted answer: http://stackoverflow.com/a/25051626
has title: Dynamically appending date with php url using javascript, jquery or ajax
tagged with: javascript
upvote count: 2
answer count: 2
has comment: http://stackoverflow.com/comment/38893852
downvote count: 0
tagged with: jquery
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38888764
has comment: http://stackoverflow.com/comment/38890429
possible better answer: http://stackoverflow.com/a/25009973
tagged with: php
score: 2
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/38854881
score: 1
comment on: http://stackoverflow.com/q/24939355
type: QuestionComment
has text: Instead of categoreis, you can use datetime type of chart.
type: Comment

http://stackoverflow.com/a/24952020
downvote count: 0
score: 4
type: Answer
has body: First: EISDIR means "error! target is a dir"(i guess), about the error Second: ncp is what you need i guess
accepted answer of: http://stackoverflow.com/q/24951269
upvote count: 4
answers question: http://stackoverflow.com/q/24951269
type: AcceptedAnswer

http://stackoverflow.com/comment/38713191
type: Comment
has text: @Code Maverick, yes, I see. But, unfortunately, I have no access to .doc-view CSS, and it might stay unchangeable.
type: AnswerComment
comment on: http://stackoverflow.com/a/24915133
score: 0

http://stackoverflow.com/comment/38871567
has text: Yes, don't convert the data to a string, use deserialize a stream instead.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24998781
score: 0

http://stackoverflow.com/q/25014872
possible better answer: http://stackoverflow.com/a/40708012
has answer: http://stackoverflow.com/a/40708012
has body: I'm trying to create a user login page that has a 'remember me' checkbox. Sounds simple, right? When the user logs in without the 'remember me' checkbox selected, a default session ttl would be set to 10 seconds (10000 ms). However, if the 'remember me' checkbox is selected, then the ttl would be set to 100000 seconds (100000000 ms). Skipping all of the authentication of username and password stuff, I've set up this small demo to exemplify my goals. Unfortunately, it seems that the session ttl is ALWAYS 10 seconds, and is never 100000 seconds. Heres the pastebin for the code below: http://pastebin.com/45bRfxkn var Hapi = require('hapi'); var AuthCookie = require('hapi-auth-cookie'); var server = new Hapi.Server('localhost',4000); // make a server // this function is just for my example, I'll use an actual logger later... function xhrlog(request){ var auth = request.auth.isAuthenticated ? "Authenticated" : "Not Authenticated"; console.log(request.method.toUpperCase()+" request to "+request.path+" is "+auth+"."); } // this is the handler for the '/' route. You should start at this route first (it represents the login page) function firstLoad(request, reply){ xhrlog(request); request.auth.session.set({}); reply(" click the button to test. "); } // this is the page that i would expect to have created a session cookie with a ttl of 100000. But it doesnt. function authorized(request,reply){ xhrlog(request); reply(" This is the authorized page. I would expect this page to have a session timeout of 100000 seconds. But it doesnt, it only has 10 seconds. Keep refreshing to see if you are still alive! "); } // set up the unauthenticated route here. this is the "login" page. server.route({ method:'GET', path:'/', config: { handler: firstLoad } }); server.pack.register(AuthCookie, function(err){ // set up strategy for the session cookie. It defaults to 10000 ms server.auth.strategy('session', 'cookie', { password: 'secret', cookie: 'iDontKnowWhatThisIsFor', redirectTo: '/', isSe…
accepted answer: http://stackoverflow.com/a/25117705
type: Question
type: AnsweredQuestion
answer count: 2
has title: Set ttl for hapi-auth-cookie for specific route
tagged with: hapi.js
tagged with: javascript
has answer: http://stackoverflow.com/a/25117705
score: 0
tagged with: node.js

http://stackoverflow.com/comment/38789865
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24940627
has text: Well, your own design requirements determine how you want to do rotation. If you want to rotation around an objects center then set the rotation point (offsetX/offsetY) at the center of your object then set your rotation angle.
type: AnswerComment

http://stackoverflow.com/comment/38709192
type: Comment
score: 5
comment on: http://stackoverflow.com/q/24914294
has text: Showing the generated code would be more useful. Examples should be *complete*. Also, those two jquery calls are equivalent, as you can read in the documentation. There is no need for the `if` statement.
type: QuestionComment

http://stackoverflow.com/comment/38702864
type: QuestionComment
comment on: http://stackoverflow.com/q/24911194
score: 2
has text: the result of checkAddress is `asynchronous` (meaning it can return at any time in the future and hence doesn't block other code from carrying on) and thus you will have to make a callback from within `function(results, status){...` to then continue validation and potential submission.
type: Comment

http://stackoverflow.com/q/25050196
favorite count: 0
has answer: http://stackoverflow.com/a/25621249
possible better answer: http://stackoverflow.com/a/25050265
has title: contine with page if "if" not the variable
answer count: 3
has answer: http://stackoverflow.com/a/25050265
downvote count: 1
upvote count: 0
has body: I am creating a responsive design of my website for smartphones based on browser width... this code i got somewhere on this site.... Thank you whomever u r. function viewPort() { var h = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight; var w = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth; } which runs great so I followed with: if ( viewPort().width &lt;= 600) { window.location.href = "ams/1.cfm?W=" + viewPort().width + "" } else { } so the regular page would continue to load if the browser > 600 the first part works fine but when the browser exceeds 600 the page stops loading and does nothing... tried without else tag first. also should I have some sort of "abort" if the if statement is true?
type: AnsweredQuestion
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/38965434
has answer: http://stackoverflow.com/a/25050248
tagged with: if-statement
accepted answer: http://stackoverflow.com/a/25050248
score: -1
type: Question
tagged with: mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/38965192

http://stackoverflow.com/q/25004066
has title: What is "~" represent in this JavaScript?
score: -2
tagged with: javascript
has body: I am not a JavaScript expert, but I'm reading the code and found out that there's a statement like this. if(!~dssClass.indexOf("hideDiv") What's the "~" mean in this statement? Thanks
downvote count: 4
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25004105
upvote count: 2
duplicate of: http://stackoverflow.com/q/12299665
type: Question
tagged with: if-statement

http://stackoverflow.com/comment/39234911
comment on: http://stackoverflow.com/a/24989366
has text: There is also a field in the order form I only want to show if a specific product is selected otherwise it will be hidden. Can I use the same method for that as well?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38933739
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25030344
has text: Most of the times, you know the type you are sorting already. Sorting is mostly done on database side. (It's made for it and it's best for it) in a database you can sort on a 'my_date' column the database knows it's a date if you save your dates appropriately. Same goes when you don't sort in the database but in the backend. The data in the store gets mapped to backend objects. If 'my_date' is saved in the appropriate data type it's easy to sort appropriately.
type: Comment

http://stackoverflow.com/comment/38983094
comment on: http://stackoverflow.com/q/25058386
has text: See http://stackoverflow.com/questions/203198/event-binding-on-dynamically-created-elements
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38736250
score: 0
type: AnswerComment
has text: Thanks, this is what I needed. Also, it's very comforting to a beginner such as myself to see that even the pro's sometimes make the mistake of using <= to loop through an array's length. :D
type: Comment
comment on: http://stackoverflow.com/a/24927892

http://stackoverflow.com/comment/38767566
type: Comment
type: QuestionComment
has text: @user2751134 What are the braces supposed to do?
score: 0
comment on: http://stackoverflow.com/q/24942313

http://stackoverflow.com/a/25001982
score: 2
accepted answer of: http://stackoverflow.com/q/25001827
answers question: http://stackoverflow.com/q/25001827
type: AcceptedAnswer
downvote count: 0
has body: jQuery has a makeArray function that looks promising. It should return a JS array with all the elements from the original object: jQuery.makeArray( $("input").filter(":hidden") ) See: http://api.jquery.com/jquery.makearray/
upvote count: 2
type: Answer

http://stackoverflow.com/comment/38713735
has text: are you sure it dose not work? did you add jQuery? it works for me!!
comment on: http://stackoverflow.com/q/24916577
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24941285
downvote count: 1
type: Question
tagged with: browser
has answer: http://stackoverflow.com/a/24941598
tagged with: javascript
score: 4
answer count: 1
tagged with: web
favorite count: 0
upvote count: 5
has body: Browsers throttle timers when the webpage moves to the background tab. Wouldn't this require the browser to keep track of all the timers for a particular tab? If so, and at a high level, how is this implemented? Or, perhaps, is the browser able to throttle the activity of an entire tab without regards to any individual timer? Specifically: Developers often keep track of timer ids for various reasons. Isn't this redundant in some cases? Hypothetically, couldn't the developer just invoke a function that tells the browser "when you reach a timer in the event loop, do something special"
type: AnsweredQuestion
has title: How do browsers store JavaScript timers?
accepted answer: http://stackoverflow.com/a/24941598

http://stackoverflow.com/q/25067182
has body: I have a page that uses the Youtube iFrame api to embed a Youtube player. I use this player to send Youtube videos to the default Youtube receiver application on my Chromecast device. I noticed that the events thrown by the player aren't the same when it's connected to a Chromecast. For example, it never says that it's paused or playing even if it is playing on Chromecast. My question is, is there a way to know if the embedded Youtube player is connected to a device to better handle these events? Thanks!
type: Question
has title: Get Youtube Iframe State While Chromecasting
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: youtube-iframe-api
answer count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: chromecast
tagged with: youtube
score: 2

http://stackoverflow.com/comment/38965628
has text: what browser are you using. certain browsers only support certain video formats. eg, if you're using safari, it will not work in this case as safari doesn't support mp4.
comment on: http://stackoverflow.com/q/25050481
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38769890
has text: How do you call the `test` function, and what do you expect `this` in it to be?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24945940

http://stackoverflow.com/comment/38960129
score: 1
type: Comment
type: QuestionComment
has text: Perhaps this is just a sample problem, but there is no need to treat valueUnit as a model. That will bring a lot of overhead and complexity. It's not a model--it's just a complex datatype. If you want more control over it or help getting to and fro, you can define a transform so you can define it as `width: DS.attr('valueUnit')`.
comment on: http://stackoverflow.com/q/25044316

http://stackoverflow.com/q/25055972
has title: ng-repeat with as alias not working
upvote count: 0
answer count: 1
tagged with: angularjs-ng-repeat
favorite count: 0
has answer: http://stackoverflow.com/a/25056163
tagged with: angularjs
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25056163
downvote count: 1
type: Question
has body: According to documentation this directive should work: user in users | filter:search as searchResults. But it does only if I remove as, but I need it to show empty results message. Here is a jsfiddle to demonstrate. What am I doing wrong?
tagged with: javascript
score: -1

http://stackoverflow.com/comment/38750780
score: 2
comment on: http://stackoverflow.com/q/24936433
type: QuestionComment
type: Comment
has text: Down voting without commenting - especially to a 1rep is not very constructive. Asker: Create a JSfiddle.net so we don't have to

http://stackoverflow.com/comment/38859502
type: Comment
type: QuestionComment
has text: By "reusable" you mean you need those function within the configuration phase as well as during runtime of the app?
comment on: http://stackoverflow.com/q/24994347
score: 0

http://stackoverflow.com/q/25005511
answer count: 2
has comment: http://stackoverflow.com/comment/38880762
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38880769
duplicate of: http://stackoverflow.com/q/17776940
upvote count: 3
has answer: http://stackoverflow.com/a/25005545
accepted answer: http://stackoverflow.com/a/25005545
has comment: http://stackoverflow.com/comment/38880776
linked to: http://stackoverflow.com/q/17776940
has title: Javascript Code Structure - How Does This Work?
downvote count: 0
has answer: http://stackoverflow.com/a/25005588
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/25005588
has body: I've stumbled upon a pretty elegant way to structure JS Code for a page, though I'm not really sure why it works the way it does. Could someone explain to me how this works? (Why is that return statement there for example). Also is there a name to describe a pattern like this? var PageCode = (function () { return { ready: function () { console.log('document.ready'); }, load: function() { console.log('document.load'); } }; }()); $(document).ready(PageCode.ready); $(window).load(PageCode.load);
type: Question

http://stackoverflow.com/comment/38841347
comment on: http://stackoverflow.com/q/24984608
score: 0
has text: There is magic way to do this. You need a simple `if` statement. You've given us the pseudo code for it, so just implement that in real code.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24909700
answer count: 1
has title: Get existing Solution name before Project template creation in C++ custom Wizard
type: UnansweredQuestion
tagged with: c++
has body: I have created a new project template using C++ custom Wizard(VS 2010).I want to make some customizations while adding my new project template in OnFinish event of Default.js file. My project requirement needs the existing solution name appeneded with "Resources" text as the name of my new project added using my C++ wizard. eg. Solution Name : MySolution Existing Project name : MyWin32Project New Project name should be created as : MySolutionResources So to acheive this, i need the solution name of existing solution before adding my project.Currently i am appending the "Resources" string to the project name given while creation of template.I used the line below: var strProjectName = wizard.FindSymbol('PROJECT_NAME'); var strNewProjectName = strProjectName + "Resources"; selProj = CreateCustomProject(strNewProjectName, strNewProjectPath); I have tried with following line but its giving me the project name given while creation: var strSolutionName = wizard.FindSymbol("VS_SOLUTION_NAME");//not giving me the solution name var strNewProjectName = strSolutionName + "Resources"; Can someone help me on this please?? Regards, Deepthi
type: Question
tagged with: javascript
tagged with: visual-c++
score: 0
has answer: http://stackoverflow.com/a/24952575

http://stackoverflow.com/comment/38816529
has text: [This question](http://stackoverflow.com/questions/20885297/collision-detection-in-html5-canvas) can show you how to detect the collisions between the balls and the container, and [this one](http://stackoverflow.com/questions/8331243/circle-collision-javascript) between the balls themselves. Then on collision you should change the direction of the ball, to create the bounce back.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24971377
score: 0

http://stackoverflow.com/comment/38851160
score: 0
has text: you are right. what i meant is that I am trying to understand what the best compromise is.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24988656

http://stackoverflow.com/q/24951328
upvote count: 2
has title: CSS: z-index doesn't work prperly when i append the new div element
answer count: 3
has answer: http://stackoverflow.com/a/30673166
has comment: http://stackoverflow.com/comment/38779121
has comment: http://stackoverflow.com/comment/38779922
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38846542
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: z-index
favorite count: 0
accepted answer: http://stackoverflow.com/a/30673166
type: Question
has body: I want to implement the website about draw some rectangles and stickers configured by div element. To add sticker or rectangle, User click the button. I want to arrange div element in the order of below (upper) sticker > rack > rectangle > canvas (lower) So I used z-index in style sheet. #canvas { position: relative; z-index: 1; ... } .rectangle { position: absolute !important; z-index: 2 !important; ... } .rack { position: absolute !important; z-index: 3 !important; ... } .sticker { position: absolute !important; z-index: 4 !important; ... } It works well, when elements are allocated by html code. When I clicked the button to append element to canvas, it doen't work properly. the new rectangle cover the stickers, even though the z-index of the rectangle is lower than sticker's. I think the z-index of these are like below (upper) new sticker > new rack > new rectangle > old sticker > old rack > old rectangle (lower) How can i fix this error. Please refer this fiddle (http://jsfiddle.net/crisply/bD35Z/9/)
tagged with: css
has comment: http://stackoverflow.com/comment/38868657
has comment: http://stackoverflow.com/comment/38885882
has comment: http://stackoverflow.com/comment/38782097
possible better answer: http://stackoverflow.com/a/24951369
has answer: http://stackoverflow.com/a/75036543
has answer: http://stackoverflow.com/a/24951369

http://stackoverflow.com/comment/38909635
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25020236
has text: I do love this idea. In fact, I have a very similar feature to this set up with a photo gallery of the bride and groom. I just wanted to find something a little different for the bridal party to make the site a little more dynamic. Thank you though! It is a great alternative to what I asked for.
type: AnswerComment

http://stackoverflow.com/q/25026308
linked to: http://stackoverflow.com/q/29829597
answer count: 1
downvote count: 0
tagged with: websocket
has answer: http://stackoverflow.com/a/47851541
has comment: http://stackoverflow.com/comment/66977037
favorite count: 0
has comment: http://stackoverflow.com/comment/73669299
upvote count: 8
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: node.js
score: 8
has comment: http://stackoverflow.com/comment/81639787
has body: I wanted to learn how to do a web-based real time multiplayer game and recently, I found this one and tried it. Took me a lot of time to understand it since I have no background on js, websockets and nodes. Anyways I've done most parts of that blog but I kept getting this error. The following error shows on the javascript console: WebSocket connection to 'ws://localhost/socket.io/?EIO=2&amp;transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 200 I have already started the game server with the line: C:\xampp\htdocs\node game.js and it only shows something like this _, an underscore blinking. So blankly its nothing, but I've read questions similar with problems and they said something like it is already working but it not just showing anything which it not really a bad thing. I am really new to this kind of stuff so please, if anyone out there knows how to solve this problem please respond. It will be so much appreciated.
type: Question
has comment: http://stackoverflow.com/comment/81874908
has comment: http://stackoverflow.com/comment/68740432
has comment: http://stackoverflow.com/comment/45147731
tagged with: javascript
has title: Unexpected response code: 200
has comment: http://stackoverflow.com/comment/42410355
tagged with: real-time

http://stackoverflow.com/a/25044988
answers question: http://stackoverflow.com/q/25044889
has body: Try $viewContentLoaded. In your controller: $scope.$watch('$viewContentLoaded', resize); Eventually you probably want to do this in a directive. You want to avoid DOM manipulation in your controller.
downvote count: 0
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38955456
score: 1

http://stackoverflow.com/q/25069449
tagged with: javascript
has body: I am doing a web page, and in this I have ads. I do the ads with Google Web Designer, this program generates an iframe. In function of the client device, specifically the width of this device, I want to show a specific iframe. How can I specify the src of the iframe that want I to show, in function of the device-width? I try using media queries in CSS to hide all iframes except the correct, but it is not work correctly; I try it in Windows Phone and Android. Offtopic: if anyone know a software better than Google Web Designer, tell me.
has answer: http://stackoverflow.com/a/25069517
answer count: 1
has title: Iframe src depending device width
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: css
score: 0
tagged with: iframe
type: Question

http://stackoverflow.com/comment/38865577
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24997600
has text: Try to host js file locally also. Using different protocols might (and should) throw security warnings.
score: 0

http://stackoverflow.com/comment/38840912
comment on: http://stackoverflow.com/q/24984212
type: Comment
type: QuestionComment
has text: I cannot reproduce that issue using the code provided. Perhaps if there was a codepen or jsfiddle illustrating the issue we could better troubleshoot it
score: 0

http://stackoverflow.com/comment/38746708
has text: Just did it. Glad you got yourself sorted out.
comment on: http://stackoverflow.com/q/24927577
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38893355
comment on: http://stackoverflow.com/q/25011145
type: QuestionComment
has text: use exit; at the end of function...
type: Comment
score: 0

http://stackoverflow.com/a/25046083
upvote count: 1
answers question: http://stackoverflow.com/q/25045737
accepted answer of: http://stackoverflow.com/q/25045737
type: AcceptedAnswer
downvote count: 0
has body: Option 1 var startToken = "!" + "-"; var endToken = "-" + "!"; output += startToken + currentValue + endToken; Option 2 output += "!\-" + currentValue + "-\!";
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38957541

http://stackoverflow.com/a/25010308
score: 4
has body: So you want to pass hard coded file path using javascript. Thank goodness, in javascript (run inside the browser) you can't do that. Only the user can populate a &lt;input type="file"&gt; element or File objects in a FileList. On setting, if the new value is the empty string, it must empty the list of selected files; otherwise, it must throw an InvalidStateError exception. and The HTMLInputElement interface [HTML] has a readonly attribute of type FileList... See a thorough write-up including HTML5 features here: Remember and Repopulate File Input Hope this helps!
upvote count: 4
has comment: http://stackoverflow.com/comment/38889982
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25010019

http://stackoverflow.com/q/25068188
score: 0
accepted answer: http://stackoverflow.com/a/25068202
has title: About YUI compressor and javascripts
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25068202
has body: I am using handlebars in my website. So that I need to send the 'handlebars.runtime.js' to the client side. However I found that the 'handlebars.runtime.js' from the offocial website isn't compressed, so I use the YUI compressor to compress it. Something weird occurred when I checked the compressed 'handlebars.runtime.js': some codes are disappeared in the compressed one when I compared to the previous one. And the very beginning of the compressed one is like this: /*! handlebars v1.3.0 Copyright (C) 2011 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. @license */ ;var Handlebars=(function(){v (rest of the codes...) As you can see, the comments are not deleted by the YUI compressor and there is a weird semicolon at the very beginning of the codes. Can anyone explain this? Thanks! PS: the beginning uncompressed 'handlebars.runtime.js' is like this: /*! handlebars v1.3.0 Copyright (C) 2011 by Yehuda Katz Permission is hereby granted, free of charge, to any person obtaining a copy of this software an…
type: Question
tagged with: yui-compressor
answer count: 1
tagged with: javascript

jquery-hover
tags question: http://stackoverflow.com/q/24945089
type: Tag
tags question: http://stackoverflow.com/q/24944753
tag name: jquery-hover
tags question: http://stackoverflow.com/q/25001248

http://stackoverflow.com/a/24931202
type: Answer
has body: select the html element by document.getElementById/getElementsByClassName and attach the js value like var ele = document.getElementById('footerid'); ele.innerHTML += array[2][0]; note: getElementsByClassName would give u an array update here is a working fiddle using the same markup u shared.
answers question: http://stackoverflow.com/q/24931129
score: 0

http://stackoverflow.com/q/24955811
has body: I have a list that has several option. I dynamically set an event that whenever a button is clicked, create a table and text input and put the value of list in in there, but I have option that have number value but it didn't set to the value of that input. See my code. My jquery code: $("#table_drugs").append(" " + $("#drugs_list").val() + " " + " " + $("#drugs-explain").val()+" " + " " + " delete " + " "); And my html: empty Drugs 1 Drugs 3 Drugs 2
has comment: http://stackoverflow.com/comment/38787174
type: Question
has comment: http://stackoverflow.com/comment/38787243
tagged with: javascript
has comment: http://stackoverflow.com/comment/38786984
score: 0
has title: Cant' put number in value of text input using jquery
accepted answer: http://stackoverflow.com/a/24956000
answer count: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38787107
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24956000

http://stackoverflow.com/comment/38793815
type: Comment
has text: I guess i just don't understand what your goal here is then. I can say for sure that what you are currently doing simply isn't possible, so you'll have to come up with another way to accomplish your goal.
comment on: http://stackoverflow.com/q/24958553
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38798676
type: QuestionComment
comment on: http://stackoverflow.com/q/24961114
has text: sorry i meant $.getJSON
score: 0
type: Comment

http://stackoverflow.com/q/24941363
has answer: http://stackoverflow.com/a/24941447
answer count: 4
favorite count: 0
upvote count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24941442
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24941561
has answer: http://stackoverflow.com/a/24941422
has title: Pulling Information from JSON
has comment: http://stackoverflow.com/comment/38760338
type: Question
has body: I have the following JSON string: var txt= '{“group”: [ {“family1”: { “firstname”:”child1”, “secondname”:”chlid2” }}, {“family2”: { “firstname”:”child3”, “secondname”:”child4” }} ]}'; I'm having difficulty pulling out information such as "child1". I'm sure if it is just a syntax problem, or I'm not doing it correctly. I've tried doing this: alert (group[0].family[0].firstname); But I'm getting nothing....
possible better answer: http://stackoverflow.com/a/24941422
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24941442

http://stackoverflow.com/comment/38834749
score: 0
comment on: http://stackoverflow.com/q/24981197
type: Comment
type: QuestionComment
has text: @T.J Crowder this is Math

http://stackoverflow.com/comment/38918891
type: Comment
has text: I don't know what the webgl id is because I don't see it, all I know is that using cesium sandcastle it shows me that everything is inside an id called cesiumContainer. I tried your code minus the ctx.drawimage and it showed a blank white image, tried guessing some id's but nada.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25022602

http://stackoverflow.com/comment/38897474
comment on: http://stackoverflow.com/q/25014419
score: 2
has text: Try http://api.jquery.com/dblclick/
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38761976
type: Comment
comment on: http://stackoverflow.com/a/24914948
has text: That's pretty much what I'm doing, the problem for me is that if the form called javascript when the submit button was clicked, I don't know if that javascript called form.submit() or not. I want to know if it's possible to determine that.
type: AnswerComment
score: 0

http://stackoverflow.com/q/25025328
tagged with: polymer
has title: polymer, using attribute data binding in the constructor functions
accepted answer: http://stackoverflow.com/a/25026567
tagged with: javascript
score: 0
answer count: 1
has body: I'm trying to use a polymer custom element to format and display charts rendered by charts.js - i'm trying to get the custom element to pass it's instanced attribute chartID to the constructor function to properly create the chart - for the life of me i cant get the getContext() method/function to run on anything using the passed attributes this is the instanced custom element declaration: and here is my custom element: i've tried a million different combinations of the last line to render the chart, but i can't seem to find one that works alert(this.chartID); resolves fine to "figure1" but new Chart(this.chartID.getContext('2d')).Pie(dataFigure1); throws an "undefined is not a function" error alert(this.$.chartID); resolves to "undefined" alert(this.chartID.getContext('2d'); doesn't resolve at all, or isn't alertable, not surprising new Chart(this.$.figure1.getContext('2d')).Pie(dataFigure1); works fine, but i'm trying to not hard code this line...
type: AnsweredQuestion
tagged with: chart.js
has answer: http://stackoverflow.com/a/25026567
type: Question

http://stackoverflow.com/comment/38735359
score: 0
type: Comment
type: QuestionComment
has text: i have added the index2.html code.
comment on: http://stackoverflow.com/q/24928133

http://stackoverflow.com/a/27269047
type: Answer
downvote count: 0
score: 1
has body: $scope.gridOptions.$gridScope.toggleSelectAll(false, false); // note: false,false this.selectedItems.length =0 both of them work for me.
upvote count: 1
answers question: http://stackoverflow.com/q/24959659

http://stackoverflow.com/comment/38815229
has text: It looks like "timeline" is not defined in your controller scope.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24970779

http://stackoverflow.com/comment/38703310
comment on: http://stackoverflow.com/a/24911187
has text: @user3807992 -- There should be an outline of a check mark next to my answer - clicking it will "Accept" the answer.
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/24944644
favorite count: 0
linked to: http://stackoverflow.com/q/14220321
type: UnansweredQuestion
duplicate of: http://stackoverflow.com/q/14220321
answer count: 0
has title: get json from wikipedia services
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: i am trying to get infobox from wikipedia services using jquery $.getJSON function. This is my function: function GetInfoboxWikipedia(sTerm){ alert("Termo de pesquisa: " +sTerm); var url="http://en.wikipedia.org/w/api.php?action=parse&amp;format=json&amp;page=" + sTerm + "&amp;redirects&amp;prop=text&amp;callback=?"; var html = ""; $.getJSON(url,function(data){ wikiHTML = data.parse.text["*"]; $wikiDOM = $("&lt;document&gt;"+wikiHTML+"&lt;/document&gt;"); alert("html: "+$wikiDOM.find('.infobox').html()); html += $wikiDOM.find('.infobox').html(); }); return html; } i call it like this: result_html += GetInfoboxWikipedia(searchTerm); result_html is what i the html element i am appending to. ALthough the alerts in the function return correctly nothing appears. i think its because the call is asynchronous. How can i have the result_html += GetInfoboxWikipedia(searchTerm) returning the value when i enter in that part of the code?
score: 1
tagged with: asynchronous

http://stackoverflow.com/comment/38977890
score: 1
has text: working fiddle: http://jsfiddle.net/e84pT/
comment on: http://stackoverflow.com/q/25056953
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24967149
type: Answer
has body: To fetch the arra of image objects you can use the get(); function in jquery. var slideshow = $("#the_id").get(); See the documentation here.
score: 0
answers question: http://stackoverflow.com/q/24966996

http://stackoverflow.com/a/24960669
has comment: http://stackoverflow.com/comment/38796358
has comment: http://stackoverflow.com/comment/38796520
has comment: http://stackoverflow.com/comment/38796422
type: Answer
has comment: http://stackoverflow.com/comment/38796778
answers question: http://stackoverflow.com/q/24960472
has comment: http://stackoverflow.com/comment/38796249
has comment: http://stackoverflow.com/comment/38796304
score: 0
has comment: http://stackoverflow.com/comment/38796741
has body: Try this with simple CSS transitions, like this HTML &lt;div id="parent"&gt;&lt;br/&gt;&lt;span class="bullets"&gt;* * * *&lt;/span&gt;&lt;/div&gt; CSS .bullets{ opacity:1; } #parent:hover &gt; .bullets{ opacity:0; transition: opacity .2s ease-out; -moz-transition: opacity .2s ease-out; -webkit-transition: opacity .2s ease-out; -o-transition: opacity .2s ease-out; } FIDDLE HERE>>

http://stackoverflow.com/a/24963036
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24962148
accepted answer of: http://stackoverflow.com/q/24962148
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38924927
has body: From the Google Maps Image APIs: The Google Maps Image APIs make it easy to embed a static Google Maps image or Street View panorama into your web page, with no need for JavaScript. The APIs are as simple as constructing a URL with the information about your image; once the URL is loaded from an image tag, Google will create and return your map or Street View scene. Then you can get an image instead of the javascript map with &lt;img src="http://maps.googleapis.com/maps/api/staticmap?center=-15.800513,-47.91378&amp;zoom=11&amp;size=200x200"&gt; Source
has comment: http://stackoverflow.com/comment/38813079
has comment: http://stackoverflow.com/comment/38801288

http://stackoverflow.com/a/24919667
score: 0
has comment: http://stackoverflow.com/comment/38726164
has body: Use JSON.parse(data) to convert your JSON string into an object. Then you can manipulate that object. Once you're done manipulating simply use JSON.stringify() to get a JSON string back. Sample code: var data = "{\"status\": \"created\", \"name\": \"mike\", \"templateId\": \"0171502E-38F7-43A7-BA09-6FC1FDAB09C2\", \"templateRoles\": [{ \"roleName\": \"Signer\", \"emailSubject\": \"test\", \"email\": \"hellO@yahoo.com\"}]}"; var jsonObj = JSON.parse(data); jsonObj.templateRoles = "some roles here"; var newDataStr = JSON.stringify(jsonObj);
has comment: http://stackoverflow.com/comment/38719930
type: Answer
has comment: http://stackoverflow.com/comment/38719869
accepted answer of: http://stackoverflow.com/q/24919581
has comment: http://stackoverflow.com/comment/38725663
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24919581
has comment: http://stackoverflow.com/comment/38727395

http://stackoverflow.com/q/24928635
has answer: http://stackoverflow.com/a/25004520
tagged with: dom
type: Question
score: 5
tagged with: javascript
answer count: 1
favorite count: 0
upvote count: 5
type: UnansweredQuestion
has body: is there a way, how to force mutation observer to ignore DOM changes cause by callback function? Right now I have: var config = { attributes: true, childList: true, characterData: true }; var target = document.body; var timer; // create an observer instance var observer = new MutationObserver(function(mutations) { // fired when a mutation occurs timer = setTimeout(function () { _3rd_party_callback(); }, 500); }); observer.observe(target, config); Problem is that, _3rd_party_callback callback cause DOM change, so it never stops. As its names says, It's third party function and I can't change (actually its DOM manipulating is its purpose). So what I do is to disconnect and start observer before and after the function is called in callback, respectively. observer.disconnect() _3rd_party_callback(); observer.observe(target, config); It seems to work, but I'm afraid, that thanks to asynchronous handeling of the event I might have observer disabled, when others changes are made and miss them. It's quite unlikely that there's a way to separate changes from page itself and the callback, but I'll give it a try.
tagged with: mutation-observers
has title: Mutation observer - DOM is changed by callback function
downvote count: 0

http://stackoverflow.com/comment/62722549
comment on: http://stackoverflow.com/a/25029461
score: 0
type: AnswerComment
has text: Note that you can additionally add default values and child elements of the component in QML, so that JavaScript does not have to add them itself.
type: Comment

http://stackoverflow.com/a/25007679
has comment: http://stackoverflow.com/comment/38885135
has comment: http://stackoverflow.com/comment/38885312
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38884862
has comment: http://stackoverflow.com/comment/38944267
has comment: http://stackoverflow.com/comment/38884988
upvote count: 1
has comment: http://stackoverflow.com/comment/38921061
has comment: http://stackoverflow.com/comment/38885194
has comment: http://stackoverflow.com/comment/38885390
has body: Is the html for the Ajax popup on the same page as the form? If so, add Results: to the popup where you want the result to go and add document.getElementById("CalcSumPopup").innerHTML = XmlHttp.responseText; after document.getElementById("CalcSum").innerHTML = XmlHttp.responseText; in Calc.js. If it is not on the same page this will not work. EDIT: This works because id's are meant to be unique. getElementById will find the first occurrence of the specified id and then stop, so if you want multiple places to be changed you need to give them unique id's.
type: Answer
answers question: http://stackoverflow.com/q/25007571

http://stackoverflow.com/comment/38891069
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25011015
has text: Should this `function(countryData){return countryData.code == code}` be `function(countryData){return countryData.code == countryCode}`
score: 0

http://stackoverflow.com/comment/38981898
has text: Maybe some kind of typeahead?
comment on: http://stackoverflow.com/a/25053462
score: 0
type: Comment
type: AnswerComment

http://stackoverflow.com/q/24944787
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24944854
type: Question
tagged with: javascript
has title: Files loaded using $scriptjs or any other asynchronously loader
score: 0
answer count: 1
has body: Say I have an AngularJS app which lazy loads controller files (via $scriptjs) and all dependencies when the user navigates to a route. The app contains 3 routes: A, B, C. If the user routes to A, then B and back to A, are the files for A loaded into memory twice or is the browser smart enough to cache the files and retrieve them?
tagged with: asynchronous
accepted answer: http://stackoverflow.com/a/24944854
tagged with: angularjs

http://stackoverflow.com/comment/38829585
score: 0
has text: @Mritunjay {"towns":[{"Tid":"2057277", "Tname":"York"},{"Tid":"2057575", "Tname":"Yanchep"}]}
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24978288

http://stackoverflow.com/a/25017523
score: 1
has comment: http://stackoverflow.com/comment/38905971
answers question: http://stackoverflow.com/q/25017369
downvote count: 0
has body: I don't think you should test only the template of directive, because directive is what is used in your code, not template by itself. However, I imagine you should do $http.get('my-table.html'), get the contents into variable and compile that. Edit: Here is some code: var template; beforeEach(inject(function($http, $httpBackend){ $http.get('my-table.html').then(function(data) { template = data; }); $httpBackend.flush(); })); it('Replaces the element with the appropriate content', function () { var element = $compile(template)($rootScope); $rootScope.$digest(); expect(element).toContain("some HTML..."); }); This is just an idea how it should work. Not sure if this actually works - haven't tested it, but this is how I would do it if I would need that.
type: Answer
has comment: http://stackoverflow.com/comment/38906885
upvote count: 1

http://stackoverflow.com/q/24930115
favorite count: 0
accepted answer: http://stackoverflow.com/a/25032471
tagged with: three.js
tagged with: animation
possible better answer: http://stackoverflow.com/a/25009358
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25009358
score: 1
upvote count: 1
type: Question
tagged with: blender
has answer: http://stackoverflow.com/a/25032471
has title: After loading a model exported from Blender in Three.js skeleton animations are damaged
has body: I have following problem: I have modelled a small ninja in blender and added a rig and a few animations to it. Now I want to load it in three.js and play the animations. BUT, when I load my model and play the animations, it looks like my rig is totally messed up. I have spent hours to search for an solution but I couldn't find a proper answer yet. After exporting several times with different export settings I made another test project where i simply animated a cube with 2 bones. When I loaded the test Cube, everything is correct so far. I setted up a demo for you with a skeleton helper, so you can see whats going on. I know this may seems to be more a blender problem but maybe I am doing something wrong in the code. Since I am more experienced in blender than three.js i think this is most likely the origin of the problem. demo: http://demo.martenzander.com/ Help is much appreciated! cheers! – marten
tagged with: javascript
answer count: 2
downvote count: 0

http://stackoverflow.com/comment/38889236
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25009960
type: Comment
has text: @user3770158 - I have no idea what you mean now. Post the code you are using to call `main.init`.

http://stackoverflow.com/comment/38983596
type: QuestionComment
comment on: http://stackoverflow.com/q/25058386
has text: @Barmar delegation is used in older version of jquery.
score: 0
type: Comment

http://stackoverflow.com/q/24948497
answer count: 2
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24948545
has body: OnClick I want a dialog button to pop up, the dialog is to have a uniqueId and have an iframe inside it. This is my code: $( ".insertDetailsDiv" ).click(function() { var idName = $(this).attr("id"); var idNameBase = idName.replace('DetailsButton', ''); var iframeSRC = idNameBase+".php"; $("&lt;div class='idNameDialogDivClass'&gt;&lt;/div&gt;").dialog(); $(".idNameDialogDivClass").each(function() { $(this).uniqueId(); var idNameDialogDiv = $(this).attr("id"); console.log(idNameDialogDiv); }); $("&lt;iframe&gt;&lt;/iframe&gt;", { id: idNameBase, src: iframeSRC }).appendTo('#'+idNameDialogDiv); }); However my console log (chrome) outputs ui-id-6 Uncaught ReferenceError: idNameDialogDiv is not defined I don-t understand, the console log outputs the variable and then javascript doesn-t recognise the variable.
has title: Undefined Variable that has already been printed on console log
has answer: http://stackoverflow.com/a/24948545
score: 0
has answer: http://stackoverflow.com/a/24948521
has comment: http://stackoverflow.com/comment/38774059
has comment: http://stackoverflow.com/comment/38774041
tagged with: each
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24948521

http://stackoverflow.com/comment/38757406
comment on: http://stackoverflow.com/q/24928143
score: 0
type: Comment
type: QuestionComment
has text: @JordyLangen thank you for your comment and link helped me. Would you please set it as an answer?

http://stackoverflow.com/q/24963935
tagged with: tablesorter
accepted answer: http://stackoverflow.com/a/24966290
has body: I want to override the ordering on tablesorter. Right now I have the following entries in my table that are dynamically added: 1 Active,34 Active, 453 Active, 3235 Active, inactive, inactive The issue is that there is another column that I want all the Active entries to be sorted by, and not by the number in front of it. Is it possible to do this with table sorter? if so how?
type: Question
has answer: http://stackoverflow.com/a/24964929
has title: Override table sorter order
tagged with: javascript
linked to: http://stackoverflow.com/q/12900059
possible better answer: http://stackoverflow.com/a/24964929
score: 0
answer count: 2
tagged with: jquery
has answer: http://stackoverflow.com/a/24966290
has comment: http://stackoverflow.com/comment/38803871
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38802881

http://stackoverflow.com/q/24998781
type: Question
has comment: http://stackoverflow.com/comment/38903441
has comment: http://stackoverflow.com/comment/38871305
has comment: http://stackoverflow.com/comment/38868855
has body: I'm having problems parsing information from a forum. Heres some examples: Easy Hard It would be really easy to get the information as they are displayed in the div where id = "poe-popup-container". The problem is that that div is only populated when the browser allows you to see the information. That can be easily reproduced by making your browser height really small and looking in the HTML code for the . However, the div will be empty, but as soon you scroll down to see the item it will change. I'm trying to read the nodes inside the with htmlagillitypack. The problem is that, as i explained, it only has information when the browser says that you need that information. So, when you try to download the html, the div is empty. I've tried to download the page with the web browser too, but the same thing happens. I'm trying to use the following code: string page = System.Text.Encoding.UTF8.GetString(Webclient.DownloadData("http://www.pathofexile.com/forum/view-thread/966384")); HtmlAgilityPack.HtmlDocument doc = new HtmlAgilityPack.HtmlDocument(); doc.LoadHtml(page); HtmlNode node = doc.DocumentNode.SelectSingleNode("//div[@id='poe-popup-container']"); MessageBox.Show(node.InnerHtml);
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38879157
favorite count: 0
has comment: http://stackoverflow.com/comment/39005854
has comment: http://stackoverflow.com/comment/38868543
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38878817
has comment: http://stackoverflow.com/comment/38872152
has comment: http://stackoverflow.com/comment/38871567
has title: reading div after javascript load
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38869196
has answer: http://stackoverflow.com/a/24999099
downvote count: 1
has comment: http://stackoverflow.com/comment/38868788
tagged with: c#
tagged with: javascript
score: -1

http://stackoverflow.com/a/25068266
has body: Thanks to @Oliver and @MatthewBlancarte for pointing me in the right direction. I ultimately swapped out the action helper for a view helper that wraps the code for the label. The whole diff is available on github. I only needed specific behavior on the label, not the whole li or on the input field that replaces the label. I was pleased to discover that a View does not need a template: I can just write one that adds the behavior I want and then put the markup in the existing template for the Todos. Here's what that looked like: - &lt;label {{action "editTodo" on="doubleClick"}}&gt;{{title}}&lt;/label&gt; + {{#view "Todos.TodoLabelView"}} + &lt;label tabindex="0"&gt;{{title}}&lt;/label&gt; {{/view}} Then I could add the keyPress behavior I wanted on my new TodoLabelView: Todos.TodoLabelView = Ember.View.extend({ keyPress: function(ev) { if (ev.keyCode === 13) { this.get("controller").send("editTodo"); } }, doubleClick: function() { this.get("controller").send("editTodo"); }, }); This preserves the edit-on-double-click behavior with a separate handler. Finally, I noticed that the [Enter] key press was being applied to the text field after it was rendered, which immediately closed the field and returned the label to the DOM. I tried returning false from my keyPress method as well as Event#stopPropagation. I even put the call to the controller's editTodo method on a timeout. No good. I had to remove the insert-newline="acceptChanges" from the custom edit-todo handler and take care of an [Enter] keypress in the EditTodoView: doubleClick: function() { this.get("controller").send("editTodo"); } I'd love to hear opinions on my solution, especially if there's a much easier way or if I overlooked something important.
type: Answer
answers question: http://stackoverflow.com/q/24943704
accepted answer of: http://stackoverflow.com/q/24943704
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/38740944
type: Comment
comment on: http://stackoverflow.com/a/24931132
score: 0
type: AnswerComment
has text: These are Chrome errors: Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:46316/~/Javascript/Javascript.js Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:46316/~/Javascript/jquery-2.1.1.js Uncaught TypeError: undefined is not a function

http://stackoverflow.com/comment/38900122
has text: thanks for your reply. This is not android app.. This is html5 website.we can not use intent here
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25015714
score: 0

http://stackoverflow.com/q/25023478
has answer: http://stackoverflow.com/a/25031345
type: UnansweredQuestion
upvote count: 3
type: Question
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/45414197
tagged with: ckeditor
answer count: 2
downvote count: 0
has title: How to Remove ContextMenu in CKEditor 4.3
favorite count: 0
has body: I am having a hard time trying to disable the context menu from the editor. For instance when a user clicks on a image I don't want to show that context menu but the browser context. I tried to add to remove plugins configuration setting "contextmenu" but that did nothing. From the posts I seen here the soultion to get rid of the context menu seems to change every version.

http://stackoverflow.com/comment/38835908
score: 0
has text: hey Json File now added, could you please guide , it would be very helpful
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24981811

http://stackoverflow.com/comment/38871429
score: 0
type: AnswerComment
has text: @ArtjomB. Finding the DOM element was the problem at hand. It's an exercise for the reader to then do other things. Sure, right now he wants to click a button. But maybe tomorrow he wants to change the CSS of the parent row. But go ahead, downvote away.
type: Comment
comment on: http://stackoverflow.com/a/25000673

http://stackoverflow.com/q/24980888
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/117040830
tagged with: jspdf
tagged with: http://stackoverflow.com/tag/html
has title: finding the height of text in jspdf
favorite count: 0
type: UnansweredQuestion
tagged with: pdf-generation
has body: Code: var doc = new jsPDF('p', 'mm', [300, 210]); doc.fromHTML(text, 15, 15, { 'width': 175, }); doc.text(10, HEIGHT, 'What should be height so it does not overlap with previous text'); Here is my code but two text are overlapping each other? Is there any method to know the value of HEIGHT(know where previous text is ending) such that two does not overlap? text html is not static it changes.
answer count: 0
has comment: http://stackoverflow.com/comment/105052382
type: Question
score: 5
upvote count: 5
downvote count: 0

http://stackoverflow.com/a/24943137
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24943009
has body: I think this is what you're looking for, but not sure. HTML: This is text Text will go here JavaScript: $('#paragraph').on('mouseenter', function() { var text = $(this).val(); $('#textInsert').text( text ); });

http://stackoverflow.com/comment/38920166
type: Comment
comment on: http://stackoverflow.com/q/25026091
score: 0
type: QuestionComment
has text: @soktinpk my mistake - updated (it's inside object)

http://stackoverflow.com/q/24982251
has body: Question : I have a table displaying information for university courses. There is a column on the left with a + sign next to each row. When this is pressed, I need to display data about all the students on the course (I have this data ready and waiting). However, how do I reveal this new row of data on the screen? And how would I collapse it again? Code : $(document).ready(function(){ $.ajax({ url: 'http://xx.xxx.xxx.xx/getCourses.php', dataType: 'jsonp', jsonpCallback: "courses", success: function( data ) { courseData = data; drawTable(data); } }); $("#dataTable").on('click', '.data-button',function(){ /* text change method */ $(this).text(function( _ , currText){ return currText === '+' ? '-' : '+'; }); /* class change */ $(this).toggleClass('active'); /* get data */ var id= $(this).data('id'); //Now reveal rows of students under this course. var studentData = courseData.courses[id]; //HOW DO I EXPAND THE EXTRA DATA ROWS ONTO THE TABLE?? }) }); function drawTable(data) { for (var i = 0; i < data.courses.length; i++) { drawRow(data.courses[i]); } } function drawRow(rowData) { var button=' + '; var row = $(" ") row.append(' '+button+' ');/* no need to wrap html in "$()" */ /* append other cells*/ row.append($(" " + rowData.id + " ")); row.append($(" " + rowData.start + " ")); row.append($(" " + rowData.end + " ")); row.append($(" " + rowData.lecturer + " ")); /* do append to DOM after row created , makes for less DOM insertions*/ $("#dataTable").append(row); } Course Start End Lecturer Example of The Desired Result :
answer count: 1
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24984289
type: Question
tagged with: html-table
has comment: http://stackoverflow.com/comment/38837907
has comment: http://stackoverflow.com/comment/38841086
tagged with: jsp
tagged with: javascript
tagged with: jquery
has title: How to expand new table data rows onscreen?
accepted answer: http://stackoverflow.com/a/24984289
score: 0

http://stackoverflow.com/comment/38910235
score: 0
has text: Ok I think we're getting close the URL source on the broken image is: %7B%7B%20url_for('static',%20filename='images/bubble4.png')%20%7D%7D Whereas the url on the image that I manually added is much nicer looking: /static/images/bubble4.png So it seems like something in the formatting is still off.
comment on: http://stackoverflow.com/a/25020466
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25047463
type: Question
has answer: http://stackoverflow.com/a/56746267
has answer: http://stackoverflow.com/a/34659744
tagged with: arrays
has title: Group By and Sum using Underscore/Lodash
tagged with: javascript
has body: I have JSON like this: [ { platformId: 1, payout: 15, numOfPeople: 4 }, { platformId: 1, payout: 12, numOfPeople: 3 }, { platformId: 2, payout: 6, numOfPeople: 5 }, { platformId: 2, payout: 10, numOfPeople: 1 }, ] And I want to Group it by platformId with sum of payout and numOfPeople. I.e. in result I want JSON like this: [ "1": { payout: 27, numOfPeople: 7 }, "2": { payout: 16, numOfPeople: 6 } ] I tried to use underscore.js's _.groupBy method, and it groups fine, but how I can get the SUM of objects properties values like I demonstrated above?
answer count: 6
has answer: http://stackoverflow.com/a/25074256
has answer: http://stackoverflow.com/a/36532172
upvote count: 24
tagged with: lodash
possible better answer: http://stackoverflow.com/a/45287338
favorite count: 0
has comment: http://stackoverflow.com/comment/38960223
has comment: http://stackoverflow.com/comment/38960157
has answer: http://stackoverflow.com/a/25047658
accepted answer: http://stackoverflow.com/a/25047658
type: AnsweredQuestion
tagged with: object
downvote count: 0
tagged with: underscore.js
score: 24
has answer: http://stackoverflow.com/a/45287338

http://stackoverflow.com/a/25001418
has body: The problem is that todos is object of objects while the function sort is for arrays, all you need to do is to convert your todos to an array and sort the array just like this var todos_array = []; for(key in model.todos) todos_array.push(model.todos[key]); then you can sort your array : todos_array = todos_array.sort(sortItem);
answers question: http://stackoverflow.com/q/25001263
score: 0
type: Answer

http://stackoverflow.com/q/24958009
score: 2
answer count: 0
upvote count: 2
type: Question
has body: New to Angular - Using $resource to query all records from a MongoDB model using mongoose. Does not execute callback. Explain how to set this up. Here's the controller code. MyService.recordCount.query( function(response){ console.log(response); // -----&gt; Does not execute $scope.count = response.length; }); Service code is: angular.module('myModule').factory('MyService', ['$resource', function($resource) { return { recordCount: $resource('/mymodule/recordCount'), }; } ]); Note: The DB call returns appropriate data, but controller code fails to call the callback in query(). Please explain why.
tagged with: mongodb
has comment: http://stackoverflow.com/comment/38812453
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39603650
has title: Callback is not fired on query() while using Angular $resource
tagged with: node.js

http://stackoverflow.com/a/24944854
type: Answer
has body: The browser will cache external javascript files. So yes if a user has loaded one of the scripts the browser should recognize that it is cached and not call it again. If you are using firefox you can see this happening using the firebug extension. In the Net tab of firebug you can see the javascript files that are being loaded for that page. Once they are cached you will see the name of the file in light grey. This means they are cached.
accepted answer of: http://stackoverflow.com/q/24944787
answers question: http://stackoverflow.com/q/24944787
score: 0
type: AcceptedAnswer

http://stackoverflow.com/a/24983971
has body: You don't want to wrap the location object in jQuery. Change: $(location).attr('href', url); To: window.location = url;
type: Answer
has comment: http://stackoverflow.com/comment/38840141
answers question: http://stackoverflow.com/q/24983904
score: 0
has comment: http://stackoverflow.com/comment/38840239
has comment: http://stackoverflow.com/comment/38840117

http://stackoverflow.com/q/25050782
has body: Please feel free to update the tittle to a more appropriate one. I was not sure how to word it. So I have developed a habit (not sure if it is good or bad) of doing the following when I need to write jQuery for a site. I only use this on quick and dirty jobs where a single file is needed with few dependencies and AMD, RequireJS, and CommonJS are overkill. It is based off of this article by Greg Franko. It keeps everything safe and non-conflicting and it does help with readability. Unfortunately though once I found it it became my go to template for all things jQuery, and I have never bothered to look into the performance impact of pitfalls of it. That being said I would like to get some feedback on any issues that may arise with this technique, and specifically if I should use it or another technique. When passed through JSLint I always get the following errors: 'a' was used before it was defined. $('#a').on('click', a); Unused 'a'. function a() { I know why the errors are there and what they mean, but I would like to have a passing JS file with my configuration options, and it works... /*jslint browser: false, couch: false, devel: false, node: false, rhino: false, passfail: false, ass: false, bitwise: false, closure: false, continue: false, debug: false, eqeq: false, evil: false, forin: false, newcap: false, nomen: false, plusplus: false, regexp: false, unparam: false, sloppy: false, stupid: false, sub: false, todo: false, vars: false, white: false, indent: 4 */ /*global window, document, location, jQuery*/ (function (appLoad) { "use strict"; appLoad(window.jQuery, window, document); }(function ($, window, document) { "use strict"; $(function () { // These are executed when the document is ready $('#a').on('click', a); $('#b').on('click', b); $('#c').on('click', c); }); // Logic that is not dependent on the document being ready is below here. // I typically place all my logic functions here for readability. function a() { ... } function b() { ... } function c() { .…
tagged with: iife
has title: Javascript Immediately-invoked function expression (IIFE) and function scoping
answer count: 1
favorite count: 0
upvote count: 2
has answer: http://stackoverflow.com/a/25050965
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38966530
has comment: http://stackoverflow.com/comment/39058755
downvote count: 1
type: Question
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25050965

http://stackoverflow.com/q/25021881
tagged with: google-maps-api-3
downvote count: 2
tagged with: google-maps
upvote count: 1
answer count: 1
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25027597
has comment: http://stackoverflow.com/comment/38912179
type: Question
has title: Google maps dynamic marker design
has body: Hello, is it possible to create such a customized marker on google maps. (See the image) There would be plenty of markers on the map, the image link would come from the database and I'd give a colour code for the arrow. Is it possible to create the coloured arrow from javascript code and use a link for the image in the middle? Thanks.
tagged with: javascript
score: -1

http://stackoverflow.com/comment/38832762
score: 1
type: AnswerComment
type: Comment
has text: angular is layered so if you have nested controllers being called one heigher holding on to a value or even passing such values to $rootScope would help ease on this sort of issue... also if employeeID was a session u could do a gsp call on page anytime for it.... <g:set var="lang" value="${session. https://github.com/vahidhedayati/testingarrested/blob/master/grails-app/assets/javascripts/custom-testingarrested/dashboardCtrl.js -- you could have a higher controller defined through out all your angular pages that initially does some get and stores rootScope.username as the value it got.....
comment on: http://stackoverflow.com/a/24944685

http://stackoverflow.com/q/25043029
type: Question
has title: Select2 inserts an empty text option in the dynamic list
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25165367
score: 0
answer count: 1
tagged with: x-editable
tagged with: jquery
tagged with: ui-select2
tagged with: jquery-select2
has body: I am using Select2 with Jquery-editable and encountering an abnormal behavior of Select2, what I am doing is displaying editable table of information using ejs template, and as user clicks on CBA opens up a select2 box which have the originally selected result, and then user can add or delete options in it, options comes from Database source, and when user selects an options it adds an empty option in database with the selected option , the array looks like this [ "ABCD", "ONAB", "" , "BCNU" ] I read somewhere about allowClear: true and add a placeHolder but It doesn't helped me at all. As everything is done dynamically I can't find where that empty option is added. Code is below: Ejs/HTML code for Select 2 Select CBA(s) Javascript for Select 2 $("a[data-name='Cba']").editable({ showbuttons: 'false', emptytext: 'None', display: function(values) { var html = []; html.push(values); $(this).html(html); }, select2: { multiple: true, allowClear: true, placeholder: "Select CBA(s)", ajax: { // url is copied from data-source via x-editable option-passing mechanism dataType: 'json', // pass the '?format=select2' parameter to API call for the select2-specific format data: function(term, page) { return { deptId: departmentId, format: 'select2' }; }, // transform returned results into the format used by select2 results: function(data, page) { return { results: data }; } }, // what is shown in the list formatResult: function(cba) { return cba.text; }, // what will appear in the selected tag box formatSelection: function(cba) { return cba.text; }, // rendering id of the values to data.value requirement for Select 2 id: function(cba) { return cba.value; }, // what is shown in the selected-tags box initSelection: function(element, callback) { var id = $(element).val(), result = id.replace(/^,\s*$/, ',').split(",").map(function(v) { return { id: v, text: v }; }); callback(result); } } }); Format in which Code is returned from the database:- Facility.findOne({ _id: department.Facilit…
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25165367

http://stackoverflow.com/comment/39291833
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25054906
has text: @DaveA, Fiddle examples started working again. It seems fiddle has some technical issue.

http://stackoverflow.com/a/24916117
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24915896
has body: I think , no need to concat the string or extract the object elements, all you need is to put this code on the button event onClick onclick='addGrpMember(c); return false;' if c is your javascript object

http://stackoverflow.com/a/25037133
score: 0
has comment: http://stackoverflow.com/comment/38941509
has comment: http://stackoverflow.com/comment/38941758
answers question: http://stackoverflow.com/q/25032896
has comment: http://stackoverflow.com/comment/38941643
type: Answer
has comment: http://stackoverflow.com/comment/38941321
has comment: http://stackoverflow.com/comment/38942396
has comment: http://stackoverflow.com/comment/38942238
has body: Basically it's not too wise to access ids that are generated by JSF like formId:namingContainerId:componentId because they can change if you reuse your components. It's much wiser to access them by css class. What you are doing though and what BalusC mentioned - You base your JavaScript(client side) code on a JSF XHTML(server side). JSF is a HTML generator, it generates HTML that is different in browser(when you analyze source code) than what you see in your text editor. I bet you have never seen a &lt;h:panelGroup&gt; tag in your browser. p:scrollPanel will simply generate a couple of &lt;div&gt; tags with some style. If you really want to access a JSF component by it's ID like formId:componentId then you would have to escape colons, otherwise jQuery thinks they are some css pseudo selectors. Here's a snippet. XHTML &lt;h:form id="formId"&gt; &lt;h:panelGroup id="componentId" style="display: none;" /&gt; &lt;h:panelGroup onclick="test('formId:componentId');" /&gt; &lt;/h:form&gt; Output &lt;form id="formId" ...&gt; &lt;span id="formId:componentId" style="display: none;" /&gt; &lt;span onclick="test('formId:componentId');" /&gt; &lt;/form&gt; JavaScript function test(id) { id = id.replace(/:/g, "\\:"); $("#" + id).show(); } or function test(id) { element = document.getElementById(id); $(element).show(); }

http://stackoverflow.com/a/24931325
type: AcceptedAnswer
downvote count: 0
has body: You can use: $('[title*="shell"]').closest('.cp').hide(); or $('[title*="shell"]').parents('.cp').hide()
type: Answer
accepted answer of: http://stackoverflow.com/q/24931273
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24931273

http://stackoverflow.com/a/24967187
has comment: http://stackoverflow.com/comment/38808794
upvote count: 1
has comment: http://stackoverflow.com/comment/38808850
answers question: http://stackoverflow.com/q/24967105
has body: You can use setInterval() and loop through to set the source for each iframe: var iframes = document.getElementsByTagName("iframe"); //retrieves a NodeList of iframes var i = 0; var interval = window.setInterval(function(){ if(i &lt; iframes.length){ iframes[i].src = "//example.com"; //source of the iframes i++; }else{ window.clearInterval(interval); } }, 3000); //interval to load each iframe in milliseconds Demo If you want to trigger it with a button click, just wrap it in a function and attach an event listener: document.getElementById("idOfButton").addEventListener("click", function(){ var iframes = document.getElementsByTagName("iframe"); //retrieves a NodeList of iframes var i = 0; var interval = window.setInterval(function(){ if(i &lt; iframes.length){ iframes[i].src = "//example.com"; //source of the iframes i++; }else{ window.clearInterval(interval); }, 3000); //interval to load each iframe in milliseconds }); Demo
downvote count: 0
score: 1
type: Answer

http://stackoverflow.com/comment/38830724
score: 0
type: Comment
has text: thanks a lot for your reply but it still did not solve my problem. Can you please have a look at this fiddle. It does not work http://jsfiddle.net/akhileshgandhi/E7xEb/
comment on: http://stackoverflow.com/a/24950345
type: AnswerComment

http://stackoverflow.com/q/25055753
score: 0
possible better answer: http://stackoverflow.com/a/25055821
has answer: http://stackoverflow.com/a/25055821
has body: I'd like to write something like this : object .method1("blah"); .method2("blah"); .method3("blah"); or object .method1("data1"); .method1("data2"); .method1("data3"); instead of: object.method1("data1"); object.method1("data2"); object.method1("data3"); Is it possible ? Thanks
accepted answer: http://stackoverflow.com/a/25055811
type: Question
type: AnsweredQuestion
has title: javascript multiple commands on the same object
has answer: http://stackoverflow.com/a/25055811
answer count: 2
tagged with: javascript
has comment: http://stackoverflow.com/comment/38975358

http://stackoverflow.com/a/24949848
type: Answer
accepted answer of: http://stackoverflow.com/q/24949847
has body: Seems IE 8 is unable to handle the custom directives. The code is running fine after removing the custom directive. IE documentation states that for custom element directives, we need to call document.createElement('custom-element').
answers question: http://stackoverflow.com/q/24949847
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer

http://stackoverflow.com/q/24949346
has answer: http://stackoverflow.com/a/24952212
accepted answer: http://stackoverflow.com/a/24952212
favorite count: 0
has answer: http://stackoverflow.com/a/24951818
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has comment: http://stackoverflow.com/comment/38775750
type: Question
possible better answer: http://stackoverflow.com/a/24951818
answer count: 2
has title: Google Analytics Dashboard AJAX Function Does Not get values
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has body: I have used the following function to pass certain data to an ASP.Net web service. function setJsonSer() { $.ajax({ url: "/APIWebService.asmx/AnalyticsDataShowWithPost", type: 'POST', data: { Email: 'clientlink@russell.com', Password: 'russell1234', URL: getVaria() }, success: function(data) { alert("success alert " + data); var sTitle = $(data).find('string').text(); alert("sTitle Alert " + sTitle); alert("The data string " + data); }, error: function(xhr, textStatus, errorThrown) { alert('error in simple method'); alert(textStatus); alert(errorThrown); } }); $.ajax({ url: "/APIWebService.asmx/GetMessage", type: 'POST', data: { Email: 'clientlink@russell.com', Password: 'russell1234', URL: getVaria() }, success: function(data) { alert(success); var sTitle = $(data).find('string').text(); alert(sTitle); alert(data); }, error: function(xhr, textStatus, errorThrown) { alert('error in simple method'); alert(textStatus); alert(errorThrown); } }); } I have alert the. data: { Email: 'clientlink@russell.com', Password: 'russell1234', URL: getVaria() }, However the alert is [object document]. I think that should the alert not be. So you guys have any ideas, opinions about this? Thanks &amp; regards, Chiranthaka
has comment: http://stackoverflow.com/comment/38775552

http://stackoverflow.com/a/24916673
answers question: http://stackoverflow.com/q/24916604
upvote count: 2
type: Answer
score: 2
has body: The problem is that you are trying to access the DOM element by ID using document.getElementById(conway) but conway is a class. So you either have to give the targeted div an ID or use document.getElementsByClassName('conway'); which will effectively get all of the element that have a class name conway. Not sure if that is what you want.
downvote count: 0

http://stackoverflow.com/q/24967668
possible better answer: http://stackoverflow.com/a/24967792
type: Question
accepted answer: http://stackoverflow.com/a/24967766
has title: jQuery UI-animated text box hops into the container div only after toggle effect is complete
tagged with: javascript
tagged with: jquery
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24967766
has answer: http://stackoverflow.com/a/24967792
has body: I have a container div, a one line-high div at the very top and a jQuery-hidden text box inside. There is a visible button on that bar. Clicking it should make the hidden text box slide into view, with the entire animation taking place on that thin header bar. Instead, it animates outside the bar and jumps into the bar once the animation is complete. Current JS: $(document).ready(function() { $('#userNameInput').hide(); $('#userNameInputButton').click(function() { $('#userNameInput').toggle('slide', {direction: 'right'}, 2000); }); }); Check this JSFiddle and you'll understand. I'm new to jQuery. How can I fix this?
type: AnsweredQuestion
tagged with: jquery-ui
has answer: http://stackoverflow.com/a/24967791

http://stackoverflow.com/comment/38735417
has text: can you edit your question with the code that you tried, it's easier for me to determine the error
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24927857

performance
tags question: http://stackoverflow.com/q/24981753
tags question: http://stackoverflow.com/q/24921768
tags question: http://stackoverflow.com/q/24965325
tags question: http://stackoverflow.com/q/24934283
tags question: http://stackoverflow.com/q/24979630
tags question: http://stackoverflow.com/q/24972767
tags question: http://stackoverflow.com/q/25023507
tags question: http://stackoverflow.com/q/25008193
tags question: http://stackoverflow.com/q/24963015
tags question: http://stackoverflow.com/q/24915428
tags question: http://stackoverflow.com/q/25008098
tags question: http://stackoverflow.com/q/25053093
tags question: http://stackoverflow.com/q/24987896
tags question: http://stackoverflow.com/q/25027678
tags question: http://stackoverflow.com/q/24972127
tag name: performance
tags question: http://stackoverflow.com/q/25041259
tags question: http://stackoverflow.com/q/24964448
tags question: http://stackoverflow.com/q/24930913
type: Tag
tags question: http://stackoverflow.com/q/25009508

http://stackoverflow.com/comment/38896384
type: Comment
comment on: http://stackoverflow.com/a/25013306
has text: @rob Schmuecker Ok, thanks. I've added a piece of text surrounded by tags. After this piece of text I added this code: Unfortunaly it's still not working. What am I doing wrong?
score: 0
type: AnswerComment

http://stackoverflow.com/a/25053520
type: Answer
answers question: http://stackoverflow.com/q/25053226
type: AcceptedAnswer
score: 0
accepted answer of: http://stackoverflow.com/q/25053226
has body: Make sure this is in your apache config: AddCharset utf-8 .js

http://stackoverflow.com/q/24986720
tagged with: angularjs
type: UnansweredQuestion
tagged with: search-engine
score: 3
has title: Raw AngularJs markup appearing in Google search results page
upvote count: 3
tagged with: caching
has answer: http://stackoverflow.com/a/24986772
type: Question
tagged with: search
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24987795
answer count: 2
has body: We just updated portions of our website with AngularJS - particularly the login page. When I look at the search results in Google, the cached page and the small snippet it displays automatically is the raw Angular markup. So, lots of {{model.username}}, {{model.errorMessage}}, etc. I won't link the results since it's too embarrassing. Any idea of how do get Google to actually store the page as rendered vs. the raw HTML?
favorite count: 0

http://stackoverflow.com/q/24951453
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a table. In a cell of the table there is a link like this: SOME_TEXT. When I click on this link should open a modal. Here's an example: Some HTML/PHP Code The modal must perform some operations that depend on the value of "data-id" attribute. To be precise, in the javascript code I need to read this value: $(document).ready(function ( ) { $('#remoteModal').on('show.bs.modal', function( event ) { console.log( /* How do I read the value of data-id? */ ); }); }); I do not know how to read the value of this attribute in the javascript code of the modal. Many thanks for your interest.
answer count: 3
has title: How to pass a parameter from a link element to a modal window?
has answer: http://stackoverflow.com/a/24951996
favorite count: 0
has answer: http://stackoverflow.com/a/24962060
tagged with: twitter-bootstrap
tagged with: parameter-passing
type: AnsweredQuestion
score: 3
possible better answer: http://stackoverflow.com/a/24951927
upvote count: 3
has answer: http://stackoverflow.com/a/24951927
accepted answer: http://stackoverflow.com/a/24962060
type: Question
tagged with: modal-dialog

http://stackoverflow.com/comment/38783610
type: Comment
has text: the whole form including the script itself is replaced when the submit button pressed, but the same button reloaded again, do i have to re attach the event again
type: AnswerComment
comment on: http://stackoverflow.com/a/24953985
score: 0

http://stackoverflow.com/comment/38788185
type: Comment
comment on: http://stackoverflow.com/a/24956138
has text: Hi @Dart thank you so much for the code if you see when we enter some value it start filling from back side (Look) but What I want it has to start from front side filling
score: 0
type: AnswerComment

http://stackoverflow.com/q/24979316
has answer: http://stackoverflow.com/a/24979573
has title: Embedded style overriding inline styles?
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38831777
has comment: http://stackoverflow.com/comment/38831602
has answer: http://stackoverflow.com/a/24979414
accepted answer: http://stackoverflow.com/a/24979573
has comment: http://stackoverflow.com/comment/38831328
answer count: 2
possible better answer: http://stackoverflow.com/a/24979414
downvote count: 0
tagged with: javascript
score: 1
has comment: http://stackoverflow.com/comment/38831643
favorite count: 0
tagged with: inline
tagged with: http://stackoverflow.com/tag/html
has body: So I have a button with embedded style and a function that changes the button's style via inline style to display:none. Problem is the embedded style seems to be overriding the inline style. So, the questions are: Aren't inline styles supposed to take precedence over embedded? Is there something wrong with my code?? If there isn't anything wrong with my code: How do I get my inline code to override the embedded style? HTML Change units Change units Change units Type: Instrumental Cables Erected Piping Materials Electric Cables JS function jsfunction(){ //Get from user which chart to display var val = document.getElementById("typeSelector"); if(val.value==1){ document.getElementById("btn1").style.display="block"; document.getElementById("btn2").style.display="none"; document.getElementById("btn3").style.display="none"; } else if(val.value==2){ document.getElementById("btn1").style.display="none"; document.getElementById("btn2").style.display="block"; document.getElementById("btn3").style.display="none"; } else{ document.getElementById("btn1").style.display="none"; document.getElementById("btn2").style.display="none"; document.getElementById("btn3").style.display="block"; } } JSfiddle to demonstrate the problem: http://jsfiddle.net/4T4pb/1/ Edit: It appears there was a problem with my demo code so I affixed the actual code
has comment: http://stackoverflow.com/comment/38831452
upvote count: 1

http://stackoverflow.com/a/24971538
has comment: http://stackoverflow.com/comment/38817716
answers question: http://stackoverflow.com/q/24971518
has comment: http://stackoverflow.com/comment/39024235
type: Answer
has comment: http://stackoverflow.com/comment/38847549
score: 2
has comment: http://stackoverflow.com/comment/38837023
has comment: http://stackoverflow.com/comment/39001388
downvote count: 0
has body: json_encode — Returns the JSON representation of a value json_encode($arr); Sample : while($record = $result-&gt;fetchAssoc()) { if (isset($arr[$record["country"]])) { $arr[$record["country"]]++; } else { $arr[$record["country"]] = 0; } } json_encode($arr); In javascript : JSON.parse(data); console.log(data.de); //2
upvote count: 2

http://stackoverflow.com/q/25024466
has answer: http://stackoverflow.com/a/25087211
answer count: 1
has comment: http://stackoverflow.com/comment/38918418
favorite count: 0
tagged with: openlayers
has comment: http://stackoverflow.com/comment/38919941
has comment: http://stackoverflow.com/comment/38916995
has comment: http://stackoverflow.com/comment/38917761
downvote count: 2
has comment: http://stackoverflow.com/comment/38921012
linked to: http://stackoverflow.com/q/21005356
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
type: Question
upvote count: 0
score: -2
has title: javascript/jQuery getJSON very slow with a inner loop
accepted answer: http://stackoverflow.com/a/25087211
has comment: http://stackoverflow.com/comment/38926629
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38917205
tagged with: get
has comment: http://stackoverflow.com/comment/38919812
has body: I'm using OpenLayers to render DOM for layerswitcher, with about 1200 divs. The problem can be simplified as follows. This is very fast (3 seconds or so): var allLayers = [layerMapnik, layerCycleMap]; for(var ii = 0; ii &lt; 1200; ++ii) { console.log("ii = " + ii.toString()); var groupName = "wms/Transit/railroad/image/" + ii; var layName = "CycleMap" + ii.toString(); var oneLayer = new OpenLayers.Layer.XYZ(layName, "http://whatever/tile/${z}/${y}/${x}", {visibility: false, group:groupName}); allLayers.push(oneLayer); } console.log("adding layers"); map.addLayers(allLayers); $.getJSON("sampleArray.json", {}, function( doc ) { console.log(doc.length); }); But once the for-loop is put inside the getJson callback, it's painfully slow and freezes the browser, even when the for-loop is not reading the 'doc' at all! var allLayers = [layerMapnik, layerCycleMap]; $.getJSON("sampleArray.json", {}, function( doc ) { console.log(doc.length); for(var ii = 0; ii &lt; 1200; ++ii) { console.log("ii = " + ii.toString()); var groupName = "wms/Transit/railroad/image/" + ii; var layName = "CycleMap" + ii.toString(); var oneLayer = new OpenLayers.Layer.XYZ(layName, "http://whatever/tile/${z}/${y}/${x}", {visibility: false, group:groupName}); allLayers.push(oneLayer); } console.log("adding layers"); map.addLayers(allLayers); }); No matter how simple the json file is sampleArray.json: [ { "a": 123, "b": 456 }, { "c": "ccc", "d": "ddd" } ] Did I use the getJSON or callback wrong? Or it is an OpenLayer thing? I also tried $.each instead of for-loop, no help.

http://stackoverflow.com/comment/38946864
score: 0
has text: Right. I was able to solve this by splitting out various interface definitions to a separate *.d.ts file, and adding a Typescript reference to that file. Thanks again for your quick answer.
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25039056

http://stackoverflow.com/comment/38951357
score: 0
type: Comment
has text: I know how to do this. I'm trying not to have to copy the post part of the code over so that if changes are made to addrowsfunction, I dont have to manage it in two places
comment on: http://stackoverflow.com/a/25043004
type: AnswerComment

http://stackoverflow.com/a/24991964
has comment: http://stackoverflow.com/comment/38855110
answers question: http://stackoverflow.com/q/24991833
has comment: http://stackoverflow.com/comment/38855046
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38855247
has comment: http://stackoverflow.com/comment/38855274
has comment: http://stackoverflow.com/comment/38855404
has comment: http://stackoverflow.com/comment/38855183
has body: Add following code to your edit.php &lt;script&gt; window.onunload = refreshParent; function refreshParent() { window.opener.location.reload(); } &lt;/script&gt;

http://stackoverflow.com/a/25039002
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25038094
has body: Created a simple JSFIDDLE for you with the following code: var sel = $('#siteChangeSelect'); var siteList = []; siteList.push({ customerReference : "Test1", customerSite : "Test1"}); siteList.push({ customerReference : "Test2", customerSite : "Test2"}); siteList.push({ customerReference : "Test3", customerSite : "Test3"}); siteList.push({ customerReference : "Test4", customerSite : "Test4"}); siteList.push({ customerReference : "Test5", customerSite : "Test5"}); siteList.push({ customerReference : "Test6", customerSite : "Test6"}); $.each(siteList, function(i, item){ sel.append(' ' + siteList[i].customerSite + ' '); }); //Adds to the bottom $(sel).append(' New Value Bottom '); //Adds to the top $(sel).prepend(' New Value Top ');

http://stackoverflow.com/a/25027532
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25027488
type: Answer
has body: You're testing for .hasClass('glasscase') on &lt;body&gt;, not on the &lt;ul&gt; that it's actually on. Try //Check if the gallery is in place just insert the &lt;li&gt; element. if (nestedFrame.find("ul.glasscase").length &gt; 0) { ... }
score: 1
upvote count: 1
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25027488

concurrency
tag name: concurrency
tags question: http://stackoverflow.com/q/24924136
type: Tag

http://stackoverflow.com/comment/38701327
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24910341
has text: What is being typed in the `ons-text-input` bound to `medName`?
score: 0

http://stackoverflow.com/a/24955985
type: AcceptedAnswer
downvote count: 0
score: 4
has body: PHP, by default, declares that its output is HTML. Consequently, you are processing data as a string of (invalid) HTML. Add: header("Content-Type: application/json"); Also remove contentType: "json", from the JavaScript. That is not a valid content-type, and you aren't encoding the data you are POSTing as JSON.
type: Answer
accepted answer of: http://stackoverflow.com/q/24955965
answers question: http://stackoverflow.com/q/24955965
upvote count: 4

http://stackoverflow.com/a/24916159
score: 3
downvote count: 0
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24916114
answers question: http://stackoverflow.com/q/24916114
type: Answer
has body: Add something like this to the top of your CSS file or &lt;style&gt; tag: * { margin: 0; padding: 0; } You can then set paddings and margins later on.

http://stackoverflow.com/comment/38834221
score: 0
type: Comment
type: QuestionComment
has text: Thanks tpdietz bt not work
comment on: http://stackoverflow.com/q/24980919

http://stackoverflow.com/comment/38989274
comment on: http://stackoverflow.com/a/25062963
has text: Yeah, I noticed after responding, so I edited my answer to provide more instructions for generating xml. ;)
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/25038401
has comment: http://stackoverflow.com/comment/38943101
downvote count: 0
has comment: http://stackoverflow.com/comment/38942847
has comment: http://stackoverflow.com/comment/38942971
type: Answer
score: 1
answers question: http://stackoverflow.com/q/25038193
upvote count: 1
has body: You can use jQuery .first() and .eq() to select them. var selects = $('#mans select'); selects.first().on('change', function () { selects.eq(1).append(' New Option '); }); DEMO
has comment: http://stackoverflow.com/comment/38942686

http://stackoverflow.com/q/24919292
accepted answer: http://stackoverflow.com/a/24919687
type: Question
answer count: 2
tagged with: arrays
tagged with: javascript
has title: Add different value to the same object literal javascript
has comment: http://stackoverflow.com/comment/38719178
has comment: http://stackoverflow.com/comment/38719297
score: 0
tagged with: object-literal
has body: I have a piece of code to create an object literal array. The array is created from 2 other string array, one will become the object literal colHeads and the other array will be the data dataArr. colHeads = [name, state] dataArr = [John A. Smith,Joan B. Jones] var temp = []; var tempObj = {}; for (var i=0; i&lt;colHeads.length; ++i) { // columns var dataArr = colDatas[i].split(","); for (var j = 0; j &lt; dataArr.length; j++) { // data tempObj[colHeads[i]] = dataArr[j]; } temp.push(tempObj); } The final array should look like this: var data = [ {name: 'John A. Smith', state: 'CA'}, {name: 'Joan B. Jones', state: 'NY'} ]; Problem here is according to this line tempObj[colHeads[i]] = dataArr[0]; The object literal would be replaced with the last entry in both arrays which make the result look like this: var data = [ {name: 'Joan B. Jones', state: 'NY'}, {name: 'Joan B. Jones', state: 'NY'} ]; I'm new to javascript so I don't know much the syntax
has answer: http://stackoverflow.com/a/24919687
possible better answer: http://stackoverflow.com/a/24919660
has answer: http://stackoverflow.com/a/24919660
type: AnsweredQuestion

http://stackoverflow.com/q/24966005
possible better answer: http://stackoverflow.com/a/25096771
type: AnsweredQuestion
type: Question
tagged with: polymer
has title: Polymer change core-toolbar from tall to normal
has answer: http://stackoverflow.com/a/25096771
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24992190
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24992190
has body: I'm using Polymer to redesign my website. I'm having some trouble implementing the core-scroll-header-panel in combination with the core-toolbar. My problem is the following: I have a core-drawer-panel on the left that holds a menu throughout my site. On the right side I hav the core-scroll-header-panel. Now, on some pages (selected in the core-drawer-panel) I want to show a tall header, and on others a small one. So I need a way to toggle the tall-attribute of the core-toolbar. To do this I used Polymer's data-binding to just change the class of the core-toolbar. Unfortunately this doesn't work adequate, as the content in the sidebar is off-position after changing the class. To clarify: if you load the site as a tall core-toolbar, the content displayed on the right is all offset a little to the bottom. When changing the class to something else than tall, this offset remains. Vice versa the same, you can see a working example here: http://jsbin.com/vepoyami/2/edit . In the sample code you can change the if(this.page == "tall"){ to small instead of tall to see the effect if it was the other way around. Here's the code: <core-drawer-panel id="drawerPanel"> Main Title <core-scroll-header-panel main condenses="true" id="headerPanel" keepCondensedHeader> Nothing yet! {{pageItem.label}} The header should be a small one that stays there. The header should be a tall one that scrolls down into a small one and stays there. </core-scroll-drawer-panel> Presumably this way of toggling it's state is not a good way. On top of the issue I have said, when it is in it's small state, the color isn't filled in. What have I done wrong here, and how should it be done instead? Update: I submitted a bug on github. A collaborator replied that there were still issues with the core-scroll-header-panel that some styles weren't reset, and that they are working on a fix hopefully by next release. The collaborator also added that .measureHeaderHeight() can be called to reevaluate the height of th…

http://stackoverflow.com/comment/38744426
type: Comment
has text: What are you trying to do with the opacity?
comment on: http://stackoverflow.com/q/24933118
score: 0
type: QuestionComment

http://stackoverflow.com/a/25053027
has comment: http://stackoverflow.com/comment/38970308
has comment: http://stackoverflow.com/comment/65456825
has comment: http://stackoverflow.com/comment/65595361
type: Answer
accepted answer of: http://stackoverflow.com/q/25052758
answers question: http://stackoverflow.com/q/25052758
has comment: http://stackoverflow.com/comment/102408511
has body: node.js uses V8, although I guess it's not the same as the current version in Chrome, but I guess it's a good indicator of node's performances on the subject. Secondarily, you're using forEach, which is quite handy when developing but adds a callback for every iteration, and that's a (relatively) lenghty task. So, if you're interested in performances, why don't you just use a normal for loop? for (var i = 0, keys = Object.keys(object); i &lt; keys.length; i++) { // ... } This yields the best performances you can get, solving your speed problems in Safari too. In short: it's not the conditional, it's the call to hasOwnProperty that makes a difference. You're doing a function call at every iteration, so that's why for...in becomes slower.
has comment: http://stackoverflow.com/comment/102373409
downvote count: 1
score: 46
has comment: http://stackoverflow.com/comment/38970602
has comment: http://stackoverflow.com/comment/65610999
has comment: http://stackoverflow.com/comment/70652100
has comment: http://stackoverflow.com/comment/65425043
upvote count: 47
has comment: http://stackoverflow.com/comment/70658548
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/65439279

http://stackoverflow.com/comment/38953603
score: 0
has text: @KevinB Is there any way I can check whether or not this was the case (error header)?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25043909

http://stackoverflow.com/a/44125301
upvote count: 9
type: Answer
answers question: http://stackoverflow.com/q/24978057
score: 9
has body: This will solve the issue Javascript: new Chart(ctx).Line(data, { responsive:true, maintainAspectRatio: false }); ES6 Chart.defaults.global.responsive = true; Chart.defaults.global.maintainAspectRatio = false;
downvote count: 0

http://stackoverflow.com/a/24977348
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24964455
type: Answer
has body: While Krzysztof's suggestion was helpful, I couldn't quite get the binding to work with ng-list because the ng-list will always convert the array of objects into an array of strings, thus overriding any objects I had on scope. In this case, the simplest thing to do was to upgrade from ng-list to something with full object support like most tagging libraries: ngTagsInput angular-tags bootstrap-tagsinput I Implemented ngTagsInput like this: HTML: JavaScript: $scope.arrayObjects = [ { "text": "one" , "selected": false }, { "text": "two" , "selected": false }, { "text": "three" , "selected": false } ]; This way each object is given it's own element where the text property is displayed and they are all formatted together to live inside of an input. Changing one object just updates that single element Demo in Pluner
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24964455
type: AcceptedAnswer

http://stackoverflow.com/a/24967021
answers question: http://stackoverflow.com/q/24966276
score: 0
has body: Maybe this jQuery code could help you. I use this code to separate nav bar from content or vice versa. $(window).resize(function () { $('content').css('margin-top', parseInt($('#main-navbar').css("height"))+10); }); $(window).load(function () { $('content').css('margin-top', parseInt($('#main-navbar').css("height"))+10); });
type: Answer

http://stackoverflow.com/comment/38984244
type: Comment
comment on: http://stackoverflow.com/q/24997992
type: QuestionComment
has text: http://stackoverflow.com/questions/24951141/uploadify-in-chrome-return-aw-snap-page
score: 0

http://stackoverflow.com/a/25042600
upvote count: 1
has comment: http://stackoverflow.com/comment/38950801
has comment: http://stackoverflow.com/comment/38951087
type: AcceptedAnswer
downvote count: 0
score: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/25042498
answers question: http://stackoverflow.com/q/25042498
has body: REgex: (<\/span> )(span) REplacement string: $1$2 DEMO > 'test1 test2 test3 span test4'.replace(/(<\/span> )(span)/g, "$1$2") 'test1 test2 test3 span test4'

http://stackoverflow.com/comment/38706577
comment on: http://stackoverflow.com/a/24912127
type: AnswerComment
type: Comment
has text: @mles Geeez. But because I'm being nice `var short = my.really.super.long.ridiculous.functionname.with.sugar;` Welcome to JavaScript. Just objects.
score: 1

http://stackoverflow.com/a/25044121
type: Answer
has body: Essentially, you would need to update the hash route when the observable changes and have Sammy respond to the route. Add something like this to your viewmodel: selectedAddressBook.subscribe(function(newValue){ // validate newValue // update the hash with the newValue window.location.hash = "#addressBook/" + newValue; });
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25017283
score: 1
answers question: http://stackoverflow.com/q/25017283
has comment: http://stackoverflow.com/comment/38989540
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38954897
type: QuestionComment
comment on: http://stackoverflow.com/q/25044754
has text: @tymeJV Can you show me how?
score: 1
type: Comment

http://stackoverflow.com/q/24968675
favorite count: 0
has comment: http://stackoverflow.com/comment/38811421
type: AnsweredQuestion
upvote count: 1
downvote count: 1
has answer: http://stackoverflow.com/a/24968725
accepted answer: http://stackoverflow.com/a/24968725
type: Question
has body: I just want to display the reviews on the dialog box but it doesn't work. Please help me. I am trying to do this for a week. Here is the data which should be displayed: {"results":[{"review_text":"good"},{"review_text":"not bad"},{"review_text":"great"}]} here is my view code: &lt;div id="see_all_reviews"&gt; &lt;div id="load_reviews"&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php $data = array( 'name' =&gt; $places_id, 'class' =&gt; 'all_reviews', 'content' =&gt; 'Reviews' ); echo form_button($data); ?&gt; here is my js file: $(".all_reviews").click(function() { var self = this; var places_id_all_reviews = $(self).attr("name"); $.post('filter/get_reviews', { id: id }, function(data) { var reviews_text = data.results[0].review_text; $("#load_reviews").text(reviews_text); }); }, "json").error(function() { $("#load_reviews").text(data.message); }); $("#see_all_reviews").dialog({ autoOpen: false, title: "Reviews", modal: true, draggable: false, width: 600, height: 600, close: function() { $(this).dialog('destroy'); } }); });
tagged with: jquery-ui
score: 0
has title: cannot display reviews in jquery window
answer count: 1
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/25005335
has answer: http://stackoverflow.com/a/25006245
linked to: http://stackoverflow.com/q/2820453
has answer: http://stackoverflow.com/a/25005624
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38880519
has answer: http://stackoverflow.com/a/25005419
has comment: http://stackoverflow.com/comment/38880618
type: Question
has body: On Stack overflow you can use ctrl k to make HTML look like HTML and not the output of it. So something like Hello world Instead of Hello World I inspected the web page and it comes out like this Hello world I am working on a project where I want to do something similar. I'm assuming it uses some some javascript function to perform this but I'm not really sure, anyone know how this works?
answer count: 6
has comment: http://stackoverflow.com/comment/38880529
has comment: http://stackoverflow.com/comment/38880550
has answer: http://stackoverflow.com/a/25005499
score: 0
linked to: http://stackoverflow.com/q/18749591
has answer: http://stackoverflow.com/a/25005395
has comment: http://stackoverflow.com/comment/38880538
tagged with: javascript
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25005406
has title: Getting HTML to look like HTML on a web page

http://stackoverflow.com/comment/38864484
type: Comment
has text: Actually, if you look at [the source](https://github.com/jamiebikies/ember-pusher/blob/master/lib/ember-pusher/initializer.js), you'll see that it get's registered under `pusher:main`. So all you have to do is set up an initializer like he did, then call `application.inject('adapter', 'pusher', 'pusher:main')`.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24995686

http://stackoverflow.com/q/25021331
has answer: http://stackoverflow.com/a/30762428
has comment: http://stackoverflow.com/comment/38910731
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25021423
upvote count: 1
downvote count: 1
type: AnsweredQuestion
has title: responsive image mapping with coordinates
has comment: http://stackoverflow.com/comment/38911141
has body: I am trying to understand how this plugin works :http://mattstow.com/experiment/responsive-image-maps/rwd-image-maps.html The goal is to have responsive image maping but what I dont understand is how to come up with the coords. See below how there are a bunch of numbers, how do I calculate my own coords for my image, can some one explain what is going on with this demo and how it is to be used? &lt;map name="powerpuffgirls"&gt; &lt;area shape="poly" coords="122,36,281,36,285,37,287,39,289,42,289,47,289,48,278,77,276,81,274,84,271,85,218,85,218,90,210,90,208,95,207,99,204,100,72,100,26,87,23,84,20,81,19,76,35,40,37,38,43,35,62,35,65,30,68,26,72,25,115,25,119,27,121,30,122,36,122,36" href="#ppg" title="The Powerpuff Girls" alt="The Powerpuff Girls" /&gt; &lt;area shape="poly" coords="864,668,912,650,922,668,971,667,973,718,981,722,985,729,988,731,1010,731,1010,742,833,742,833,730,865,730,865,721,874,721,874,718,864,668,864,668" href="#cn" title="Cartoon Network" alt="Cartoon Network" /&gt; &lt;area shape="poly" coords="1010,298,995,281,979,267,962,256,944,248,927,242,909,238,876,236,857,237,838,240,817,246,797,255,778,266,761,281,746,299,735,322,730,335,728,346,726,348,721,349,709,344,711,361,718,378,708,380,697,388,688,398,685,404,685,411,686,419,691,425,698,429,707,431,735,426,743,427,752,433,762,444,774,454,798,469,787,483,779,481,772,482,761,486,753,495,747,505,746,516,746,521,748,527,751,532,759,538,741,561,734,572,732,584,733,591,737,599,744,604,754,607,765,604,776,597,797,570,817,543,857,488,865,488,893,488,910,485,924,483,930,483,935,485,939,490,934,496,931,501,929,506,932,514,938,519,945,522,954,523,966,521,979,516,985,512,989,507,993,500,994,493,991,484,986,476,967,464,982,454,998,440,1013,425,1024,409,1024,329,1017,312,1010,298,1010,298" href="#buttercup" title="Buttercup" alt="Buttercup" /&gt; &lt;area shape="poly" coords="571,101,563,83,562,66,549,80,541,96,537,112,536,128,537,141,531,141,508,141,508,141,511,133,517,126,533,114,500,111,476,111,452,114,438…
type: Question
has answer: http://stackoverflow.com/a/25021423
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery
favorite count: 0
possible better answer: http://stackoverflow.com/a/30762428

http://stackoverflow.com/q/24954765
has comment: http://stackoverflow.com/comment/38785125
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24955150
answer count: 2
has comment: http://stackoverflow.com/comment/38785357
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: ajax
has title: JSONP Ajax Syntax
favorite count: 0
type: UnansweredQuestion
has body: I am trying to alert the visitor of my webpage with a country code provided by a JSONP endpoint. However, I cannot seem to get this working! And all the answers on the web seem confusing! The following is returned from the endpoint: { "pcCartCt": 0, "pcCountryCode": "au", "pcCountrySite": "WWW", "pcExpDomCt": 0, "pcFirstName": "", "pcIsCdc": false, "pcIsDiscount": false, "pcIsGdEmployee": false, "pcIsTrusted": false, "pcLanguageCookie": "en-us", "pcModalData": "", "pcRepEmail": "", "pcRepExt": "", "pcRepName": "", "pcSelectedCurrFullDesc": "United States Dollar $ (Transactional)", "pcSelectedCurrType": "USD", "pcSetLanguageLogo": true, "pcShopperId": "" } For it to work, I first need to specify a prog_id of "myprogid" and a callback function. In the callback, I need an alert message containing pcCountryCode. How do I do this?
has answer: http://stackoverflow.com/a/24954947
has comment: http://stackoverflow.com/comment/38785160
has comment: http://stackoverflow.com/comment/38785022
score: 1

http://stackoverflow.com/q/24985778
type: Question
has comment: http://stackoverflow.com/comment/38844068
has comment: http://stackoverflow.com/comment/38844252
answer count: 2
has body: I'm working on the Angular Phonecat tutorial, and incorporating some of the suggestions in Opinionated AngularJS Styleguide However, I'm having a hard time understanding why a specific Karma test is failing. My application code is: function routeProvider(provider){ ... } function phoneListCtrl(scope, http){ ... } function phoneDetailCtrl(scope, http, routeParams){ http.get("/phones/" + routeParams.phoneId + ".json").success(function(data){ scope.phone = data; }); } angular.module("phonecatApp", ["ngRoute"]) .controller('PhoneListCtrl', ["$scope", "$http", function($scope, $http){ phoneListCtrl($scope, $http); }]) .controller('PhoneDetailCtrl', ['$scope', '$routeParams', '$http', function($scope, $routeParams, $http){ phoneDetailCtrl($scope, $http, $routeParams); }]) .config(['$routeProvider',function($routeProvider) { routeProvider($routeProvider); }]); This application code works in the browser, where both phone list and phone detail views show as expected. No errors are reported in the console. However, this test for PhoneDetailCtrl fails due to PhoneCat Controllers PhoneDetailCtrl should fetch phone detail FAILED Error: [$injector:unpr] Unknown provider: $routeParamsProvider &lt;- $routeParams describe("PhoneDetailCtrl", function(){ var scope, $httpBackend, ctrl; beforeEach(inject(function(_$httpBackend_, $rootScope, $routeParams, $controller){ $httpBackend = _$httpBackend_; $httpBackend.expectGET("phones/xyz.json").respond({name : "phone xyz"}); $routeParams.phoneId = "xyz"; scope = $rootScope.$new(); ctrl = $controller("PhoneDetailCtrl", {$scope : scope}); })); it("should fetch phone detail", function(){ expect(scope.phone).toBeUndefined(); $httpBackend.flush(); expect(scope.phone).toEqual({name : "phone xyz"}); }); }); Specifically, the beforeEach(inject(function( ... ) { ... })); is throwing the error prior before going to code in angular-mocks.js. Why is the test code failing only after reorganizing the application code, yet still works in the browser? This …
tagged with: javascript
score: 0
tagged with: angularjs
favorite count: 0
has comment: http://stackoverflow.com/comment/38844682
tagged with: karma-runner
has answer: http://stackoverflow.com/a/24986155
has answer: http://stackoverflow.com/a/25256901
type: UnansweredQuestion
has title: Angular and Karma - Why does this test fail?
upvote count: 1
has comment: http://stackoverflow.com/comment/38844652
downvote count: 1
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/38844546

http://stackoverflow.com/a/24992127
has comment: http://stackoverflow.com/comment/38855591
score: 1
has body: You then function to handle the success and failure of the promise: factory.getUpdates() .then(function(value) { // handle success }, function(reason) { // handle failure });
upvote count: 1
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/24992036

http://stackoverflow.com/comment/38957904
type: Comment
has text: @ath20 please include the hover css also
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25046134

http://stackoverflow.com/a/24932524
score: 1
has comment: http://stackoverflow.com/comment/38743122
upvote count: 1
answers question: http://stackoverflow.com/q/24932325
has body: try this $(document).ready(function() { var texts = []; $("table tr td").each(function(i, elem) { texts.push($.trim($(elem).text())) }); var str = texts.join(':').replace(/(\r\n|\n|\r)/gm, "") alert(str); }); see working example:- http://jsfiddle.net/fL28r/84/ thansks
type: Answer
downvote count: 0

http://stackoverflow.com/q/24954804
accepted answer: http://stackoverflow.com/a/24955033
tagged with: twitter-bootstrap
type: AnsweredQuestion
tagged with: contextmenu
score: 1
has answer: http://stackoverflow.com/a/24955029
upvote count: 1
has body: In below context menu example .. how to get value of fist column that invoked it? Refer Link tried with $(this).find('td:first').text() but it didnt work. How to do this?
has title: How to get first column value of invoked row in table?
type: Question
has answer: http://stackoverflow.com/a/24955098
possible better answer: http://stackoverflow.com/a/24955029
has answer: http://stackoverflow.com/a/24955033
downvote count: 0
tagged with: javascript
answer count: 3
favorite count: 0

http://stackoverflow.com/comment/38772950
score: 1
has text: Can you narrow it down for us a bit? What does it do instead of what you want it to do?
comment on: http://stackoverflow.com/q/24947946
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25036227
has answer: http://stackoverflow.com/a/25036268
tagged with: javascript
has body: I came across a JS Function in Effective Javascript book by David Herman. I have copied the code below. I just want to know how Updated Value of "i" is accissible in hasNext function, when "i" is incremented only in next function. Javascript function values() { var i = 0, n = arguments.length; a = arguments; return { hasNext: function() { alert(i); return i &lt; n; }, next: function() { if (i &gt;= n) { throw new Error("end of iteration"); } return a[i++]; } }; } var it = values(1, 4, 1, 4, 2); JsFiddle: http://jsfiddle.net/G42Ev/
score: 0
has title: Enquiry on Javascript Closure
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25036264
type: Question
answer count: 2

http://stackoverflow.com/comment/39023889
comment on: http://stackoverflow.com/a/25077556
type: Comment
score: 0
type: AnswerComment
has text: You can add callback by Highcharts api, avoding core modification. http://www.highcharts.com/docs/extending-highcharts/extending-highcharts

http://stackoverflow.com/comment/38814526
has text: Have you tested with different browsers?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24962677
score: 0

http://stackoverflow.com/comment/38782445
type: Comment
has text: isn't there any way to do it through ODATA. I can't seem to come up with the required query
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24952664

http://stackoverflow.com/q/24952010
answer count: 1
has body: I am trying to use a custom bindingHandler that adds something like a template and so needs its own model. Just for information (but not required to understand the problem): the real goal is to manage several components that are located inside the DIV that has this bindingHandler. However, I am unable to create a custom context BUT keep KO from trying to bind the elements I created (and already applied binding on it with the custom bindingHandler). All I get is the typical error: Uncaught Error: You cannot apply bindings multiple times to the same element. What happens? What I guess is that: Knockout is doing the first applyBinding and search for the binding handlers on elements within it It does the initialization process of it The initialization create a new context with the applyBindings on new elements After the completion of that operation, knockout seems to not take into account "allowBindings:false" on created elements (and elements that are already bound) and try to bind twice the things... The code (jsfiddle) http://jsfiddle.net/darknessm0404/tB6Zv/3/ viewModel content. Need to have is own model. Another element is added while the constructor of the viewModel is instancied. ko.bindingHandlers.allowBindings = { init: function (elem, valueAccessor) { // Let bindings proceed as normal *only if* my value is false var shouldAllowBindings = ko.unwrap(valueAccessor()); return { controlsDescendantBindings: !shouldAllowBindings }; } }; ko.bindingHandlers.customComponent = { init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { // Append new element var $component = $(' customComponent content: ').appendTo($(element)); // Apply bindings on newly created element console.log('2.A. customComponent -> applyBindings -> started'); ko.applyBindings({ data: 'COMPONENT MODEL DATA' }, $component[0]); console.log('2.A. customComponent -> applyBindings -> completed'); } }; console.log('1.A. view -> applyBindings -> started'); ko.applyBindings(…
favorite count: 0
has answer: http://stackoverflow.com/a/24952179
type: AnsweredQuestion
score: 3
upvote count: 3
accepted answer: http://stackoverflow.com/a/24952179
tagged with: knockout.js
type: Question
downvote count: 0
has title: Knockout custom bindingHandler cannot applyBindings on appended elements
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38715615
type: QuestionComment
score: 0
has text: Are all the property values in your object simple values or can some of them be objects or arrays (e.g. nested structures)?
comment on: http://stackoverflow.com/q/24917152
type: Comment

http://stackoverflow.com/a/25038930
has comment: http://stackoverflow.com/comment/38943351
type: Answer
score: 0
has body: I realised that the closing &lt;/div&gt; tag in the sidebar was missing, once I re-added it everything went back to normal. Simple, yet detrimental.
answers question: http://stackoverflow.com/q/25035013

http://stackoverflow.com/q/25067688
score: 1
has answer: http://stackoverflow.com/a/25068368
accepted answer: http://stackoverflow.com/a/25068368
upvote count: 1
type: Question
has body: I'm having some trouble creating a texture from an image file in Three.js. I have a function to create a mesh that looks like this: var image = document.createElement('img'); image.src = imageFile; var texture = new THREE.Texture(image); var mat = new THREE.MeshPhongMaterial(); mat.map = texture; var mesh = new THREE.Mesh(new THREE.PlaneGeometry(20, 20), mat); var plane = mesh; plane.position.x = 0; scene.add(plane); However, my texture renders black and the image doesn't seem to render properly.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38998255
downvote count: 0
answer count: 1
favorite count: 0
has title: Three.js create texture from image file
tagged with: three.js
linked to: http://stackoverflow.com/q/7919516
tagged with: textures
type: AnsweredQuestion

http://stackoverflow.com/comment/38940353
score: 0
type: Comment
type: QuestionComment
has text: @user1638362 — That will output some data to the HTTP response. What are you doing to get that data out of the HTTP response and into your eyes?
comment on: http://stackoverflow.com/q/25037274

http://stackoverflow.com/a/24940101
has comment: http://stackoverflow.com/comment/38758695
type: Answer
upvote count: 1
score: 1
accepted answer of: http://stackoverflow.com/q/24939320
answers question: http://stackoverflow.com/q/24939320
type: AcceptedAnswer
downvote count: 0
has body: Just read that article and it says Now we need some javascript to make this works, make a file named same way as the controller action but with the suffix .js.erb for this example should be: Writer mentioned about name of file but forgot to tell you about the path of js file. Your js files path would be views/controller_name/new_release.js.erb and not assets/javascript/new_release.js.erb If you look at your controller method def new_release respond_to do |format| format.html #If it's a html request this line tell rails to look for new_release.html.erb in your views directory format.js #If it's a js request this line tell rails to look for new_release.js.erb in your views directory end end For details checkout Working with Javascript in Rails

http://stackoverflow.com/a/25052450
has body: You need to modify your html to include jquery as that will run in client browser, below I have used the cdn path to jquery which should load before jquery.colorbox.js External Form Please fill out my form.
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25052369
upvote count: 3
type: Answer
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/25052369

http://stackoverflow.com/a/25058484
score: 0
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25058267
answers question: http://stackoverflow.com/q/25058267
has body: Convert the result of mysql data array into JSON. $result_json = json_encode($result); And parse this variable in jQuery fashion to access all values. &lt;script type="text/javascript"&gt; var obj= $.parseJSON('&lt;?= $result_json; ?&gt;'); //Parse the above encoded Json. //Here is how you iterate var json = $.parseJSON(obj); $(json).each(function(i,val){ console.log(val); }); &lt;/script&gt;

http://stackoverflow.com/q/24964871
has comment: http://stackoverflow.com/comment/38804943
upvote count: 3
accepted answer: http://stackoverflow.com/a/24968430
has comment: http://stackoverflow.com/comment/38804817
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm writing a directive to enforce maxlength on a textarea field (HTML version &lt; 5). I'm using AngularJS. As such, I want to get it done in a correct AngularJS manner. However, when I do it "Angularesque" as I perceive it, I can't quite get it to work completely. (function () { 'use strict'; var myAppModule = angular.module('myApp', []); myAppModule.controller('MyController', function($scope) { $scope.textareaText = ""; }); myAppModule.directive('myMaxlength', ['$compile', '$log', function($compile, $log) { return { priority: 10000, restrict: 'A', require: 'ngModel', compile: function (elem, attrs) { elem.attr("ng-trim", "false"); return function(scope, linkElem, linkAttrs, ctrl) { var maxlength = parseInt(linkAttrs.myMaxlength, 10); ctrl.$parsers.push(function (value) { $log.info("In parser function value = [" + value + "]."); if (value.length &gt; maxlength) { $log.info("The value [" + value + "] is too long!"); value = value.substr(0, maxlength); ctrl.$setViewValue(value); ctrl.$render(); $log.info("The value is now truncated as [" + value + "]."); } return value; }); }; } }; }]); })(); This nearly works (see the JSFIDDLE here Note: This fiddle has since been updated with the chosen solution below, but the code above still exhibits the problem noted here.). It correctly limits characters going to the model, and renders that back to the display. However, you can continue to enter spaces to exceed the specified maxlength. The extra spaces don't get into the model, but they clutter the display. I believe this has something to do with ng-trim. As you can see (in the code snippet) I'm setting the attribute in the compile function, but it's too late by then. Some suggest manually calling compile within your compile function to force AngularJS to recognize the dynamically-added attribute, but that "appears" to create another copy and doesn't fix the display problem. Putting ng-trim="false" on the textarea element works, but I want a clean solution where all the user …
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/24965117
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24965117
has answer: http://stackoverflow.com/a/24968430
favorite count: 0
has comment: http://stackoverflow.com/comment/38805616
has comment: http://stackoverflow.com/comment/38805885
type: AnsweredQuestion
score: 3
has title: What's a truly "Angularesque" way to implement maxlength on a textarea field?

http://stackoverflow.com/comment/39200520
comment on: http://stackoverflow.com/q/25052294
score: 0
type: Comment
type: QuestionComment
has text: If you post a Fiddle I will try to fix it for you.

http://stackoverflow.com/comment/38845470
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24986572
type: Comment
has text: @PeteScott - Sounds interesting, but I don't see how that's a whole lot different from this implementation. Doesn't that just move the class's instance store into a separate instance? It would make the functionality reusable, but it would still have the potential memory issues described in T.J. Crowder's answer.

vector-graphics
tags question: http://stackoverflow.com/q/25028156
tag name: vector-graphics
type: Tag

http://stackoverflow.com/q/25026099
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
tagged with: twitter-bootstrap
tagged with: css
accepted answer: http://stackoverflow.com/a/25026163
type: AnsweredQuestion
has body: Is it possible to make Bootstrap change the navbar list from text to icons from the browser re-sizing instead of making it into a collapse drop down? For example, make example 1 turn into example 2 just from the browser re-sizing. Example 1: Home About Contact Example 2:
type: Question
has answer: http://stackoverflow.com/a/25026163
has title: Bootstrap collapse icons

http://stackoverflow.com/comment/39038643
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25002287
type: Comment
has text: It is not about callbacks, it is about events. Once That one clicks, it is easier to understand and follow. Plus, streams Are also about events, što YOU get that one too.

http://stackoverflow.com/comment/38957573
has text: You need [`AJAX`](https://developer.mozilla.org/en-US/docs/AJAX/Getting_Started) || [`jQuery.ajax`](http://api.jquery.com/jquery.ajax/)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25045805
score: 0

http://stackoverflow.com/comment/38721389
type: AnswerComment
comment on: http://stackoverflow.com/a/24919574
score: 0
has text: @matt81m It stops the default behavior, which is the form submitting normally.
type: Comment

http://stackoverflow.com/comment/38742479
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24932034
has text: `str_replace("$V3FTD", "v3444ftd", "I am a string $V3FTD ...");`

http://stackoverflow.com/q/24930477
tagged with: css
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38766756
linked to: http://stackoverflow.com/q/6724515
has title: Image flicker and prevention. Proper coding standards
type: Question
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24932464
has comment: http://stackoverflow.com/comment/38741841
tagged with: gsap
has body: I've been working with some basic animations lately and trying to follow good web practices at the same time. The problem I'm encountering is image flicker when not using a preset css method to hide the element before the page loads. It's very easy to prevent the flicker by just hiding the element with my normal css and then revealing it with javascript, but that seems to me a horrible practice if someone has javascript disabled. Should I use the HTML5 feature of putting &lt;noscript&gt; tags in the header and then use a separate style sheet to set the opacity and position to the final settings for users without javascript? Is that the most elegant solution? I've started using the greensock (gsap) library to TweenLite.from, since I can just set everything to the final state in the css, but I get a slight image/text flicker the first time the page is loaded. I like this solution because I can set all of the css as it will be for someone with no javascript, and it allows me to easily animate from a point, to an existing point, instead of working backwards like I have to do with Javascript or jQuery. But, there's still that image flicker which isn't really acceptable. Would a page preloader solve this? What is the generally agreed upon practice for this these days? I'm also worried about SEO and the consequences of setting stuff to visibility: hidden or display:none and then animating it in. Does the Google spider read javascript? Here's an example of the screen flicker and animations I'm talking about.
tagged with: animation
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38756528
comment on: http://stackoverflow.com/q/24939347
score: 1
has text: Perhaps you are searching for something like this: http://bavotasan.com/2011/a-simple-fade-with-css3/
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25001335
upvote count: 1
downvote count: 1
has body: Well, first of all, a javascript object is a dictionary; I'm not sure it's a good idea to try to sort a dictionary; it might be doable, however, it probably won't give the best performances. Instead of a javascript object, you should probably opt for an array. Something like: var todos = [{id:1}, {id:2]}, {id:3}]; todos.sort(function (a, b) { return b.id - a.id; });
has comment: http://stackoverflow.com/comment/38872914
has comment: http://stackoverflow.com/comment/38873271
type: Answer
has comment: http://stackoverflow.com/comment/38873884
has comment: http://stackoverflow.com/comment/38873785
answers question: http://stackoverflow.com/q/25001263
has comment: http://stackoverflow.com/comment/38873023
has comment: http://stackoverflow.com/comment/38873183
has comment: http://stackoverflow.com/comment/38872727
score: 0

http://stackoverflow.com/comment/38922382
type: Comment
has text: No I know Phil I commented after you but was referring to him before lol. My bad. Damn phone is hard to type on
comment on: http://stackoverflow.com/a/25027183
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38760338
type: QuestionComment
type: Comment
score: 1
has text: That’s not valid JSON – note the “smart quotes”. Also, you can’t have unescaped newlines in a JavaScript string literal.
comment on: http://stackoverflow.com/q/24941363

http://stackoverflow.com/q/24962542
upvote count: 1
type: Question
type: AnsweredQuestion
tagged with: split
has answer: http://stackoverflow.com/a/24962591
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24962591
answer count: 2
has answer: http://stackoverflow.com/a/24962587
downvote count: 0
favorite count: 0
tagged with: regex
has title: js split() using regex, what expression was matched
accepted answer: http://stackoverflow.com/a/24962587
score: 1
has body: When using a regex as the separator in the split(), is there a way to know what string it matched? Example: var string = "12+34-12", numberlist = split(/[^0-9]/); how would I know if it found a + or a -?

http://stackoverflow.com/comment/38733503
type: QuestionComment
comment on: http://stackoverflow.com/q/24927182
has text: There was an exact duplicate, it's even related to the exact same code : http://stackoverflow.com/questions/8330499/operator-before-expression-in-javascript-what-does-it-do
score: 0
type: Comment

http://stackoverflow.com/q/25032423
has comment: http://stackoverflow.com/comment/38931357
has comment: http://stackoverflow.com/comment/38931753
has body: What i want is to change te structure of my HTML page when going under 640px. this is the structure i have: What i want is: i don't want duplicate div's in my code and do a display block on that elements when dropping under 640px. I would like to do this with jQuery. Thanks Stein Edit : i tried this but there must be a better solution than this: var infoblock0 = $(".info_block.0").html(); $(".info_block.0").remove(); $(".single_person.2").after(" "+infoblock0+" "); var infoblock1 = $(".info_block.1").html(); $(".info_block.1").remove(); $(".single_person.2").after(" "+infoblock1+" "); var infoblock2 = $(".info_block.2").html(); $(".info_block.2").remove(); $(".single_person.2").after(" "+infoblock2+" "); var infoblock6 = $(".info_block.6").html(); $(".info_block.6").remove(); $(".single_person.8").after(" "+infoblock6+" "); var infoblock7 = $(".info_block.7").html(); $(".info_block.7").remove(); $(".single_person.8").after(" "+infoblock7+" "); var infoblock8 = $(".info_block.8").html(); $(".info_block.8").remove(); $(".single_person.8").after(" "+infoblock8+" ");
type: Question
downvote count: 4
has comment: http://stackoverflow.com/comment/38931699
upvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25032935
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Change structure of html with jQuery when responsive
favorite count: 0
accepted answer: http://stackoverflow.com/a/25032935
score: -4
type: AnsweredQuestion

http://stackoverflow.com/comment/38925786
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25028910
type: AnswerComment
has text: thank you for your great explanation: it makes sense. Unfortunately, thought, even without parenthesis, it still only works on load (when I refresh the page) not onresize. Maybe it just can't be done?

http://stackoverflow.com/comment/38787750
type: QuestionComment
comment on: http://stackoverflow.com/q/24956200
score: 0
has text: Do you absolutely need an svg element inside Div2 or just the background image to be the same.
type: Comment

http://stackoverflow.com/a/66119133
upvote count: 4
answers question: http://stackoverflow.com/q/24998624
has body: var dayName =['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; var day = dayName[new Date().getDay()]; console.log(day)
type: Answer
downvote count: 1
score: 3

http://stackoverflow.com/a/24950923
type: Answer
has comment: http://stackoverflow.com/comment/38785462
has comment: http://stackoverflow.com/comment/38778444
downvote count: 0
answers question: http://stackoverflow.com/q/24950517
upvote count: 6
has comment: http://stackoverflow.com/comment/38784820
has comment: http://stackoverflow.com/comment/38785815
has comment: http://stackoverflow.com/comment/38785089
has body: I agree with @Ferdi265. However one additional point I would make is to use jQuery.data(). jQuery.data() doesn't actually update the DOM, it updates a javascript object referencing the element and stores the value there. It's much better for performance as no DOM manipulation is required. $("img").attr({ alt: "a picture of my cat" }).data({ item: "pet", color: "orange" }); Obviously this doesn't update your element's attributes, and therefore any future reference to these values will have to be done with jQuery.data(); $("img").data("item"); If you're interested in understanding how this works under-the-hood I wrote an article on it a while back: http://curtistimson.co.uk/jquery/understanding-jquery-data-storage/
has comment: http://stackoverflow.com/comment/38778375
score: 6

http://stackoverflow.com/q/25010289
has title: How to put error message inside Placeholder
type: AnsweredQuestion
tagged with: message
tagged with: javascript
has comment: http://stackoverflow.com/comment/38889653
type: Question
score: 5
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38889694
upvote count: 5
has comment: http://stackoverflow.com/comment/38889802
has comment: http://stackoverflow.com/comment/38889744
has answer: http://stackoverflow.com/a/25010356
accepted answer: http://stackoverflow.com/a/25010356
downvote count: 0
has body: I have found this Jsfiddle http://jsfiddle.net/HkEuf/2650/ which allow entering only numbers in input field. Now I want to put inside input field Placeholder which will also be error message (look at Jsfiddle). Number : &lt;input type="text" name="quantity" id="quantity" placeholder="Test" /&gt; And for error message is: &lt;span id="errmsg"&gt;&lt;/span&gt; Now I whant to do this: First you see input field with placeholder "Test". So if you put numbers, placeholder deletes, and you see only numbers that you enter. But If you put non-digit chars (letters), placeholder changes into error message id="errmsg". Is this possible?

http://stackoverflow.com/comment/39121331
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25123617
has text: Yeah, sorry, I couldn't test on Chrome so I failed to understand the requirements. I would try custom controls because they don't seem to allow scripting with the default.
type: AnswerComment

http://stackoverflow.com/comment/38792972
has text: What the heck is that second syntax supposed to be? `[`...`]` is for Arrays, which don't have keys; `{`...`}` is for Objects, which do.
comment on: http://stackoverflow.com/q/24958960
score: 1
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25101321
type: Answer
upvote count: 1
score: 1
has body: To check and see if the input is empty or not you can do something simpler like this. $(document).ready(function() { $(".inputWithLabel").change(function() { if ($(this).val() == null || $(this).val() == "") { alert("Input is null!"); } else { alert("Input is valid"); } }); });
downvote count: 0
answers question: http://stackoverflow.com/q/25036333

http://stackoverflow.com/q/24930877
tagged with: arguments
type: AnsweredQuestion
type: Question
has title: Accessing event arguments in ExtJS
tagged with: javascript
has body: Generally when we create event handlers we go like this: boxready: function (me, width, height, eOpts) { me.X() &lt;-refers to the component whose event is triggered and calls the function X() } However I am in a situation where I want to do this: boxready: { fn: Ext.bind(this.myFunction, this), scope: me } But since I don't use function(me, ...) I cannot access the arguments the event sends. Is there a way for me to access them in order to put them in the scope property?
linked to: http://stackoverflow.com/q/24913743
tagged with: extjs
score: 0
has answer: http://stackoverflow.com/a/24932108
accepted answer: http://stackoverflow.com/a/24932108
answer count: 1
tagged with: event-handling

http://stackoverflow.com/comment/38863955
comment on: http://stackoverflow.com/a/24996742
has text: [] would be my array requestsArray?
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/60962039
answers question: http://stackoverflow.com/q/25059121
has body: Since Google has disabled the NPAPI support, therefore, Adobe reader cannot be configured to view PDF file within Chrome and many other modern browsers. See link below: https://helpx.adobe.com/acrobat/kb/change-in-support-for-acrobat-and-reader-plug-ins-in-modern-web-.html
score: 0
type: Answer

http://stackoverflow.com/q/25037003
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38939901
has comment: http://stackoverflow.com/comment/38940318
type: Question
has title: Polling and on demand function
has body: I have a JQuery function that polls the server. I now wanted to add an onClick function to the loading icon so that if the user presses the icon it will refresh on demand. The polling works fine until I press the icon. It then stops polling and every time I press the icon it creates double the amount of calls. So first time 1, second time 2 third time 4 and so on. I am a JQuery newbie so I am not sure if I should create two functions on for just polling and one for refresh. var DO_POLLING = { load: function doPoll(poll) { //This part of the call is a PlayFramework spefic part but it works the same as vanila jquery var ajax = jsRoutes.controllers.AjaxApplication.getAjaxReceipts(ll).ajax ( { beforeSend : function () { // }, success : function ( data ) { // }, complete : function ( data ) { // }, always : function ( data ) { if(poll){ setTimeout(doPoll,30000); } }, error : function ( ) { // } } ); //This is called when the refresh icon is called $('#wid-id-2 i.fa-refresh').click( function() { doPoll(false) }) } } $(document).ready(function () { DO_POLLING.load(true); });
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25037230
score: 0

http://stackoverflow.com/comment/38919513
comment on: http://stackoverflow.com/a/25021800
type: Comment
has text: @AvinashRaj So I see :) -- I updated the text to reflect this
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38859157
has text: Thank you for the thorough explanation. Really cleared it up.
comment on: http://stackoverflow.com/a/24987315
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/a/24932113
type: Answer
upvote count: 0
downvote count: 1
score: -1
has body: HIDES THE DIV ELEMENT. DOESN'T TAKE SPACE div{ display:none; } HIDES THE DIV BUT DOES TAKE SPACE div{ display:none; }
has comment: http://stackoverflow.com/comment/38743899
answers question: http://stackoverflow.com/q/24931273

http://stackoverflow.com/q/24978755
upvote count: 1
type: Question
tagged with: javascript
has title: Returning an object from a Class like mongoose
downvote count: 0
tagged with: mongoose
score: 1
has body: How is mongoose.js returning an object from: var silence = new Kitten({ name: 'Silence' }); console.log(silence); // { name: 'Silence' } But if you check the source code Kitten is a function called model on this code which then points to the document source code here. function Document (obj, fields, skipId) { this.$__ = new InternalCache; this.isNew = true; this.errors = undefined; //... this._doc = this.$__buildDoc(obj, fields, skipId); if (obj) { this.set(obj, undefined, true); } } Which means it should be returning something like: var silence = new Kitten({ name: 'Silence' }); console.log(silence); // { _obj: { name: 'Silence' } } So how is it that they are returnin another object than the constructed class itself? Further investigation: Manually changing the ret here makes the class return that specified ret.
favorite count: 0
tagged with: node.js
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/comment/38924799
score: 1
has text: CSS is not initialized by JavaScript - it is initialized by the browser's native CSS engine (unless the engine itself was written in JavaScript, but that's not really the point), and then exposed to JavaScript via CSSOM APIs.
type: AnswerComment
comment on: http://stackoverflow.com/a/25028720
type: Comment

http://stackoverflow.com/q/25004948
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/5665203
type: Question
score: 1
has answer: http://stackoverflow.com/a/25005146
has comment: http://stackoverflow.com/comment/38879896
tagged with: jquery-mobile
answer count: 1
downvote count: 0
has title: UIWebView - change virtual keyboard 'Go' button text?
tagged with: javascript
tagged with: jquery
has body: I have a page that is displayed in an UIWebView on an iPad app. The page has an input field, and when the user taps on it, the virtual keyboard popups up. Currently, the keyboard has the blue 'Go' button. I would like to change the button text from 'Go' to 'Done' and I want to grey-out/disable the button until the user types in at least 1 char. Is this possible with Javascript/jQuery mobile? I don't have access to the app. Thanks.
favorite count: 0
has comment: http://stackoverflow.com/comment/38879683
has comment: http://stackoverflow.com/comment/38879872

http://stackoverflow.com/q/24934989
has body: I'm searching for a simple, small templating engine which usage would be similar to this: Site My name is {{person.name}} and I'm {{person.age}} years old. What should result in a page rendering: My name is John and I'm 28 years old. I've looked over every single templating engine found here: http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more and it I dind't find one which would work like that. So the question is: am I missing something here, or is this kind of templating not a good practice for some reason?
has answer: http://stackoverflow.com/a/24935102
has title: Simple client-side templating directly inside HTML
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/24935102
answer count: 1
tagged with: javascript
score: 0
tagged with: templating-engine
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38948945
type: Comment
comment on: http://stackoverflow.com/a/25041221
score: 0
type: AnswerComment
has text: @StathisG Thanks for reminding me, I had forgotten it was deprecated.

http://stackoverflow.com/q/24958294
tagged with: html5-canvas
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24958827
score: 0
possible better answer: http://stackoverflow.com/a/24958857
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24958857
type: AnsweredQuestion
has body: I am having a look at HTML 5 canvas today and I would like to move 3 circles on the canvas. From what I have read so far I need to redraw the circles each time (every 60 miliseconds seems like a good place to start) and clear out the old circle so that the new one with its new position on the screen takes its place So far I have a draw() that will render 3 circles each of a different colour, the idea is to take control of each circle. I am looking for some guidance here on how to initially set this up and get each ball moving. This is what I have so far: Ball Demo
has title: HTML 5 canvas and moving objects
type: Question
has answer: http://stackoverflow.com/a/24958827
answer count: 2
tagged with: canvas

http://stackoverflow.com/a/24957814
type: Answer
has comment: http://stackoverflow.com/comment/38813473
has comment: http://stackoverflow.com/comment/38811361
has comment: http://stackoverflow.com/comment/38858185
has comment: http://stackoverflow.com/comment/38816769
answers question: http://stackoverflow.com/q/24957595
score: 0
has body: You can not define errorHandler var fs=null; function initFS() { window.requestFileSystem =window.requestFileSystem || window.webkitRequestFileSystem; window.requestFileSystem(window.TEMPORARY, 1024 * 1024, function (filesystem) { fs = filesystem; console.log(fs); }, errorHandler); } function errorHandler(e) { console.log(e); // it show everything that you want }

http://stackoverflow.com/comment/38726748
score: 2
comment on: http://stackoverflow.com/a/24923285
type: AnswerComment
has text: This answer is correct. Also, you have 3 dropdown menus, each of which gives you 2 choices. This means you should have a total of 2^3 = 8 different possible outcomes for each onChange function, but your if/else statements account for 10 different outcomes. You have 2 redundant if statements in every onChange function.
type: Comment

http://stackoverflow.com/a/24954690
score: 0
type: Answer
accepted answer of: http://stackoverflow.com/q/24949661
answers question: http://stackoverflow.com/q/24949661
has body: Did you enabled CORS themessage i am getting when i tested in firebug is as below Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://wsf.cdyne.com/WeatherWS/Weather.asmx/GetCityWeatherByZIP. This can be fixed by moving the resource to the same domain or enabling CORS. these links might help you http://enable-cors.org/client.html Firefox setting to enable cross domain ajax request
type: AcceptedAnswer

sql-server
tags question: http://stackoverflow.com/q/25002287
type: Tag
tag name: sql-server

http://stackoverflow.com/q/25056735
type: Question
has body: I own a responsive web mobile application (Javascript) that displays a form in multi step. Similar to that. The whole works except an issue regarding UX. As soon as I fill up an input text, the iphone keyboard shows the "Done" button (at the top of the keyboard) and also the "Go" button. Of course, the "Go" button appears since the input is within a &lt;form&gt; markup but has no effect since the submit button is not generated yet (thanks to Angular ui-router states). It would be generated only when the user reachs the last page/step. Only the "Done" button hides the keyboard so that user can fills up other inputs. However, it leads to confusion for lambda user to push the Go button in the first steps/pages of the form, and notice that it does nothing. It does not even hide the virtual keyboard, as "Done" does. Is there a way to avoid Iphone to suggest the "Go" buttton before the user fills up every mandatory fields until the last page/step? Indeed, the ideal way would be to only display the button "Done" in the position of the button "Go".
has comment: http://stackoverflow.com/comment/38977316
has comment: http://stackoverflow.com/comment/38995821
has comment: http://stackoverflow.com/comment/38977305
has title: iOS/Iphone How to avoid the presence of "Go" button while filling up a form in multipage
tagged with: ios
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/5561826
answer count: 0
has comment: http://stackoverflow.com/comment/38977231
linked to: http://stackoverflow.com/q/8765227
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38977269
has comment: http://stackoverflow.com/comment/38977278
has comment: http://stackoverflow.com/comment/38977292
has comment: http://stackoverflow.com/comment/38985819
tagged with: responsive-design
has comment: http://stackoverflow.com/comment/38977333
linked to: http://stackoverflow.com/q/10151426
tagged with: forms
has comment: http://stackoverflow.com/comment/38977204

http://stackoverflow.com/a/24911190
type: Answer
upvote count: 4
downvote count: 0
has body: Since you export a function, sample will be a function now. You need to explicitly execute it to get the same object. So, you need to do something like this var sample = require('../lib/sample')().sample Now, the require statement returns the function, and we immediately execute it, which returns an object with sample property. Since you are interested in sample property only, we get only the sample property. If you were planning to hide the implementation of parse from the users, I would suggest doing function parse(text) { return 'hello' + text; } module.exports = { 'parse': parse }; Now, you are simply exporting the parse function, in an object and the code which requires this module will be able to use parse function, like you mentioned in the question.
score: 4
accepted answer of: http://stackoverflow.com/q/24911122
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24911122

http://stackoverflow.com/a/24979005
has comment: http://stackoverflow.com/comment/38831220
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24978937
has body: It seems that you are attempting to make a model dialog using some third-party jQuery plugin, but you foget to make a reference to that plugin's javascript file. To confirm this, i wonder which line does the exception occurs on? Is it on the line of first line of your ready callback? $("#deleteModal").modal("hide"); If so, please check your script reference. Just add a &lt;script&gt; tag with a src to that file before your script block. Update: As you comments, the exception does not occurs on that line. So you may use a debugger(such as Chrome developer tools) to find out which function-call fails. You can set the debugger to pause the excution on exceptions. In chrome developer tools, you can switch to Source tab and click the last icon on right-top of the side-bar on the right to enable this feature. Here's an awesome answer with snapshots: https://stackoverflow.com/a/17324511/1817042
has comment: http://stackoverflow.com/comment/38831039
has comment: http://stackoverflow.com/comment/38830769
score: 1
has comment: http://stackoverflow.com/comment/38831800
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38830957
answers question: http://stackoverflow.com/q/24978937
type: Answer
has comment: http://stackoverflow.com/comment/38830849
has comment: http://stackoverflow.com/comment/38831306

http://stackoverflow.com/comment/38855352
type: AnswerComment
has text: thanx for ur reply but as u seeing here there are lots of Links so for every link i have to get the Click event that is why i want to store in the aspx page and get the respected value
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24989873

http://stackoverflow.com/comment/38728986
score: 1
has text: Thanks Jason beat me to it :)
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24924839

http://stackoverflow.com/comment/38784597
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24952343
has text: alert(dData.ZIP); try this

http://stackoverflow.com/comment/38881664
score: 0
type: Comment
type: QuestionComment
has text: You might have better luck on http://sharepoint.stackexchange.com
comment on: http://stackoverflow.com/q/25005600

http://stackoverflow.com/q/25057116
tagged with: javascript
has body: I am new to Jquery mobile and I wish to create a form which has Username and password in first HTML file and I need to store these datas in sqlite and retrieve an compare datas and if I enter the different login details ie..(Username and password) it should prompt an error message. After completing the login I have to register the details and after the registration is completed,its gets stored in sqlite database and if we want to edit these details the edited details gets stored again in the database. May I know the concept,methods and the reference so it will be helpful for me
tagged with: sqlite
downvote count: 0
has comment: http://stackoverflow.com/comment/38977621
favorite count: 0
has title: Jquery mobile forms and validation using Sqllite
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
answer count: 0
has comment: http://stackoverflow.com/comment/38991619
linked to: http://stackoverflow.com/q/549
score: 1
upvote count: 1
type: Question
tagged with: jquery-mobile

http://stackoverflow.com/a/24942439
has comment: http://stackoverflow.com/comment/38762648
upvote count: 0
answers question: http://stackoverflow.com/q/24942347
has comment: http://stackoverflow.com/comment/38762634
has comment: http://stackoverflow.com/comment/38763062
has body: Update Use this line before passing the HTML into the jQuery it will remove any scripts (including onmouseover etc.) that are included in the HTML: var cleansed = str.replace(/&lt;script\b[^&lt;]*(?:(?!&lt;\/script&gt;)&lt;[^&lt;]*)*&lt;\/script&gt;/gmi, ""); cleansed = cleansed.replace(/\bon\w+\s*=[\s\S]*?&gt;/gmi, "&gt;"); I still say that the jQuery/Django method is the ideal method. The above line will clean the content of scripts before you add it to the DOM. Previous Django should escape anything it's passing into that line of jQuery. So long as you aren't using an eval() statement anywhere in there, cross-site scripting shouldn't be a concern. I'd say it's more practical to continue the way you're going.
type: Answer
downvote count: 1
has comment: http://stackoverflow.com/comment/38773891
has comment: http://stackoverflow.com/comment/38762742
score: -1
has comment: http://stackoverflow.com/comment/38787922
has comment: http://stackoverflow.com/comment/38763230

file
type: Tag
tags question: http://stackoverflow.com/q/25014499
tag name: file
tags question: http://stackoverflow.com/q/24990960
tags question: http://stackoverflow.com/q/25039916
tags question: http://stackoverflow.com/q/24997600
tags question: http://stackoverflow.com/q/24972313
tags question: http://stackoverflow.com/q/24919975

http://stackoverflow.com/comment/38749914
score: 0
type: AnswerComment
type: Comment
has text: I'm not sure if I understand 100% the last few lines. This is my whole bit : `d3.csv("OrderValueToday.csv"), function(error, data){ var svgLabel = d3.select("#label") .append ("svg") svg.append("text") .text(totalSales); }` will this work if I'm loading another external csv in addition to the one building the graph. This value will be updated on the fly like the graph so the value will also be changing
comment on: http://stackoverflow.com/a/24935535

http://stackoverflow.com/q/24914455
tagged with: google-app-engine
has body: I have a web application, where a user request can trigger a calculation which takes some time. I would like to deliver the skeleton of the website immediatly, while i deliver the slow parts later. With which techniques this is usally achieved? In my case, I have a Google App Engine application in python, which make a call to the twitter API, analyzes the result and displays it to the user. This takes 2 seconds or so and I don't want the user to wait for such a long time. How can I let the Get-Handler deliver the Skeleton early and let the client load the analysis reuslts when they are ready?
tagged with: python
type: AnsweredQuestion
type: Question
tagged with: client-server
accepted answer: http://stackoverflow.com/a/24914909
tagged with: javascript
has title: How to load slow parts of a website later?
score: 0
has answer: http://stackoverflow.com/a/24914909
upvote count: 1
answer count: 1
downvote count: 1
favorite count: 0

karma-runner
tags question: http://stackoverflow.com/q/24960459
tags question: http://stackoverflow.com/q/25002520
tags question: http://stackoverflow.com/q/25006492
tags question: http://stackoverflow.com/q/24985778
tags question: http://stackoverflow.com/q/24971160
tags question: http://stackoverflow.com/q/25022663
tags question: http://stackoverflow.com/q/24953218
tags question: http://stackoverflow.com/q/24919053
tag name: karma-runner
tags question: http://stackoverflow.com/q/25064278
type: Tag
tags question: http://stackoverflow.com/q/25017369

http://stackoverflow.com/q/24985072
has comment: http://stackoverflow.com/comment/38843174
has body: I have a web app that loads instagram images and creates a slideshow with background sound. While the images are being loaded, a pre loader is run to show the processing. But it doesn't fully load the mp3 file and when I check in the browser's console it has got 206 partial content. So, on clicking the play button, I have to wait a few second so that music is loaded fully to play the slideshow. console.log('loading theme: ' + folder); $.ajaxSetup({ cache: false }); $.when( $.getScript(epic.getFrontendURL() + "animations/" + folder + "/js/data.js"), $.getScript(epic.getFrontendURL() + "animations/" + folder + "/js/main.js"), $.Deferred(function (deferred) { $(deferred.resolve); }) ).done(function () { //some methods sound_bg.src = epic.getFrontendURL() + "sound/back.mp3? }); So, is this related somehow, with done which delays the processing.
type: UnansweredQuestion
upvote count: 1
tagged with: php
has answer: http://stackoverflow.com/a/24985905
score: 1
has comment: http://stackoverflow.com/comment/38842284
has title: getting 206 partial content while loading .mp3 files
type: Question
has comment: http://stackoverflow.com/comment/38843069
answer count: 2
tagged with: apache
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/52675719
downvote count: 0
favorite count: 0

http://stackoverflow.com/q/24931921
has body: Is there a preferred way of checking the format of a dynamic segment param in ember.js? For example, say I have the URL /date/:date and want to ensure that :date is a ISO-8601 formatted date (YYYY-MM-DD). You could do it in the Route's model hook, and reject the promise if your validation fails. Perhaps that is the best way?
type: UnansweredQuestion
tagged with: ember.js
has title: Validate format of dynamic segment in ember.js
type: Question
has answer: http://stackoverflow.com/a/24933732
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/24924938
answer count: 1
favorite count: 0
type: UnansweredQuestion
has title: Can I change the Y-Axis label display as I zoom in/out of a dygraphs chart?
has answer: http://stackoverflow.com/a/25149654
tagged with: dygraphs
downvote count: 0
score: 1
has body: I've created a dygraphs chart that displays the movement of tagged fish, with time plotted on the x-axis and distance moved displayed on the y-axis. There are a dozen or more detection sites in the river, each site approx. 30-100 km from its neighbor. Each detection site has four or more detectors, labeled 'D1', 'D2', ... 'Dx'. The initial chart contains labels on the y-axis spanning almost 600km. At that resolution, I'd like to see only the major labels for the detection sites, e.g., 'Lock 1', Lock 2', 'Lock 6', etc. As I drill down to a given site, then and only then would I like to see the minor labels for the individual detectors at that site ('D1', 'D2', etc.) I'm using a ticker function in dygraphs to map my y-axis labels to the corresponding river location. I would like the minor labels to appear on the axis only when I zoom into a site, such that only that site's own major label appears, along with the minor labels for that site. Can I use a callback function to return the current y-resolution? Do I need, and can I switch between, two source lists, dependent on the y-resolution?
type: Question
tagged with: javascript
upvote count: 1

http://stackoverflow.com/comment/38846188
comment on: http://stackoverflow.com/q/24987088
has text: @JaredFarrish That is jQuery, a JavaScript framework. Edit: I'm sorry! I see the error now!
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24953158
has answer: http://stackoverflow.com/a/24953213
upvote count: 1
has answer: http://stackoverflow.com/a/24953227
type: Question
score: 1
has title: simple if statement with if
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: string
favorite count: 0
has answer: http://stackoverflow.com/a/24953266
has answer: http://stackoverflow.com/a/24953215
has comment: http://stackoverflow.com/comment/38782181
has answer: http://stackoverflow.com/a/25375339
has comment: http://stackoverflow.com/comment/38782229
has body: I am trying to add a word into a string if it is not in there. And I converted the string into an array(an) like this and used push to add the new word but the new word is getting added (an.length - 1) times. How can I fix this? var ime = "open it now" var an = ime.split(' ') var ene = "itt" for(var i = 0; i &lt; ano.length; i++){ if(an[i] != ene) an.push(ene) } console.log(an)
answer count: 5
type: UnansweredQuestion

http://stackoverflow.com/comment/38866160
has text: If it's a dedicated server, you should be able to install whatever you want - or, at least, to ask the server's sysadmin to to so. You should not rely on a system wide install of Django anyway, better to have you own exact versions of all your dependencies in a `virtualenv`.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24993460

http://stackoverflow.com/comment/38855911
comment on: http://stackoverflow.com/q/24992449
type: Comment
type: QuestionComment
score: 2
has text: Try `https://api.flicker.com` not just `http://`?

http://stackoverflow.com/comment/38862667
has text: This works for me? Whats the error? http://jsfiddle.net/mYnQy/
score: 1
comment on: http://stackoverflow.com/q/24995889
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25049168
type: Question
has comment: http://stackoverflow.com/comment/38967242
tagged with: jquery-ui
tagged with: javascript
score: 0
has title: Applying JQuery Mobile's style to function
answer count: 2
has answer: http://stackoverflow.com/a/25053097
tagged with: d3.js
has body: I have a D3 function that creates list items on a page. I want them to be styled by JQuery UI mobile, but when I call the function multiple ways they are never styled. D3/JS: var sampdata = [{itemname: "Placeholder0", numvalue: "$000,000"}, {itemname: "Placeholder1", numvalue: "$543,600"}, {itemname: "Placeholder2", numvalue: "$9,200"}, {itemname: "Placeholder3", numvalue: "$5,100"}]; setupgui: function() { d3.select("#SampcoISrevenues").selectAll("li") .data(sampdata) .enter() .append("li") .text(function (d){return d.itemname;}) .append("span") .attr("class", "right") .text(function (d){return d.numvalue;}); } Where this function picks out the part of the screen reserved, and then adds list items from "sampdata". HTML: I reference both the D3 library, my index.js, and JQuery (JQmobile.css/.js, JQ.js) in this order: Although the D3 function is run right away, JQuery mobile does not style it. I would like it to style it as it works really well for mobile.
has answer: http://stackoverflow.com/a/25086978
possible better answer: http://stackoverflow.com/a/25053097
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25086978

http://stackoverflow.com/q/24978381
score: -1
has comment: http://stackoverflow.com/comment/38829589
has comment: http://stackoverflow.com/comment/38829588
has comment: http://stackoverflow.com/comment/38829558
linked to: http://stackoverflow.com/q/1732348
has comment: http://stackoverflow.com/comment/38829548
accepted answer: http://stackoverflow.com/a/25083349
answer count: 2
possible better answer: http://stackoverflow.com/a/24978493
tagged with: jquery
has comment: http://stackoverflow.com/comment/38829540
favorite count: 0
has answer: http://stackoverflow.com/a/25083349
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38830005
tagged with: regex
linked to: http://stackoverflow.com/q/24963843
type: AnsweredQuestion
upvote count: 0
has answer: http://stackoverflow.com/a/24978493
has comment: http://stackoverflow.com/comment/38835736
has comment: http://stackoverflow.com/comment/38829732
has body: code: "hi split html string" "now" "second tag is coming" end here output: "hi split html string" "now" , "second tag is coming" , end here How can i achieve this ouput? what could be regex expression fot this image class in order to use split function(or any better way)?Please give me a demo
has title: Split a image tag on html string
downvote count: 1
has comment: http://stackoverflow.com/comment/38829709
type: Question
tagged with: split
has comment: http://stackoverflow.com/comment/38829643
has comment: http://stackoverflow.com/comment/38830210
tagged with: javascript

http://stackoverflow.com/a/25226879
upvote count: 1
type: Answer
downvote count: 0
score: 1
has body: Let's consider the following excerpt from your code, where I understand the issue lies: Sm.screenfragment(function (screen, viewModel) { //This can grow very quickly and turn into a mess var attribA = screen.get('title'), ... ... attribZ = screen.get('status'); var setAttribA = function (container) { //Do Stuff }; ... ... var setAttribZ = function(event, viewName) { //Do Stuff }; ... As far as I can see what you're doing, in my opinion, it's unnecessary to define properties attribA up to attribZ and then setting them, and then again define setter functions for them. You could simply return or access screen.get('x') where and when it is needed. But if it's absolutely necessary, for some reasons, then the following strategy popularised by jQuery may suffice: attributeX = function(x, container){ // if x and container are undefined, then we can assume API caller intends to // read value of property 'x' otherwise, caller intends to write to the property. if(container){ // don't forget to do stuff before setting! container.setProp(x); // you get the idea } else { // well we must have a 'container' to set a prop, // if we don't then caller must want to read. return screen.get(x); } } If this strategy doesn't mitigate the issue or if you think I didn't understand question properly, then please do attempt to make the case clearer and get us closer to the aim.
answers question: http://stackoverflow.com/q/25041232

http://stackoverflow.com/comment/38725844
type: QuestionComment
has text: The field values will save to the meta_value automatically if you save the post/page.
comment on: http://stackoverflow.com/q/24922515
score: 0
type: Comment

http://stackoverflow.com/q/25008099
has title: Function.prototype.bind does not work in IE even in versions where it is supposed to be supported
has comment: http://stackoverflow.com/comment/38885562
tagged with: javascript
has comment: http://stackoverflow.com/comment/38885497
answer count: 2
has body: The following script does not work in IE 9, IE 10, IE 11 var a = location; var b = 'toString' var c = a[b].bind(a); c(); // "Invalid calling object in IE" Any workarounds for this? Edit - The MDN shim provided in the linked question do not work!! And they are for IE 8! My question for IE > 8 where Function.bind is "supported".
linked to: http://stackoverflow.com/q/11054511
has comment: http://stackoverflow.com/comment/38885747
favorite count: 0
upvote count: 5
has comment: http://stackoverflow.com/comment/38885675
has comment: http://stackoverflow.com/comment/38885834
has answer: http://stackoverflow.com/a/25008301
has comment: http://stackoverflow.com/comment/38885797
tagged with: cross-browser
has comment: http://stackoverflow.com/comment/38885525
type: AnsweredQuestion
downvote count: 0
possible better answer: http://stackoverflow.com/a/25008301
has answer: http://stackoverflow.com/a/25008356
accepted answer: http://stackoverflow.com/a/25008356
has comment: http://stackoverflow.com/comment/38885759
type: Question
score: 5
tagged with: internet-explorer

http://stackoverflow.com/a/25013919
has comment: http://stackoverflow.com/comment/38899185
score: 0
answers question: http://stackoverflow.com/q/25013801
has body: Your jquery path is wrong: Replace To
type: Answer
upvote count: 1
downvote count: 1

http://stackoverflow.com/q/25007757
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25016559
type: Question
has title: How to stop tabbing to elements outside Angular-UI Bootstrap modal window?
tagged with: javascript
tagged with: angular-ui-bootstrap
upvote count: 1
answer count: 1
tagged with: angular-ui
favorite count: 0
accepted answer: http://stackoverflow.com/a/25016559
has body: When I open modal in Angular-UI Bootstrap, press the 'tab' key to cycle through elements, once cycling through elements in the modal window it starts selecting elements behind the modal. To demonstrate goto: http://angular-ui.github.io/bootstrap/ and scroll to the modal section. Angular-UI bootstrap is built up from Twitter Bootstrap. Though Twitter Bootstrap does not have this same issue. I have tested in 3.1.1 &amp; 3.2 To demonstrate desired behaviour: - 3.2: http://getbootstrap.com/javascript/#modals - 3.1.1: http://bootstrapdocs.com/v3.1.1/docs/javascript/#modals How does Bootstrap prevent selecting elements behind the Modal window on tab?

http://stackoverflow.com/a/24979516
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24979376
score: 1
has comment: http://stackoverflow.com/comment/38831736
accepted answer of: http://stackoverflow.com/q/24979376
type: AcceptedAnswer
has body: You have this: $sessionID = uniqid(); echo json_encode($sessionID); // "53d4c17abfe87" Since uniqid() produces a plain string, your output is not valid JSON as per the format specification. You'll need something like this instead: $sessionID = uniqid(); echo json_encode(array($sessionID)); // ["53d4c17abfe87"] Why does json_encode() generate invalid JSON in the first place? Because some times it's useful to generate partial JSON. For instance, it's a handy trick to inject values into generated JavaScript code: var foo = &lt;?=json_encode($sessionID)?&gt;; It's also documented: PHP implements a superset of JSON - it will also encode and decode scalar types and NULL. The JSON standard only supports these values when they are nested inside an array or an object. So to answer the question title: Is json_encode extremely picky? On the contrary, it's fairly relaxed!
downvote count: 0

http://stackoverflow.com/q/24968803
tagged with: ajax
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: ember.js
has body: I've got this: {{#link-to "register"}}Register{{/link-to}} The problem is, I don't want to load register.hbs - the file in which I keep the register handlebar straightaway, but want to load it right after the user clicks on the link, and delay the template from loading until the handlebar has loaded. Is this possible? Thanks.
has comment: http://stackoverflow.com/comment/38825790
type: UnansweredQuestion
has title: Load an Ember.JS template once it has been requested by the user (i.e. a link serving that template has been clicked)?
tagged with: handlebars.js
has answer: http://stackoverflow.com/a/24973146
has comment: http://stackoverflow.com/comment/38818592
type: Question
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38909592
type: Comment
has text: That makes sense, I think, but when I stop escaping the quotes and use the code as you suggest, the broken imgs disappear.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25020466

http://stackoverflow.com/comment/38873849
type: QuestionComment
comment on: http://stackoverflow.com/q/25001771
score: 0
has text: why is it `_styles` instead of `styles`? might be erroring because it thinks this is a mixin.
type: Comment

http://stackoverflow.com/a/24994690
has body: You need to push, the results in the collection and not override them var stringList=["a","b","c"]; var collection = [] for (var i=0; i&lt;stringList.length; i++){ collection.push({"existingStrings": stringList[i]}); }
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24994605
upvote count: 1

http://stackoverflow.com/q/24944753
has title: Animate div on hover and mouseleave with delay
type: AnsweredQuestion
has body: I have the blue div which should be animated on hover over the green div. So if you keep the cursor on the green div long enough, the blue div expands. When you move the cursor away, the blue div goes back to it's original size. But if you just move the mouse quickly over the green div, nothing should happen. This part of this behavior is exactly what my question is. How to solve it? http://jsfiddle.net/H435A/ $('#c').hover(function(){ $('#nav').delay(150).animate({'top':'-=10px', 'left':'-=10px', 'width':'+=20px', 'height':'+=20px', 'background-color':'orange'}, {duration : 200}); }, function() { $('#nav').stop(true).delay(150).animate({'top':'+=0px', 'left':'+=0px', 'width':'-=0px', 'height':'-=0px', 'background-color':'blue'}, {duration : 200}); }); $('#c').mouseleave(function(){ $('#nav').animate({'top':'+=10px', 'left':'+=10px', 'width':'-=20px', 'height':'-=20px', 'background-color':'blue'}, {duration : 100}); });
score: 0
tagged with: jquery-hover
type: Question
tagged with: jquery-animate
tagged with: function
has answer: http://stackoverflow.com/a/24944927
tagged with: javascript
tagged with: jquery
answer count: 2
accepted answer: http://stackoverflow.com/a/24944927
possible better answer: http://stackoverflow.com/a/24944999
has answer: http://stackoverflow.com/a/24944999

http://stackoverflow.com/comment/38829391
has text: @thefourtheye {"towns":[{"Tid":"2057277", "Tname":"York"},{"Tid":"2057575", "Tname":"Yanchep"}]}
type: Comment
comment on: http://stackoverflow.com/q/24978288
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38986848
type: Comment
type: QuestionComment
score: 7
has text: Local documents have no protocol, so you need to supply one for jQuery: ` `
comment on: http://stackoverflow.com/q/25061819

http://stackoverflow.com/comment/38767480
type: QuestionComment
comment on: http://stackoverflow.com/q/24944675
has text: it's the equivalent of removing the if statement, without the side effect of not being able to go back if you don't have version control. (if you don't have version control, get version control.)
score: 0
type: Comment

http://stackoverflow.com/comment/38876111
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25003087
type: Comment
has text: Filter is for DOM element. What you really want to use is [`jQuery.grep()`](http://api.jquery.com/jquery.grep/)

http://stackoverflow.com/q/25014010
answer count: 2
possible better answer: http://stackoverflow.com/a/25014051
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25014034
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25014051
has answer: http://stackoverflow.com/a/25014034
type: Question
tagged with: javascript
has body: I'm learning AngularJS with WebStorm JetBrains, I have this very sample app, but it's not showing the array in the page when I press Debug button (it's open a webpage in Chrome like that: http://localhost:63342/example/index.html I'm using the Plugin Connector for Chrome and I don't have errors in the Chrome console. Where is my error? Link to Fiddle HTML (index.html) {{person.firstName}} JS (app.js) var webStorm = angular.module("webStorm", []); webStorm.controller("webStormController", function(){ var ws = this; ws.people = [{firstName: "John", lastName: "Smith"}]; console.log(ws.people); ws.showPerson = function (person) { console.log(person); } }) Thanks!
has title: Angular js very simple example
score: 0

http://stackoverflow.com/comment/38897108
type: Comment
has text: Sure. It can help with closed user groups. Most people however do have Flash on IE also. Using the Flash polyfill allows you to avoid HTTP long-poll based fallbacks.
comment on: http://stackoverflow.com/a/25014040
type: AnswerComment
score: 0

http://stackoverflow.com/a/25035468
has comment: http://stackoverflow.com/comment/38969850
upvote count: 1
type: AcceptedAnswer
has body: when you call dotdotdot() it is to early stage to calculate domElements. I wired thing to a button click and it is working. http://jsfiddle.net/6HKJZ/5/ I don't know when you call it exactly but try jquery dom ready event $(function(){ //Your code }); if this does not work try to call it little bit later with a setTimeout
type: Answer
answers question: http://stackoverflow.com/q/25034141
downvote count: 0
score: 1
accepted answer of: http://stackoverflow.com/q/25034141

http://stackoverflow.com/comment/38813339
type: QuestionComment
has text: Seeing at this code seems like it's programmed to be triggered on clicking instead of hovering.
type: Comment
comment on: http://stackoverflow.com/q/24969777
score: 0

http://stackoverflow.com/q/24981752
has body: This question is come up with Component Example from the homepage of Ember.js, here's the code: App.GravatarImageComponent = Ember.Component.extend({ size: 200, email: '', gravatarUrl: function() { var email = this.get('email'), size = this.get('size'); return 'http://www.gravatar.com/avatar/' + hex_md5(email) + '?s=' + size; }.property('email', 'size') }); When I try this example I noticed that everytime I input a character the browser will fire a request to get the avatar. If my email address have 30 characters, there will be 30 times requests got fired until the right one was returned from the server. I think this is too inefficient, isn't it? After digging out the guides, I didn't find there is a way to solve this problem, so I was wondering: is this possible to delay re-compute a computed property for, say, like 1000ms? or is there a better way to deal with this type of scenario?
favorite count: 0
has title: How to delay computed properties to recomputed themselves in Ember.js?
tagged with: ember.js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24982951
possible better answer: http://stackoverflow.com/a/24983040
has answer: http://stackoverflow.com/a/24983040
type: Question
score: 4
accepted answer: http://stackoverflow.com/a/24982951
upvote count: 4
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/38952558
type: Comment
comment on: http://stackoverflow.com/a/25028307
type: AnswerComment
has text: What do you mean by Namespace support in JSX? Got any 1 liners to quickly explain. Thanks -))
score: 0

http://stackoverflow.com/a/25052791
answers question: http://stackoverflow.com/q/25052667
has body: If all the data are static,You dont need the form at all. call an ajax page on page load (document.ready()) and in the ajax page you just insert your data to the database table
score: 0
type: Answer

http://stackoverflow.com/a/24993873
downvote count: 0
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24993685
type: Answer
has body: There were many problems in your code. 1) Assigning result out of the function. Last line. 2) You should be using result.push(3*i); not result[i]=3*i. 3) if You don't initialize variable sum it will be undefined and undefined+10=NaN Try this function myFunc() { var result = []; var sum=0; for(var i = 1; i &lt; document.getElementById('number').value; i++) { if(3*i &lt; document.getElementById('number').value) { result.push(3*i); } if(5*i &lt; document.getElementById('number').value) { result.push(5*i); } } for(i = 0; i &lt; result.length; i++) { sum += (result[i]); } document.getElementById("answers").innerHTML = sum; }

http://stackoverflow.com/comment/38998643
type: QuestionComment
comment on: http://stackoverflow.com/q/25067816
has text: If this is a learning experience, you're off to a good start. If you're just trying to get this done, you're re-inventing the wheel. There are plenty of plugins that do all kinds of filtering. JQuery DataTables is my personal favorite.
score: 0
type: Comment

http://stackoverflow.com/a/24981432
has body: Try out the following: .d1 { float: right; background: blue; color: white; } .d2 { background: orange; float: left; } @media screen and (max-width: 768px) { .d1, .d2 { float: none; display: block; } } By the way: You don't need inline-block on your divs. Inline-block is an alternative to floating. So either use floating or inline-block. I'm not a fan of inline-block because IE6 and IE7 don't support it.
score: 1
answers question: http://stackoverflow.com/q/24981280
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38852302
downvote count: 0

http://stackoverflow.com/q/24959093
type: Question
favorite count: 0
tagged with: orientation
tagged with: d3.js
upvote count: 1
answer count: 1
has comment: http://stackoverflow.com/comment/38793409
has comment: http://stackoverflow.com/comment/38798832
has body: js treemap that updates and re-renders when I receive new data. I have built on a data set of 50 elements and it works great. However, I am trying to run the same code on a much larger dataset 10,000 elements. And it seems to be unable to render the graphic, does anybody know of any examples of d3.js working on large data sets, or does anybody have any suggestions? Also, when I do graph the maps, sometimes they shift position, and it seems like the orientation of the elements is messed up because they move outside the chart or overlap with another element, leaving whitespace in the throughout the graph, but after re-rendering the graph usually corrects itself, and then messes up again. I think the problem comes about because the graph is resizing itself with regards to absolute positions, but rects in certain positions from the previous render are messing things up. Any clue how to stop this intermediate phase of having a messed up graph before being able to re-render? Thanks. This is the code I use to initially draw the d3 regraph. function drawTreeMap(array1,array2, colorArray) { console.log("got to drawing"); var cellMargin=5; this.marginTree = {top:20, right:20, bottom:20, left:20}; var coloring = d3.scale.linear() .range(['lightblue', 'green']) // or use hex values .domain([this.getMinOfThisArray(colorArray), this.getMaxOfThisArray(colorArray)]); this.nestedJson = this.createObj(array1, array2, colorArray); this.w = 1700 - 80, this.h = 980 - 180, this.x = d3.scale.linear().range([0, this.w]), this.y = d3.scale.linear().range([0, this.h]), this.root, this.node; this.treemap = d3.layout.treemap() .round(false) .size([this.w, this.h]) .sticky(true) .padding([this.marginTree.bottom, this.marginTree.right, this.marginTree.top, this.marginTree.left]) .sort(function(a,b) { return a.value - b.value; }) .value(function(d) { return d.size; }); this.svg = d3.select("#body").append("div") .attr("class", "chart") .style("position", "relative") .style("width", (this.w) + "px…
type: UnansweredQuestion
tagged with: treemap
has answer: http://stackoverflow.com/a/24959203
downvote count: 0
tagged with: javascript
score: 1
has title: d3.js treemap with 10,000 nodes

http://stackoverflow.com/a/25023348
type: AcceptedAnswer
downvote count: 1
has body: I ended up solving this by using the following <xsl:variable name="empty" select="''"/> <xsl:value-of select="$empty"/> <xsl:value-of select="$empty"/> <xsl:value-of select="$empty"/>
type: Answer
has comment: http://stackoverflow.com/comment/38919885
has comment: http://stackoverflow.com/comment/38944231
answers question: http://stackoverflow.com/q/25021963
accepted answer of: http://stackoverflow.com/q/25021963
score: 0
upvote count: 1

http://stackoverflow.com/comment/38913667
type: AnswerComment
has text: Good job! The other thing is when you click to the select and you choose another select without choose an option in the first one, both will display options, how can I fix that?
score: 0
comment on: http://stackoverflow.com/a/25006979
type: Comment

http://stackoverflow.com/q/24984603
tagged with: raphael
type: Question
has comment: http://stackoverflow.com/comment/38850200
tagged with: javascript
tagged with: jquery
has body: This image is what I am trying to achieve. Circles on the edges are clickable. Its structure is made such that each rotation will be multiple of 45 deg. I am using css transform rotate property for rotation. How is it supposed to work? When we click on any circle on the edge it should come to its active position and it should always rotate in clockwise direction. Here is what I did I achieved rotation by assigning numbers to the circles. i.e., if clicked on 7 number then it will rotate by angle (9-7)*45=90 degrees. (This time I did not change the numbers dynamically. i.e., as the circle is rotating the numbers given to the circles are the same.) This works fine here. But, lets see this scenario: when we click on 2nd position circle it will rotate by 315 deg and then if you click again on the same (second) position then it will make the angle of 270 and it rotates the div in anti-clockwise direction. I think this is its behavior. But, I don't want this to happen. It should rotate again in clockwise direction and should take the active position. Now to achieve above I did this: Adding angle with prev angle. var prev_degree = prev_degree + current_degree; (current degree is being calculated using the same formula from above.) This time I changed numbers dynamically i.e., on each click numbers are given to the desired positions. Starting 1 as from Active position till 8 as shown in Image But this time, when I rotate circle 1, 2 times it rotates perfect then it starts working strange. If you are constantly clicking on the same number then it will add the same angle and will keep rotating perfect no matter what your angle is. If you click on random circles then it wont work which is totally wrong. Why clockwise? Because the circles on edges, they contain icon of which I have to maintain position when whole circle rotates.(I can achieve that rotating circles on the edges by assigning negative angles. But, now this is not a problem.) There is no case when I am getting negat…
has comment: http://stackoverflow.com/comment/38850102
has comment: http://stackoverflow.com/comment/38847385
tagged with: css
has comment: http://stackoverflow.com/comment/38846774
has title: How to rotate div in circular motion while counter rotating inner circles?
tagged with: geometry
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/38843214
has comment: http://stackoverflow.com/comment/38860622
linked to: http://stackoverflow.com/q/18541324
has comment: http://stackoverflow.com/comment/38860332

http://stackoverflow.com/a/24933367
downvote count: 0
has body: Not sure why, but it doesn't work for me too if secure: true option used in res.cookie('number', req.body.number, {secure: true, httpOnly: true, maxAge: 1209600000}) Don't use it and it's going to work... I guess using it needs a TLS connection established....
type: Answer
has comment: http://stackoverflow.com/comment/69448791
upvote count: 6
score: 6
accepted answer of: http://stackoverflow.com/q/24932616
answers question: http://stackoverflow.com/q/24932616
has comment: http://stackoverflow.com/comment/69392685
type: AcceptedAnswer

http://stackoverflow.com/q/24960472
has answer: http://stackoverflow.com/a/24960842
has answer: http://stackoverflow.com/a/24960571
accepted answer: http://stackoverflow.com/a/24960571
tagged with: http://stackoverflow.com/tag/html
has title: hide/unhide HTML portions by hovering?
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/38795904
has answer: http://stackoverflow.com/a/24960669
type: AnsweredQuestion
type: Question
linked to: http://stackoverflow.com/q/5210033
has answer: http://stackoverflow.com/a/24960551
possible better answer: http://stackoverflow.com/a/24960842
has comment: http://stackoverflow.com/comment/38795878
tagged with: javascript
has comment: http://stackoverflow.com/comment/38796033
score: 0
has comment: http://stackoverflow.com/comment/38795950
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38795888
favorite count: 0
has body: more precisely, I've seen websites where there's a kind of header image, which loops through 3-4 different images, and each image is referenced by a dot, and you can pick the image you want by clicking the dot as well. I'm sure everyone has seen this somewhere. as an example, go to http://www.tsunamitsolutions.com/ my question is, how do I make these dots appear/disappear when I hover on the image (like on the site I shared above) is it javascript or can this be accomplished just in the CSS with the "hover" style. In other words, can hovering over one html portion/div/section make another div/section appear/disappear just by using CSS?

http://stackoverflow.com/q/24980850
has comment: http://stackoverflow.com/comment/38834157
has comment: http://stackoverflow.com/comment/38834155
has comment: http://stackoverflow.com/comment/38834002
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24981532
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38833994
has comment: http://stackoverflow.com/comment/38834001
has comment: http://stackoverflow.com/comment/38834199
has body: I'm currently writing a little chrome extension to modify an existing site. I try to modify one div element if the child contains an attribute with the value (for example red, blue, ...). If the child contains a value with the attribute value red I want the parent div colored in red and so on. I've worte this JS: //find the parent div element element = element.getElementsByClassName("existing-class-to-find-div")[0]; // check if the attribute from the child is blue ... if (color == blue){ element.className += " RedColorClass"; } if I printout the elmenent with element.outerHTML or the className everything is fine and I see the new value. BUT on the actual site there is still the old value and it isn't changed. Do I have to trigger something to refresh the html site or so?
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
score: 0
has title: Modify css class with Javascript doesn't work
has answer: http://stackoverflow.com/a/24980883
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/38854161
has text: oh,if I get content html from url via ajax,and have some url I get error "Access-Control-Allow-Origin".I try to fix but I can not fix
comment on: http://stackoverflow.com/a/24991424
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/q/25035717
tagged with: pybossa
has answer: http://stackoverflow.com/a/25055844
answer count: 1
downvote count: 0
favorite count: 0
score: 8
upvote count: 8
accepted answer: http://stackoverflow.com/a/25055844
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39846032
has body: I am trying to set up a project on CrowdCrafting.org by using the PyBOSSA framework. I followed their tutorial for project development. The first parts seemed very clear to me, creating the project and adding the tasks worked fine. Then I built my own HTML webpage to present the task to the users. Now the next step would be to load the tasks from the project, present them to the users, and save their answers. Unfortunately, I don't understand how to do this. I will try to formulate some questions to make you understand my problem: How can I try this out? The only way seems to be by updating the code and then running pbs update_project Where can I find documentation for PyBossa.js? I just saw (in the tutorial and on other pages) that there are some functions like pybossa.taskLoaded(function(task, deferred){}); and pybossa.presentTask(function(task, deferred){});. But I don't know how they work and what else there is. This page looks like it would contain some documentation, but it doesn't (broken links or empty index). How do I use the library? I want to a) load a task, b) present it to the user, c) show the user his progress, and, d) send the answer. So I think I'll have to call 4 different functions. But I don't know how. Looking at the example project's code, I don't understand what this stuff about loading disqus is. I think disqus is a forum software, but I am not sure about that and I don't know what this has to do with my project (or theirs). As far as I understand, the essential parts of the JS-library are: pybossa.taskLoaded(function(task, deferred) { if ( !$.isEmptyObject(task) ) { deferred.resolve(task); } else { deferred.resolve(task); } }); pybossa.presentTask(function(task, deferred) { if ( !$.isEmptyObject(task) ) { // choose a container within your html to load the data into (depends on your layout and on the way you created the tasks) $("#someID").html(task.info.someName); // by clickin "next_button" save answer and load next task $("#next_button").c…
type: Question
has title: PyBossa loading and presenting tasks
tagged with: javascript

http://stackoverflow.com/comment/38730541
comment on: http://stackoverflow.com/q/24925509
score: 0
type: Comment
type: QuestionComment
has text: I suppose you included the slider library before `jQuery`... If thats the case, switch the references, so that `jQuery` is included first.

http://stackoverflow.com/a/25035138
score: 0
answers question: http://stackoverflow.com/q/25035006
type: Answer
has comment: http://stackoverflow.com/comment/38936208
has body: instead of click event use change event for all check checbox. on change will fire after changing to new value and this.checked will give you correct value : $('#allcheck').change(function() { var checkedStatus = this.checked; $('table tbody').find('input[type="checkbox"]').each(function () { $(this).prop('checked', checkedStatus); }); });
has comment: http://stackoverflow.com/comment/38936261

http://stackoverflow.com/comment/38940771
type: Comment
has text: map is essentially a loop too, but whatever :p
comment on: http://stackoverflow.com/a/25037575
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38713968
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24916332
has text: Nice, that's what I was looking for and @lpg has the same solution, I'll upvote. I didn't want to have an unnecessary conditional, thanks for this regex change.

http://stackoverflow.com/q/25025819
tagged with: mysql
type: Question
accepted answer: http://stackoverflow.com/a/25025973
has title: How to create a wildcard search function using MySQL and PHP
tagged with: javascript
tagged with: wildcard
has comment: http://stackoverflow.com/comment/38919368
has answer: http://stackoverflow.com/a/25025880
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25025876
has body: Currently I'm editng some PHP/Javascript codes for a database website that uses MySQL to store it's data. As of now, if I search for something in an input data line entry box, the search results pulled from MySQL will show up. However, I'd like to input a wildcard function, such that if I input 'EXAMPLE *' the search results will pull up data that contain the words EXAMPLE. The code I'm editing currently uses this to pull up search results from MySQL: &lt;?php $query = "SELECT * FROM database.table"; echo $_GET['DATA1']; if(($_GET['DATA1'] === "") &amp;&amp; ($_GET['DATA2'] === "")) { } else { $query .= " where 1=1 "; $query .= ($_GET['DATA1'] === "") ? '' : ' and DATA1A = "'.$_GET['DATA1'].'"'; $query .= ($_GET['DATA2'] === "") ? '' : ' and DATA2A = "'.$_GET['DATA2'].'"'; } $result=mysql_query($query); while ($row=mysql_fetch_row($result)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;".$row[0]."&lt;/td&gt;"; echo "&lt;td&gt;".$row[1]."&lt;/td&gt;; ?&gt; I'm not that familiar with PHP, could someone please explain what the above code is doing (specifically the '$query .=' part), and how I could change it so a Wildcard functionality could work? Thank you! (Also, I left out some html code on column headers since they weren't really relevant).
possible better answer: http://stackoverflow.com/a/25025876
has answer: http://stackoverflow.com/a/25025973
tagged with: php
type: AnsweredQuestion

http://stackoverflow.com/comment/38752991
has text: @RaulGuiu - eval is evil, it's not a very good answer, and the real answer is that OP shouldn't do this at all.
score: 1
comment on: http://stackoverflow.com/q/24937572
type: QuestionComment
type: Comment

http://stackoverflow.com/q/24931136
has comment: http://stackoverflow.com/comment/38740903
tagged with: jquery-ui
has title: Jquery dialog sliding
accepted answer: http://stackoverflow.com/a/24982449
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0
type: Question
has body: http://jsfiddle.net/G5RP3/ I have made a div be a dialog through jQuery UI. It is empty at the moment, but what I want to do is make it slide from left to center, from outside the window. What it does instead, is it slides like a drawer is opened. I think I am close, but not sure how to do it. JS var speed = 2000; $(document).ready(function () { $('#loginmenu').dialog({ show: { effect: 'slide', direction: 'left', speed: speed }, hide: { effect: 'slide', direction: 'left', speed: speed }, modal: true }); }); HTML &lt;div id="loginmenu"&gt;&lt;/div&gt; CSS #loginmenu { }
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38836886
has comment: http://stackoverflow.com/comment/38836894
has answer: http://stackoverflow.com/a/24982449
upvote count: 1
answer count: 1

http://stackoverflow.com/q/25027813
has answer: http://stackoverflow.com/a/25254797
linked to: http://stackoverflow.com/q/22184747
type: AnsweredQuestion
has body: Im stuck on a problem and would appreciate any help. I have read through lot of the discussions already but they dont seem to work for me. //I have a date as a string which I want to get to a date format of dd/MM/yyyy var collectionDate = '2002-04-26T09:00:00'; //used angularjs date filter to format the date to dd/MM/yyyy collectionDate = $filter('date')(collectionDate, 'dd/MM/yyyy'); //This outputs 26/04/2002 as a string How do I convert it to a date object? The reason I want to do this is because I want to use it in a google charts directive where one of the columns has to be a date. I do not want to have the column type as string: eg: var data = new google.visualization.DataTable(); data.addColumn('date', 'Dates'); data.addColumn('number', 'Upper Normal'); data.addColumn('number', 'Result'); data.addColumn('number', 'Lower Normal'); data.addRows(scope.rows);.................
upvote count: 26
has answer: http://stackoverflow.com/a/36986574
type: Question
score: 26
has title: AngularJS/javascript converting a date String to date object
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25254797
tagged with: date
has answer: http://stackoverflow.com/a/35310585
has answer: http://stackoverflow.com/a/29217284
favorite count: 0
tagged with: angularjs
possible better answer: http://stackoverflow.com/a/29217284
answer count: 4

http://stackoverflow.com/comment/38996956
score: 0
comment on: http://stackoverflow.com/q/25066155
type: Comment
type: QuestionComment
has text: `the graph keeps on going to a different page. ` what is the url you get when the graph is shown ?

http://stackoverflow.com/q/24923667
has comment: http://stackoverflow.com/comment/38727099
has answer: http://stackoverflow.com/a/24923696
upvote count: 1
possible better answer: http://stackoverflow.com/a/24923719
has body: I am trying to setup a constants file for one of my sites. I am trying to set it up so I can get string constants when needed. What I have so far (Not working, kind of C# ish) var Constants = new SiteConstants(); function SiteConstants() { this.Training = function Training() { this.Staff = function Staff() { this.fetch = "someurl"; } } } console.log(Constants.Training().Staff().fetch); //Fail - what i want to call //or something similar like Constants.Training.Staff.fetch console.log((new Constants.Staff()).fetch); //Success Is this possible in JavaScript, and if not, can someone suggest an alternative?
type: Question
has title: Objects within Objects in JavaScript
has answer: http://stackoverflow.com/a/24923719
type: AnsweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38727075
has answer: http://stackoverflow.com/a/24923710
has comment: http://stackoverflow.com/comment/38954867
has answer: http://stackoverflow.com/a/24923724
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38727083
favorite count: 0
has answer: http://stackoverflow.com/a/24923730
accepted answer: http://stackoverflow.com/a/24923710
answer count: 5

http://stackoverflow.com/comment/38846663
type: Comment
comment on: http://stackoverflow.com/q/24985374
has text: What is an "XML-like syntax"? HTML is 'XML-like', SGML language with enough `<` and `>` characters in is 'XML-like'. Without a clearer understanding of your syntax this is too broad to answer.
score: 0
type: QuestionComment

http://stackoverflow.com/a/24976057
answers question: http://stackoverflow.com/q/24943956
score: 4
has body: As the aptly named Jason P points out in the comments above, you can use polymer-jsonp here.
type: AcceptedAnswer
type: Answer
upvote count: 4
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24943956

ruby-on-rails
tags question: http://stackoverflow.com/q/24969627
type: Tag
tags question: http://stackoverflow.com/q/25067288
tags question: http://stackoverflow.com/q/24949493
tags question: http://stackoverflow.com/q/24942389
tags question: http://stackoverflow.com/q/24937838
tags question: http://stackoverflow.com/q/24985077
tags question: http://stackoverflow.com/q/24976703
tags question: http://stackoverflow.com/q/25059028
tags question: http://stackoverflow.com/q/25066150
tags question: http://stackoverflow.com/q/24945284
tags question: http://stackoverflow.com/q/25055641
tags question: http://stackoverflow.com/q/25019885
tags question: http://stackoverflow.com/q/24962649
tags question: http://stackoverflow.com/q/24942005
tags question: http://stackoverflow.com/q/24966001
tags question: http://stackoverflow.com/q/24983142
tags question: http://stackoverflow.com/q/24930304
tags question: http://stackoverflow.com/q/24978410
tags question: http://stackoverflow.com/q/25022763
tags question: http://stackoverflow.com/q/25032621
tags question: http://stackoverflow.com/q/24958831
tags question: http://stackoverflow.com/q/25062184
tags question: http://stackoverflow.com/q/24990283
tags question: http://stackoverflow.com/q/25065774
tags question: http://stackoverflow.com/q/24965656
tags question: http://stackoverflow.com/q/24939320
tags question: http://stackoverflow.com/q/25026659
tags question: http://stackoverflow.com/q/24972452
tags question: http://stackoverflow.com/q/24992310
tags question: http://stackoverflow.com/q/24918488
tags question: http://stackoverflow.com/q/24945381
tag name: ruby-on-rails
tags question: http://stackoverflow.com/q/24974478
tags question: http://stackoverflow.com/q/24999422
tags question: http://stackoverflow.com/q/24968352
tags question: http://stackoverflow.com/q/24937295
tags question: http://stackoverflow.com/q/25044428
tags question: http://stackoverflow.com/q/24986962
tags question: http://stackoverflow.com/q/24980844
tags question: http://stackoverflow.com/q/25018340
tags question: http://stackoverflow.com/q/24976253
tags question: http://stackoverflow.com/q/24945728
tags question: http://stackoverflow.com/q/24960336
tags question: http://stackoverflow.com/q/24966674
tags question: http://stackoverflow.com/q/24929281
tags question: http://stackoverflow.com/q/25038637
tags question: http://stackoverflow.com/q/24922499
tags question: http://stackoverflow.com/q/25012851
tags question: http://stackoverflow.com/q/25033969
tags question: http://stackoverflow.com/q/25020453
tags question: http://stackoverflow.com/q/24920546
tags question: http://stackoverflow.com/q/24923366
tags question: http://stackoverflow.com/q/24934256
tags question: http://stackoverflow.com/q/24967990
tags question: http://stackoverflow.com/q/25002013
tags question: http://stackoverflow.com/q/25041068
tags question: http://stackoverflow.com/q/25045681
tags question: http://stackoverflow.com/q/24942380
tags question: http://stackoverflow.com/q/24961745
tags question: http://stackoverflow.com/q/25056344

http://stackoverflow.com/comment/38902726
comment on: http://stackoverflow.com/q/25017088
type: QuestionComment
score: 1
has text: Consider moving the shared code into a service and load the functionality on the scope in both controllers, so that you can use it in the views.
type: Comment

http://stackoverflow.com/a/24954405
has body: Here is a way to loop through the array recursively: http://jsfiddle.net/yLnZe/37/ var arrPages = [{ name: 'one', link: 'blah/blah', pages: [{ name: 'one A', link: 'blah/blah', pages: [] }, { name: 'one B', link: 'blah/blah', pages: [] }, { name: 'one C', link: null, pages: [{ name: 'one C I', link: 'blah blah', pages: [] }] }] }]; function recursiveFunction(collection){ _.each(collection, function(model){ console.log(model); if(model.pages.length &gt; 0){ recursiveFunction(model.pages); } }); }; recursiveFunction(arrPages); Is this what you need, or do you need anything more specifically? Based on your last comments, I'm a bit confused if you need anything else.
accepted answer of: http://stackoverflow.com/q/24953697
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24953697
downvote count: 0
score: 13
type: Answer
upvote count: 13

http://stackoverflow.com/q/24987899
has answer: http://stackoverflow.com/a/24987930
type: AnsweredQuestion
has body: In my Angularjs app, i am trying to catch the $q.reject in one of the promise block and unable to do so. In below code i have rejected the response if the response returns empty data and i need to catch that rejected response in one of the promise block and do some redirection using $state. Currently it is not going into the error block from success block on $q.reject(). Is there a way to catch the $q.reject into promise block?? x.retrieve=function(id){ return $http.get(url); } var promise=x.retrieve(id); promise.then( function(response){ if($.isEmptyObject(response.data)){ return $q.reject(response); } y.push({x:a}); },function (rejection) { $state.go("detail"); } ); Any help will be appreciated. Thank you.
has comment: http://stackoverflow.com/comment/38848238
type: Question
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24987930
score: 2
has title: AngularJS- catch $q.reject in promise.then block
downvote count: 0
answer count: 1
favorite count: 0
tagged with: angularjs
upvote count: 2

http://stackoverflow.com/comment/38887731
type: Comment
comment on: http://stackoverflow.com/q/25009258
has text: You are looping and override the underlying `html` content, so will display only last message.
score: 0
type: QuestionComment

http://stackoverflow.com/a/24967877
score: 27
upvote count: 27
has comment: http://stackoverflow.com/comment/38811107
type: AcceptedAnswer
downvote count: 0
has body: You are adding single quotes to your selector, selectors don't use quotes: $("'" + hash + "'").modal('toggle'); should be $(hash).modal('toggle'); Also you might not be waiting for the dom to be ready to use. If you do not have that script at the bottom of the page or at least below where your modal html is, it won't be found as it is not created yet. &lt;script&gt; //shortcut for $(document).ready $(function(){ if(window.location.hash) { var hash = window.location.hash; $(hash).modal('toggle'); } }); &lt;/script&gt;
has comment: http://stackoverflow.com/comment/38811228
type: Answer
has comment: http://stackoverflow.com/comment/38810132
answers question: http://stackoverflow.com/q/24967735
has comment: http://stackoverflow.com/comment/38810102
accepted answer of: http://stackoverflow.com/q/24967735
has comment: http://stackoverflow.com/comment/38811364

http://stackoverflow.com/comment/38863774
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24996112
has text: @user1081463: Ah, yeah, already got worried I was 'walking behind the facts' as we Dutch would say :P . Either way, there indeed is no way to get an event when the user installs the application (and resolution checking is quite unreliable on android after the fact either way).
score: 0

http://stackoverflow.com/comment/38941319
type: QuestionComment
comment on: http://stackoverflow.com/q/25037346
has text: Here is the error message: XMLHttpRequest cannot load http://www.geocodefarm.com/api/forward/json/xxxxxxxxxxxxapicodexxxxxxxxxxxxx/london. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access.
score: 0
type: Comment

http://stackoverflow.com/a/25038149
has comment: http://stackoverflow.com/comment/38941990
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38941856
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38941920
answers question: http://stackoverflow.com/q/25038045
has body: "...when i got to php file to see ..." Heres the probem. Php is stateless, visiting the php page is a new request, completely seperate from the ajax request. To see the output from the php file in response to the ajax request, use the success callback: success: function (result) { alert(result); } Also, as noted in comments, the dataset variable does not appear to be defined, but if you are seeing the results you suggest in network tab, i guess you just omitted that from your question
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25038045
score: 1

http://stackoverflow.com/q/24962083
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38799247
has comment: http://stackoverflow.com/comment/38799718
score: -4
has comment: http://stackoverflow.com/comment/38799797
possible better answer: http://stackoverflow.com/a/24962156
has comment: http://stackoverflow.com/comment/38799338
has comment: http://stackoverflow.com/comment/38799101
has answer: http://stackoverflow.com/a/24962156
has comment: http://stackoverflow.com/comment/38799556
type: Question
has title: JS validation and PHP validation
has answer: http://stackoverflow.com/a/24962345
linked to: http://stackoverflow.com/q/4227043
has comment: http://stackoverflow.com/comment/38799431
tagged with: javascript
tagged with: forms
has comment: http://stackoverflow.com/comment/38800005
answer count: 2
downvote count: 4
tagged with: validation
upvote count: 0
has comment: http://stackoverflow.com/comment/38799623
favorite count: 0
has comment: http://stackoverflow.com/comment/38799839
has comment: http://stackoverflow.com/comment/38799873
accepted answer: http://stackoverflow.com/a/24962345
has body: This is my site Liquid Layouts . The issue i am having is on the register and page, the validation with JS before PHP. I never learned JS, i went PHP route after CSS and every time i put in a JS validation, it will either still proceed to PHP after error or just not pass on to the PHP page if no errors are detected. All i really want is a definitive answer on what will allow the JS validation to kill process on error and pass to PHP process if all is right

http://stackoverflow.com/comment/38898197
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25014600
has text: @Spike I'm not sure why you feel the need to loop through an array of objects, when you just have two objects, `data` and `resource`. See my answer and let me know if that doesn't work and I'm misunderstanding what you are trying to do.
type: Comment

http://stackoverflow.com/q/25022426
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has body: I need your help, Without using long and code resource intensive jQuery and Javascript context menu plugins, how can one, just using plain & simple jQuery code to basically take my div (which has the id: 'right-click-menu') and bind a right click action to the other div which had the id: box1? Here is a fiddle: http://jsfiddle.net/ALAHX/ Here is the HTML markup: option1 option2 option3 option4
has answer: http://stackoverflow.com/a/25022639
score: 0
has comment: http://stackoverflow.com/comment/38913029
has comment: http://stackoverflow.com/comment/38913174
accepted answer: http://stackoverflow.com/a/25022713
has comment: http://stackoverflow.com/comment/38912998
has answer: http://stackoverflow.com/a/25022713
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25022639
has title: Making a custom right click menu and binding it to a right click inside of another div
has comment: http://stackoverflow.com/comment/38912907

http://stackoverflow.com/comment/38939811
type: Comment
comment on: http://stackoverflow.com/a/24995286
score: 0
type: AnswerComment
has text: Can we see the contents of the php file?

http://stackoverflow.com/comment/38830630
type: QuestionComment
comment on: http://stackoverflow.com/q/24978948
has text: Have you tried anything for this?
score: 0
type: Comment

http://stackoverflow.com/q/24934127
answer count: 6
favorite count: 0
possible better answer: http://stackoverflow.com/a/24934290
has answer: http://stackoverflow.com/a/24934290
score: 3
tagged with: css
has answer: http://stackoverflow.com/a/47072839
has answer: http://stackoverflow.com/a/24934573
tagged with: angularjs
upvote count: 3
has answer: http://stackoverflow.com/a/24934877
has answer: http://stackoverflow.com/a/24934213
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24934588
linked to: http://stackoverflow.com/q/16879212
accepted answer: http://stackoverflow.com/a/24934573
has title: Creating a custom attribute with AngularJS
type: Question
has body: I'm new to AngularJS. I'm trying to write a directive that will set the background-color of a based on some scenario. Essentially, in my view, I want to be able to write this code: content here or content here I know I need a directive. Currently, I'm doing this: .directive('effectColor', [ function () { return { restrict: 'A', controller: [ '$scope', '$element', '$attrs', '$location', function ($scope, $element, $attrs, $location) { // how do I get the value of effect-color here? } ] } } ]); I'm not sure how to get the value of the attribute itself. Do I need to add a scope? I just want the attribute value. Thank you!
downvote count: 0
tagged with: javascript

datepicker
tags question: http://stackoverflow.com/q/25003332
tags question: http://stackoverflow.com/q/25017960
tags question: http://stackoverflow.com/q/24933797
tags question: http://stackoverflow.com/q/24931135
tags question: http://stackoverflow.com/q/25048420
tags question: http://stackoverflow.com/q/25005923
tag name: datepicker
tags question: http://stackoverflow.com/q/24981072
type: Tag
tags question: http://stackoverflow.com/q/24961765
tags question: http://stackoverflow.com/q/25031083
tags question: http://stackoverflow.com/q/25033917
tags question: http://stackoverflow.com/q/25060173
tags question: http://stackoverflow.com/q/24914366
tags question: http://stackoverflow.com/q/25031240
tags question: http://stackoverflow.com/q/24914746
tags question: http://stackoverflow.com/q/25011883
tags question: http://stackoverflow.com/q/24955722
tags question: http://stackoverflow.com/q/24989298

http://stackoverflow.com/comment/38935990
type: QuestionComment
type: Comment
has text: You can attach a version to each of your scripts with your server-side language; when new css is uploaded change the version and it should work (or change the css file name)
comment on: http://stackoverflow.com/q/25035101
score: 0

http://stackoverflow.com/q/25040450
has answer: http://stackoverflow.com/a/25040522
possible better answer: http://stackoverflow.com/a/25040492
has comment: http://stackoverflow.com/comment/38946324
has answer: http://stackoverflow.com/a/25040492
has title: Input Box functions not working
type: Question
tagged with: function
tagged with: javascript
has body: I'm a newbie here and in learning coding, so please bear with me... I tried to make a code which gets text from an input box and writes it as an h1 heading. But the code just doesnt work. Please tell me whats wrong... HERE
accepted answer: http://stackoverflow.com/a/25040488
score: 0
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25040488
has comment: http://stackoverflow.com/comment/38946921
tagged with: input
type: AnsweredQuestion

http://stackoverflow.com/q/25048730
tagged with: sails.js
has title: Render a view into HTML
linked to: http://stackoverflow.com/q/24187206
type: UnansweredQuestion
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38962936
tagged with: javascript
has comment: http://stackoverflow.com/comment/38963324
favorite count: 0
tagged with: express
has body: Is there any way to access ExpressJs's raw rendering capabilities without access to the 'res' object? I have several Jade views which I'd like to render into HTML and send over email. There are libraries that do this, but all of them are clunky. Is there no app.render("/directory/file.jade")? I can't seem to find one. I'm using SailsJs, which is Express based, but if there are any sails specific solutions, they would be just as helpful.
type: Question
has comment: http://stackoverflow.com/comment/38963151
tagged with: node.js
upvote count: 2
linked to: http://stackoverflow.com/q/19325608
has answer: http://stackoverflow.com/a/25049210
answer count: 1
has comment: http://stackoverflow.com/comment/39002659

http://stackoverflow.com/a/25020420
score: 9
upvote count: 9
has comment: http://stackoverflow.com/comment/38909282
has comment: http://stackoverflow.com/comment/38909054
has comment: http://stackoverflow.com/comment/38909389
has comment: http://stackoverflow.com/comment/38909136
has comment: http://stackoverflow.com/comment/38909313
type: AcceptedAnswer
downvote count: 0
has body: You have to iterate the array, yes. But you can use map for this specific case: var arr = $("a").map(function () { return $(this).attr('title') }).get(); var csv = arr.join(',');
accepted answer of: http://stackoverflow.com/q/25020341
type: Answer
answers question: http://stackoverflow.com/q/25020341

http://stackoverflow.com/q/24982290
tagged with: javascript
tagged with: jquery
favorite count: 0
has title: Window.load works only after browser tab change
has comment: http://stackoverflow.com/comment/38836723
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38890327
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38854097
score: 1
has answer: http://stackoverflow.com/a/25010685
has comment: http://stackoverflow.com/comment/38849039
has body: I am using flex slider with multiple instance, the first slider works fine, but other slides are only showing correctly after changed browser tab and get back, but second slide's thumbnails show after only changed browser tab again. How can I make them work same time, I mean they should be working when page loads first time. Here is my code ********* EDITED ********** You can see it online here http://goo.gl/cHMaBq First tab (one star) works perfect. There is no image on second tab, please go to another browser tab and return , you will see the slider works, but no thumbnail. Please go to another browser tab again and return, thumbnails will be shown. Thanks
answer count: 1
downvote count: 0

http://stackoverflow.com/comment/38912490
comment on: http://stackoverflow.com/a/25019608
has text: @David - Thanks. Yes the suggestion to move it to a private method works. I would like to check it out further. When I check on the web it seems like this is quite a common problem.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/24927269
tagged with: javascript
has body: When And why use Cursor in your project? If I have this Mock code var mongoClient = require('mongodb').MongoClient; mongoClient.connect('mongodb://localhost:27017/tut3',function(err,db){ if(err)throw err; var collection = db.collection('messages'); collection.find({},{_id:true}).each(function(err,doc){ console.log("---- CLASSIC ----") console.dir(doc); //stuff// }); var cursor = collection.find({},{_id:true}); cursor.each(function(err,doc){ console.log("---- CURSOR ----") console.dir(doc); //stuff2 }); }) The collection messages is huge for example. Which different between //stuffand //stuff2 I know that if I do var cursor = collection.find({},{_id:true}); I Know that when cursor return I Have all the documents (synchronous) and it has many methods, but also inside stuff, the query is complete and I have all Documents... Where is the difference? and when use var cursor instead the "classic" find?
tagged with: mongodb
accepted answer: http://stackoverflow.com/a/24927604
answer count: 1
has comment: http://stackoverflow.com/comment/38733608
tagged with: node.js
score: 0
has answer: http://stackoverflow.com/a/24927604
type: Question
has comment: http://stackoverflow.com/comment/38733710
type: AnsweredQuestion
has title: When Use cursor in Node.js

http://stackoverflow.com/q/24934069
tagged with: jquery
has comment: http://stackoverflow.com/comment/38746243
tagged with: ajax
has title: Will multiple AJAX requests execute in the order they were created?
has comment: http://stackoverflow.com/comment/38746404
has comment: http://stackoverflow.com/comment/38746285
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38747604
has comment: http://stackoverflow.com/comment/38746311
linked to: http://stackoverflow.com/q/4785724
type: Question
has answer: http://stackoverflow.com/a/24934170
tagged with: javascript
has comment: http://stackoverflow.com/comment/38746493
accepted answer: http://stackoverflow.com/a/24934170
has body: In short the question is: jQuery.ajax({ url: some_url, success: function(){ alert('success1'); }, error: function(){ alert('error1'); } }); jQuery.ajax({ url: some_url, success: function(){ alert('success2'); }, error: function(){ alert('error2'); } }); jQuery.ajax({ url: some_url, success: function(){ alert('success3'); }, error: function(){ alert('error3'); } }); Will these always result in: alert('success1'); alert('success2'); alert('success3'); Or can the output be like: alert('success2'); alert('success3'); alert('success1'); Shouldn't I run abort() on previous AJAX requests if I want the last one's output to be displayed to the user only? I mean I don't mind them seeing success1 and success2 messages as long as success3 will be always the last one.
score: 0
has comment: http://stackoverflow.com/comment/38746308
answer count: 1

http://stackoverflow.com/q/25050579
tagged with: http://stackoverflow.com/tag/html
has body: I currently have this setting: tooltip: { isHtml: true, trigger: 'both' }. When I just mouse over a point, I have some other code that repositions the tooltip that appears. The problem is however that when I click on the tooltip and then mouse over another point, a secondary tooltip appears that overlaps the first. What I want is for the user to have to click off the first tooltip before being able to see any others. Also, is it possible for the user to not have to click on the point for the selection to be removed? So the user could click somewhere on the screen or on another point and the tooltips would then either disappear or correctly display the new tooltip. Code that shifts the tooltip //Start of shifting code google.visualization.events.addOneTimeListener(chart, 'ready', function () { var container = document.querySelector('#chart_div &gt; div:last-child'); function setPosition(e) { if (e &amp;&amp; e.target) { var tooltip = $(e.target); setTimeout(function () { tooltip.css('left', 635 + 'px'); tooltip.css('top', 100 + 'px'); }, 1); } else { var tooltip = container.querySelector('.google-visualization-tooltip'); tooltip.style.left = 635 + 'px'; tooltip.style.top = 100 + 'px'; } } if (typeof MutationObserver === 'function') { var observer = new MutationObserver(function (m) { for (var i = 0; i &lt; m.length; i++) { if (m[i].addedNodes.length) { setPosition(); break; // once we find the added node, we shouldn't need to look any further } } }); observer.observe(container, { childList: true }); } else if (document.addEventListener) { container.addEventListener('DOMNodeInserted', setPosition); } else { container.attachEvent('onDOMNodeInserted', setPosition); } }); //End of shifting code An image of what is happening
tagged with: django
type: AnsweredQuestion
has title: Tooltips overlapping - google charts
has answer: http://stackoverflow.com/a/25072887
type: Question
tagged with: google-visualization
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38994920
accepted answer: http://stackoverflow.com/a/25072887
answer count: 1

http://stackoverflow.com/a/25039112
type: Answer
has body: why not simple and smart without js? just remove the hidden type from your quantity input field and change it to text echo '&lt;div class="article"&gt; &lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt; &lt;input type="hidden" name="cmd" value="_xclick"&gt; &lt;input type="hidden" name="business" value="myemail..."&gt; &lt;input type="hidden" name="item_name" value="'.$item.'"&gt; &lt;input name="quantity" class="quantity" value="1"&gt; &lt;input type="hidden" name="amount" value="'.$price.'"&gt; //so on... &lt;/form&gt; &lt;/div&gt;';
accepted answer of: http://stackoverflow.com/q/25038054
answers question: http://stackoverflow.com/q/25038054
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38949626
score: 0

http://stackoverflow.com/a/24972511
answers question: http://stackoverflow.com/q/24972470
has comment: http://stackoverflow.com/comment/38818835
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38818744
has body: The correct syntax for changing background image is as below: $('#element').css("background-image", "url(/myimage.jpg)"); Use: $('#headerwrap').css("background-image", image_array[image_index]); Image array should have : url(/path) and not url('/path') var image_array= ['url(./img/portfolio/img3.jpg)', 'url(./img/portfolio/img2.jpg)', 'url(./img/portfolio/img4.jpg)'];
has comment: http://stackoverflow.com/comment/38818800
has comment: http://stackoverflow.com/comment/38819008
score: 0
has comment: http://stackoverflow.com/comment/38819099
has comment: http://stackoverflow.com/comment/38818988
type: Answer

http://stackoverflow.com/q/24993048
has answer: http://stackoverflow.com/a/24993460
favorite count: 0
tagged with: angularjs
score: 0
has answer: http://stackoverflow.com/a/24993506
upvote count: 1
downvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24993506
type: Question
answer count: 2
tagged with: client-server
tagged with: javascript
has body: this question have been asked numerous times, I know and I'm sorry if by ignorance I didn't get the answers. I have a hosting plan which doesn't allow me to install django, which was really nice to call an rest api easily with the routing settings. What I want is to be able to call a python function from javascript code doing a get/post (I'm using AngularJs, but it would be the same making an ajax get/post.) Let's say I have a js controller 'Employee' and a view 'CreateEmployee'. From my javascript view, I can call my CreateEmployee() on the js controller, now my question is, how can I call a specific function (let's say) def CreateEmployee(params...) on my .py file? All I found is making a get/post on my .py file, but didn't find how to invoke a specific function. I probably don't get the python and client/server communication paradigm, I've been coding on asp.net WebForms for a long time, and since I can't use frameworks like Django I'm stuck. Thanks
has title: Call python FUNCTION from javascript
possible better answer: http://stackoverflow.com/a/24993460
tagged with: python

yammer
type: Tag
tags question: http://stackoverflow.com/q/25012113
tag name: yammer

http://stackoverflow.com/q/24944148
favorite count: 0
downvote count: 0
tagged with: django
tagged with: python
has answer: http://stackoverflow.com/a/24945629
accepted answer: http://stackoverflow.com/a/24945629
type: AnsweredQuestion
score: 1
has body: I'm working with a client that has a view that, after a user logs in, this view loads a template, that dynamically draws a canvas with jQuery, and generates an image copy of the canvas. They want to protect the jQuery code, hiding the process in the python code. I tried using PyExecJS, but it doesn't support jQuery, since there is no DOM. I've also tried urllib2, mechanize and Selenium, but none worked. Is there an alternative or have I missed something? Update/Resolution: In case someone stumbles onto this question: I ended up using Selenium for Python to load the JS function, fed it the necessary data and extracted the image from it. It has a bit of an overhead, but since the main goal was to keep the JS code obfuscated, it worked.
has title: Django - Load template with jQuery into variable
type: Question
answer count: 1
tagged with: javascript
tagged with: jquery
upvote count: 1

http://stackoverflow.com/q/24969112
has body: &lt;script&gt; var train_arrivals = [ '00:10', '00:15', '00:23', '00:35', '00:43', '00:58', '01:05', '01:13', '01:20', '01:37', '01:48', '02:15', '02:25', '02:40', '02:55', '03:00', '03:09', '03:21', '03:37', '03:52', '04:15', '04:30', '04:44', '04:58', '05:16', '05:31', '05:49', '06:00', '06:26', '06:56', '08:06', '07:24', '07:43', '07:58', '08:06', '08:13', '08:28', '08:43', '08:58', '09:05', '09:13', '09:28', '09:43', '09:58', '10:05', '10:38', '11:00', '11:38', '12:38', '13:38', '14:38', '15:38', '16:00', '16:39', '17:00', '17:06', '17:27', '17:57', '20:20', '20:45', '21:50', '23:25', '23:30', '23:48' ]; $(function() { var today = new Date(); var now = moment([today.getFullYear(), today.getMonth(), today.getMinutes(), today.getHours(), today.getMinutes()]); var setted = ''; var count = 1; for (var i=0; i&lt;train_arrivals.length; i++){ var entry = train_arrivals[i]; time = entry.split(":"); var arrival = moment([today.getFullYear(), today.getMonth(), today.getMinutes(), time[0], time[1]]); diff = arrival.diff(now, 'minutes'); if (!setted &amp;&amp; diff &gt; 0) { $("#arrival_list").append($("&lt;li id="+count+" style='font-size: x-large' class='bg-success'&gt;").text(diff + ' min ')); setted = count; } else $("#arrival_list").append($("&lt;li id="+count+" class='bg-info'&gt;").text(diff + ' min')); if (setted &amp;&amp; count &gt;= setted + 2) break; if (!setted &amp;&amp; count &gt; 1) $('#'+count).remove(); count++; } }); &lt;/script&gt; I have this code for this little web app http://nexttrain.elvismdev.com/ The idea is to show next train arrival to the station due the train arrivals times given at the beginning of the code, the value inside the green row is the first next train approaching to the station, after it are two more train arrivals showing up, and back from it, should show the how many times ago the last train was there. I can't figure it out what is wrong over there that I am getting the wrong value with that so long minutes left, when it should s…
tagged with: web-applications
upvote count: 1
accepted answer: http://stackoverflow.com/a/24969337
type: Question
score: 1
has title: cant get the right values for previous minutes
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24969337
tagged with: datetime
tagged with: momentjs
type: AnsweredQuestion

http://stackoverflow.com/q/25029171
favorite count: 0
score: -3
tagged with: http://stackoverflow.com/tag/html
tagged with: php
type: UnansweredQuestion
downvote count: 3
type: Question
has comment: http://stackoverflow.com/comment/38925688
has comment: http://stackoverflow.com/comment/38925528
tagged with: javascript
has title: How to Ul tag in script for html
has answer: http://stackoverflow.com/a/25029283
upvote count: 0
has body: I try to give for script in html iam using in script of array please give me your suggestions for this coding. &lt;script&gt; var myArray = [ { "display": "Home", "url": "http://jomeitechnologies.com/" }, { "display": "About Us", "url": "http://jomeitechnologies.com/about-us.html" }, { "display": "Our Services", "url": "http://jomeitechnologies.com/our-services.html" }, { "display": "Careers", "url": "http://jomeitechnologies.com/careers.html" }, { "display": "Contact Us", "url": "http://jomeitechnologies.com/contact-us.html" } ]; myFunction(myArray); function myFunction(arr) { var out = ""; var i; for(i = 0; i&lt;arr.length; i++) { out += '&lt;a href="' + arr[i].url + '"&gt;' + arr[i].display + '&lt;/a&gt;&lt;br&gt;'; } document.getElementById("id01").innerHTML = out; } &lt;/script&gt;
answer count: 1

http://stackoverflow.com/comment/38985764
has text: Ah, obviously... thanks! This does, however, break the default `ng-checked="true"` on the second to the last option. Any ideas there? Do I need to manually set `checkpoint.value="nc"` or is there a better way?
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25061153
type: Comment

http://stackoverflow.com/a/25009510
downvote count: 0
type: Answer
has body: mixpanel.track() has callback option which will be called after tracking event, you need to use it, on callback you could redirect to some location, place your window.location code inside the callback function, like: mixpanel.track("CBhopID_x3cw17x1h", {}, function() { window.location.href = "http://e20f07o0yd5b2re0-x3cw17x1h.hop.clickbank.net/"; });
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25009456

http://stackoverflow.com/comment/38772955
has text: @ShahRukh just the image section :)
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24947935
score: 0

http://stackoverflow.com/q/25024197
answer count: 3
has answer: http://stackoverflow.com/a/39109132
tagged with: windows-7
possible better answer: http://stackoverflow.com/a/39109132
score: 14
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38917326
upvote count: 14
has title: How to make sure touch events are enabled in Firefox desktop browser?
has answer: http://stackoverflow.com/a/59977177
type: Question
has comment: http://stackoverflow.com/comment/39614662
has body: I used a simple test on a windows 7 desktop with touch capabilities. For simplicity it was something like this: temp_div.addEventListener('touchstart', function(e){ /*confirm */ }, false) temp_div.addEventListener('pointerdown', function(e){ /*confirm */ }, false) temp_div.addEventListener('mousedown', function(e){ /*confirm */ }, false) In chrome, the 'touchstart' was confirmed. In IE, the 'pointerdown' was confirmed. In Firefox, the 'mousedown' was confirmed. After troubleshooting, I ultimately had to go to 'about:config' in Firefox and change the 'dom.w3c_touch_events.enabled' value from 0 to 1. This caused the 'touchstart' to be confirmed in Firefox. My questions are these: Shouldn't this have already been enabled on a touch-capable machine? IE and Chrome were configured properly and Firefox was not. (This was a brand new download of Firefox 31). Is there anyway to enable touch events remotely in a case like this so that Firefox behaves similarly to the other browsers? Thanks
tagged with: firefox
has answer: http://stackoverflow.com/a/25494516
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: touch
accepted answer: http://stackoverflow.com/a/25494516

http://stackoverflow.com/comment/38826981
comment on: http://stackoverflow.com/q/24976961
type: Comment
type: QuestionComment
score: 2
has text: Because i'm learning javascript. Can we stick to the question please and why I shouldn't seek an answer for this.

http://stackoverflow.com/a/25067332
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38999365
has comment: http://stackoverflow.com/comment/38998203
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38999208
has comment: http://stackoverflow.com/comment/38998547
type: Answer
accepted answer of: http://stackoverflow.com/q/25067286
has body: Nan - Not a Number. To see what is in the array: lineArr.forEach(function(arrayItem) { console.log(arrayItem); }); The NaN is thrown into the console probably because you are trying to add a number to a non-numerical value on this line: var x = arrayItem.prop1 + 2;. If for example the arrayItem.prop1 is actually a string value, such as "10", you could use var intValueOfProp1 = parseInt(arrayItem.prop1).
answers question: http://stackoverflow.com/q/25067286

http://stackoverflow.com/q/25057704
has title: how to reload every tab of browser which have open our webpages
has answer: http://stackoverflow.com/a/25057751
type: Question
tagged with: http://stackoverflow.com/tag/html
has body: gmail use some functionality by which they reload all tabs for the login. that means if we open login form of gmail in different different tabs. then login in single tab gmail automatically reload all the pages and redirect to mail page . how it is possible ? is there any particular frame work to implement this?
has comment: http://stackoverflow.com/comment/38978762
answer count: 2
upvote count: 1
tagged with: java
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25058058
downvote count: 0
tagged with: jsp
tagged with: javascript
score: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/25003565
has comment: http://stackoverflow.com/comment/38878569
type: Answer
accepted answer of: http://stackoverflow.com/q/25003167
has comment: http://stackoverflow.com/comment/38877342
has comment: http://stackoverflow.com/comment/38884044
has comment: http://stackoverflow.com/comment/38879847
downvote count: 0
has comment: http://stackoverflow.com/comment/38878215
has comment: http://stackoverflow.com/comment/38883947
has comment: http://stackoverflow.com/comment/38901841
has comment: http://stackoverflow.com/comment/38878433
score: 1
has comment: http://stackoverflow.com/comment/38877443
has body: What you read here is called the power constructor, more about it here: Douglas Crockford about Inheritance As a multi-paradigm language JavaScript lends itself very well to these different considerations. The truth is, it molds around your brain the way you can conceive it. In other words, if you can reason about your structure in one way, than use it that way. If you, on the other hand, want to be completely "free" of your own constraints, then you should abandon reasoning in classes altogether and embrace prototypal inheritance without any thing that resembles a class at all. Duck typing is then a natural consequence and in the extreme you'd use closures all over the place. What I often do is this: function myItemBuilder(p1) { var s0, p0 = 0; // s0 is a shared private property (much like static in classes) // p0 is a shared private property but will be factorized (rendered non-shared) // p1 is a private instance property return (function (p0) { // factorize p0 if necessary return { publicProperty : 3, method1 : function (arg1) { // code here (may use publicProperty, arg1, s0, p0 (factorized) and p1) }, method2 : function (arg2) { // code here (may use publicProperty, arg2, s0, p0 (factorized) and p1) } }; }(p0++)); // on each invocation p0 will be different and method1/method2 will not interfere across invocations (while s0 is shared across invocations) } EDIT: The internal closure is only required if you need to factorize p0 (i.e. have separate, independent values for p0 on each invocation). Of course, if you don't need p0 factorized omit the internal closure. The above example is intentionally more complex than required to illustrate various interesting cases. Invoking this method like myItemBuilder("hello") builds a new item that has those specific features but there really is no class construct per se. This is an especially powerful way of getting instances when you want to abandon classical inheritance. For example in C++ you can inherit from more than one c…
upvote count: 1
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25003167

http://stackoverflow.com/comment/38894861
comment on: http://stackoverflow.com/q/25011145
has text: I'm pretty sure the redirect will cause problems once it's triggered... anyways, so what does the response actually contain? You think it's "_the default path that all users get on login_", whatever that means, but have you actually inspected it?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38777571
has text: i didnt know what u means by `url` but the error message is
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24949929

http://stackoverflow.com/a/26310767
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25010725
has body: $.fn.tab is not yet defined(if not exists) when we set variable old to $.fn.tab As soon as we call method noConflict, $.fn.tab will be set to $.fn.tab predefined(or undefined), and $.fn.tab we defined will be returned to variable we defined(here is s)
type: Answer
accepted answer of: http://stackoverflow.com/q/25010725
score: 0

http://stackoverflow.com/comment/38719522
type: QuestionComment
score: 1
has text: You can change `$field->Field ` to `$field['Field']` and the problem would be solved. Or as I said, encode the data as JSON.
comment on: http://stackoverflow.com/q/24918076
type: Comment

http://stackoverflow.com/comment/38806485
score: 0
type: QuestionComment
type: Comment
has text: He probably does, because in his question he states that something other than what he expected is showing up inside the table
comment on: http://stackoverflow.com/q/24965950

http://stackoverflow.com/a/24996084
has comment: http://stackoverflow.com/comment/38867994
type: Answer
answers question: http://stackoverflow.com/q/24994736
has comment: http://stackoverflow.com/comment/38887371
upvote count: 1
has comment: http://stackoverflow.com/comment/38862905
has comment: http://stackoverflow.com/comment/38896761
score: 1
has body: Use $evalAsyc for before render, and $timeout for after render: link: function(scope, element,attr){ scope.$evalAsync(function(){ // executes after compile/link // and before render }) $timeout(function(){ // executes after render }) })
has comment: http://stackoverflow.com/comment/38863167
downvote count: 0

http://stackoverflow.com/q/25049958
upvote count: 1
has body: I have a JQuery syntax to allow users enter only numbers in the text field. Live code Then I need to write an extra code to allow users can enter "-" (hyphen) in the text box, but it doesn't work. Live code Please help. HTML Number : &lt;input type="text" name="quantity" id="quantity" /&gt;&amp;nbsp;&lt;span id="errmsg"&gt;&lt;/span&gt; CSS #errmsg{color: red;} JS $(document).ready(function () { //called when key is pressed in textbox $("#quantity").keypress(function (e) { //if the letter is not digit then display error and don't type anything if (e.which != 8 &amp;&amp; e.which != 0 &amp;&amp; e.which !=='-' &amp;&amp; (e.which &lt; 48 || e.which &gt; 57)) { //display error message $("#errmsg").html("Digits Only").show().fadeOut("slow"); return false; } }); });
tagged with: jquery
favorite count: 0
has title: Enter only numbers and "-" in textbox using jquery
has answer: http://stackoverflow.com/a/25050483
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25049981
possible better answer: http://stackoverflow.com/a/25050483
tagged with: css
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/25049981
type: Question
type: AnsweredQuestion
tagged with: javascript
answer count: 2

http://stackoverflow.com/q/25053050
accepted answer: http://stackoverflow.com/a/25053777
answer count: 1
has body: I have requirement that a text box is filled with a date using a JQuery Date-picker and the date will be entered in any format but when it passes to a JSON webservice, Date must be converted to the yy-mm-dd (ex. 2014-04-15) format. This must be done using Regular expressions in JavaScript. The RegEx must check the format and if it is in the right or wrong format the inserted date must be converted to the above mentioned format. So how can I do that?
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: regex
type: AnsweredQuestion
tagged with: web-services
has answer: http://stackoverflow.com/a/25053777
type: Question
has comment: http://stackoverflow.com/comment/38970473
has comment: http://stackoverflow.com/comment/38970773
tagged with: javascript
score: 0
has title: Check The Date Using Regular Expressions In JavaScript And Converting According To The Given Type

http://stackoverflow.com/a/24924272
answers question: http://stackoverflow.com/q/24924032
type: Answer
has body: Probably this might help you var t=true; while(t) { if (begin === 'look around') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === 'look') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === 'examine room') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === 'examine the room') { confirm('To your right is the door.Left is the dresser with some pictures on it and a mirror on the wall. In front of you is the cabinets with a TV on top. Behind you is the bed') } else if (begin === '?') { confirm('If you have not already noticed, this game is completely Text-based. In order to progress through the game, you will need to type in commands that you think the character you are playing as should do.Example: look around.') t=false; // if you want to come out of the loop } }
score: 0

http://stackoverflow.com/comment/38944025
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25039187
has text: Btw, the website: http://gold-prediction.com . I u want to take a look
score: 0

http://stackoverflow.com/a/25568548
accepted answer of: http://stackoverflow.com/q/24985485
type: Answer
has body: I was just setting it up wrong. I got it working after changing my config file to require.config({ shim: { underscore: { exports: '_' }, backbone: { deps: ['underscore', 'jquery'], exports: 'Backbone' }, backboneLocalstorage: { deps: ['backbone'], exports: 'Store' }, paths: { jquery: '../bower_components/jquery/dist/jquery', 'jquery-ui': '../bower_components/jquery-ui/jquery-ui', underscore: '../bower_components/underscore/underscore', backbone: '../bower_components/backbone/backbone', backboneLocalstorage: '../bower_components/backbone.localStorage/backbone.localStorage', moment: '../bower_components/moment/moment', text: '../bower_components/requirejs-text/text' } }); require(['backbone', 'views/app-view', 'routers/router'], function (Backbone, AppView, Workspace ) { new Workspace(); Backbone.history.start(); new AppView(); }); and then defining in my backbone view like so define([ 'collections/todos-collection', 'views/todo-view', 'common', 'backbone', 'jquery', 'jquery-ui' ], function(Todos, TodoView, Common, Backbone, $){ As you can see, jquery-ui will attach itself to the $ symbol. Hope this helps.
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24985485
score: 0

http://stackoverflow.com/a/24999569
has comment: http://stackoverflow.com/comment/38869446
type: Answer
answers question: http://stackoverflow.com/q/24999501
has body: temp and global refer to two different variables. Assigning to global will not change the value in temp. Simply change var x=temp to var x=global. It's not clear why you need an intermediate variable.
score: 0
has comment: http://stackoverflow.com/comment/38869414

http://stackoverflow.com/comment/38787325
score: 0
type: AnswerComment
has text: Thanks for the reply. Sorry can you explain a bit more? How do I initialize them?
type: Comment
comment on: http://stackoverflow.com/a/24955988

http://stackoverflow.com/a/25044783
has comment: http://stackoverflow.com/comment/38955227
downvote count: 0
has comment: http://stackoverflow.com/comment/38955465
upvote count: 2
answers question: http://stackoverflow.com/q/25044518
has comment: http://stackoverflow.com/comment/38955537
has body: You can use this lookahead based regex: var re = /(\w)(?=(\w\1))/g; var input="abab"; var matches = []; while (match = re.exec(input)) { matches.push( match[1] + match[2] ); } console.log(matches); //=&gt; ["aba", "bab"] 2nd Example: input="ababcb"; matches = []; while (match = re.exec(input)) { matches.push( match[1] + match[2] ); } console.log(matches); //=&gt; ["aba", "bab", "bcb"] RegEx Demo
type: Answer
score: 2

http://stackoverflow.com/a/25183160
upvote count: 14
has comment: http://stackoverflow.com/comment/41275460
has comment: http://stackoverflow.com/comment/78093700
score: 14
has comment: http://stackoverflow.com/comment/55028372
answers question: http://stackoverflow.com/q/25060935
accepted answer of: http://stackoverflow.com/q/25060935
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/49527835
type: Answer
has comment: http://stackoverflow.com/comment/55029758
has body: After working with Telerik, I came to an answer. The thread that I opened can be found here, but I'll also summarize in this answer. The ultimate solution was to: Use the "Messages" option of the column "filterable" option to customize the filter display message. Use the "Extra" option of the column "filterable" option to get the extra Date selector in the filter menu. Configure the "Operators" option in the grid filterable option to set what operators can be used for dates (gte, lte) and what text is displayed for each (Begin Date, End Date). Use the filterMenuInit event to configure the filter controls. End Result Column Filterable The following filterable options were used: filterable: { "extra": "true", "messages": { "info": "Show items between dates:" }} Extra gives us the second date selector, and the "info" message customizes the text displayed at the top of the filter menu. Grid Filterable I used the "operators" option in the grid-level "filterable" option to make date filters only provide the gte and lte operators, and to customize the text for those operators. This is what the operators configuration object wound up looking like: "date": { "gte": "Begin Date", "lte": "End Date" } Because we want this to apply for all dates, we put that in a factory and reuse it in each angular controller / view. filterMenuInit Event By providing a handler for the filterMenuInit event, you can access and configure the individual controls in the filter menu as it is created. The handler function that I created looks like this: function (e) { if (e.sender.dataSource.options.schema.model.fields[e.field].type == "date") { var beginOperator = e.container.find("[data-role=dropdownlist]:eq(0)").data("kendoDropDownList"); beginOperator.value("gte"); beginOperator.trigger("change"); beginOperator.readonly(); var logicOperator = e.container.find("[data-role=dropdownlist]:eq(1)").data("kendoDropDownList"); logicOperator.readonly(); var endOperator = e.container.find("[data-role=dropdo…

object.observe
tags question: http://stackoverflow.com/q/25055589
type: Tag
tag name: object.observe

http://stackoverflow.com/q/24987759
answer count: 2
has comment: http://stackoverflow.com/comment/38847799
accepted answer: http://stackoverflow.com/a/24987804
downvote count: 0
tagged with: javascript
tagged with: image
has comment: http://stackoverflow.com/comment/38847447
has title: Scaling an image to best fit the viewport
favorite count: 0
has answer: http://stackoverflow.com/a/24988047
upvote count: 2
possible better answer: http://stackoverflow.com/a/24988047
has comment: http://stackoverflow.com/comment/38847496
has answer: http://stackoverflow.com/a/24987804
has body: Suppose I have a viewport of an arbitrary size (eg, a browser window). I want to scale an image of arbitrary aspect ratio and resolution to fit inside of this viewport in a way that maximizes the resolution. I'm having difficulty getting the code to work for circumstances where the image is both too tall and too wide. What equation can I use to figure out if I should scale this arbitrary image by width or by height? Here's the code that I'm using: var aspectRatio = imageWidth / imageHeight; if(tooWide &amp;&amp; tooTall) { // Figure out if it's better to scale on height or width by if((imageWidth - viewporthWidth) &gt; (imageHeight - viewporthHeight)) { adaptedWidth = (1.0 - padding) * viewporthWidth; adaptedHeight = adaptedWidth / aspectRatio; } else { adaptedHeight = (1.0 - padding) * viewporthHeight; adaptedWidth = adaptedHeight * aspectRatio; } } else if(tooWide) { adaptedWidth = (1.0 - padding) * viewporthWidth; adaptedHeight = adaptedWidth / aspectRatio; } else if(tooTall) { adaptedHeight = (1.0 - padding) * viewporthHeight; adaptedWidth = adaptedHeight * aspectRatio; } else { adaptedWidth = imageWidth; adaptedHeight = imageHeight; } I'm having some circumstance where images of a certain size are not being scaled at all. For example, a 3000 x 1997 image is being resized to 1342 x 893 when my viewport size is 1492 x 855. The aspect ratio is correct, but the height is wrong. This implies the condition of the nested if statement is wrong (and indeed, it evaluates to 1003 > 1104, which hints that we should be scaling by height. I assume that this means that the equations used for scaling the image are insufficient. Side note: this code is JavaScript that is being used to scale an image (using the browser's native scaling via the width and height attributes on the image element). In the code above, padding is a percentage to that creates a minimum amount of padding around the image (so it doesn't take up the entire viewport). I included this in the code because the…
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38847671
tagged with: math
has comment: http://stackoverflow.com/comment/38847508
type: Question

http://stackoverflow.com/a/24962191
score: 1
upvote count: 1
has body: First of all you need to remove the # from the ids: ABOUT US CONTACT Should be ABOUT US CONTACT Next, you probably want to run that on window.resize as well: $(function() { $(window).on('resize', function() { var add_remove = $(window).width() < 768; $("#about-us").attr("href", add_remove ? "#about-us" : ""); $("#contact").attr("href", add_remove ? "#contact" : ""); }); $(window).trigger('resize'); });
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24962052
accepted answer of: http://stackoverflow.com/q/24962052

http://stackoverflow.com/comment/38987599
comment on: http://stackoverflow.com/a/25062247
type: AnswerComment
score: 0
has text: @Andy - Yes, thanks for pointing out. I'll add it to the answer.
type: Comment

http://stackoverflow.com/comment/38847863
type: Comment
comment on: http://stackoverflow.com/a/24987884
score: 1
type: AnswerComment
has text: @user3792802 it is...there are likely easier approaches but you need to confirm wrappers for the inputs that this will get set to. If each `module` is wrapped it greatly simplifies a lot. Then traverse to wrapper and look for class assigned to the input's

http://stackoverflow.com/a/25067464
answers question: http://stackoverflow.com/q/24943922
has body: Where I was stumbling was page reloads and the way they behave differently. Let's divide use cases into two: 1. Page hit: simply going to a previously visited page. Here I see what you see: most of the content is retrieved from cache. Chrome shows it better than Firefox/Firebug. Firebug simply does not show cache hits in the Network panel. 2. Regular page reloads. Pretty much all browsers have two shortcuts to refresh a page: regular reloads (Ctrl+R in Chrome/Windows) and reloads ignoring cache (Shift+F5 in Chrome/Windows). I'm talking about regular reloads since if cache is ignored, there is nothing to discuss. What seems to be happening is that browser issues If-Modified-Since requests for all resources on the page. The server then responds with 304 Not Modified for static resources and browser gets them from cache. The issue is that we were not handling If-Modified-Since in our services. We simply were setting Cache-Control with the expiration age. The server code update that started to handle If-Modified-Since resolved the issue. BTW, here is a background article on browser caching that I found quite useful: https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers
score: 0
type: Answer

http://stackoverflow.com/comment/38752000
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24936664
has text: thanks @DavinTryon, i think "back-end" is method to check value change from angularjs..

http://stackoverflow.com/a/24946932
score: 0
has body: Apologies for commenting when I don't know what's going on, but it seems no one else has had a go yet so here's an idea. I found the source to the sanitizer you mentioned, and it's just a regex of a white list of allowed tags. Everything else is rejected, which seems pretty smart frankly. // (tags that can be opened/closed) | (tags that stand alone) var basic_tag_whitelist = /^(&lt;\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)&gt;|&lt;(br|hr)\s?\/?&gt;)$/i; // &lt;a href="url..." optional title&gt;|&lt;/a&gt; var a_white = /^(&lt;a\shref="((https?|ftp):\/\/|\/)[-A-Za-z0-9+&amp;@#\/%?=~_|!:,.;\(\)]+"(\stitle="[^"&lt;&gt;]+")?\s?&gt;|&lt;\/a&gt;)$/i; // &lt;img src="url..." optional width optional height optional alt optional title var img_white = /^(&lt;img\ssrc="(https?:\/\/|\/)[-A-Za-z0-9+&amp;@#\/%?=~_|!:,.;\(\)]+"(\swidth="\d{1,3}")?(\sheight="\d{1,3}")?(\salt="[^"&lt;&gt;]*")?(\stitle="[^"&lt;&gt;]*")?\s?\/?&gt;)$/i; I don't think it would be too hard to translate these to Java regex. Here's my go with the first regex string. Pattern white = Pattern.compile( "^(&lt;\\/?(b|blockquote|code|del|dd|dl|dt|em|h1|h2|h3|i|kbd|li|ol|p|pre|s|sup|sub|strong|strike|ul)&gt;|&lt;(br|hr)\\s?\\/?&gt;)$" ); String test = "foo&lt;p&gt;bar"; Matcher matcher = white.matcher(test); for(int i = 0;;) { int start = test.indexOf("&lt;",i); if( start &lt; 0 ) break; int end = test.indexOf( "&gt;", start ); if( end &lt; 0 ) break; matcher.region(start, end+1); System.out.println(test.subSequence(start, end) ); System.out.println( matcher.matches() ); i = end; } This prints "true" when it finds a white listed tag. Otherwise you should mangle the first '&lt;' to be a '&amp; lt ;' (I can't type the HTML literal. I think I found a bug in PageDown :-)) or whatever you prefer. Whether you do this on the in-bound (post) path or on the out-bound (get) path is up to you, but the latter might be more flexible since it gives you the ability to adjust th…
answers question: http://stackoverflow.com/q/24946092
type: Answer
has comment: http://stackoverflow.com/comment/38789036
has comment: http://stackoverflow.com/comment/38788970

http://stackoverflow.com/a/24955234
has body: it seems over-optimization. i will go for second just because it is short a*=-1; //5 a=-a; //4
answers question: http://stackoverflow.com/q/24955107
score: 0
type: Answer

http://stackoverflow.com/q/24983765
type: Question
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/38874869
has title: automatic photo slider with fade in and out animation- javascript only
downvote count: 0
has comment: http://stackoverflow.com/comment/38843349
favorite count: 0
has body: I did a 5 images slider that changes images automatically within a few seconds in a loop. I want fade out and in animations before and after changing each image. This is my code: HTML: &lt;div id="slider"&gt; &lt;img id="bigImage" src="img/Traffic1.jpg"&gt; &lt;/div&gt; JS: var imageArray = ["img/Traffic1.jpg", "img/Traffic2.jpg", "img/Traffic3.jpg", "img/Traffic4.jpg","img/Traffic5.jpg"]; var imageIndex = 0; function changeImageByTimer() { document.getElementById("bigImage").src = imageArray[imageIndex]; imageIndex++; if (imageIndex &gt; 4) { imageIndex = 0; } } var imgTimer = setInterval(changeImageByTimer, 3000); I cant change the html code only the javascript. I prefer to use only javascript. Any suggestions?
tagged with: slider
tagged with: animation
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/45342525
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25003045
has comment: http://stackoverflow.com/comment/38840042
score: 1
possible better answer: http://stackoverflow.com/a/45342525
upvote count: 1
has comment: http://stackoverflow.com/comment/38842529
accepted answer: http://stackoverflow.com/a/25003045

http://stackoverflow.com/q/24968682
answer count: 1
favorite count: 0
has body: My question is same as addressed here, I am not able to add comment to that question. Highstock is Not able to show max data point without zoom. Here in JsFiddle. I am getting data values of y-axis between 0 t0 1.7, but am getting max value is 3.19(See in Fiddle April 9 22:53), it is not showing. when we click on the Month zoom button then only it is showing. If we click on All,6M,3M it is not showing. $(document).ready(function(){ var seriesOptions = []; var xaAxisData=[]; var yAxisData=[]; for (var i=0; i&lt;xaAxisData.length &amp;&amp; i&lt;yAxisData.length; i++){ seriesOptions.push([xaAxisData[i],yAxisData[i]]); } // Create the chart var chart =new Highcharts.StockChart({ chart: { renderTo: "container", height: 500, zoomType: 'x' }, rangeSelector : { selected : 1, inputEnabled: $('#container').width() &gt; 280 }, title : { text : 'AAPL Stock Price' }, credits: { enabled: false }, xAxis: { title: { text: 'Time' }, type: 'datetime', }, yAxis: { title: { text: "Stock " }, lineWidth: 1, min:0, gridLineWidth: 0, endOnTick : false, max:5 }, series : [{ name : 'AAPL', showInLegend: true, data : seriesOptions, lineWidth : 1, marker : { enabled : true, radius : 2 } }] }); } );
tagged with: css
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24932284
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/24970748
type: Question
has answer: http://stackoverflow.com/a/24970748
tagged with: highcharts
tagged with: javascript
tagged with: jquery
has title: Highstock Not showing max data value without Zoom
upvote count: 1

http://stackoverflow.com/a/29781899
answers question: http://stackoverflow.com/q/25065896
type: Answer
has comment: http://stackoverflow.com/comment/47918515
upvote count: 9
has body: Here's an IE11-friendly solution: tspan:nth-child(2n) { display: block; } This is line 1 This is line 2 This is line 3 This is line 4 There are two subtleties: Chrome renders whitespace around the elements, so they should not be indented; IE11 renders consecutive elements with display:block with double line spacing (I couldn't find a CSS trick to avoid this), so the style is applied to every other element. This version renders as four lines on Chrome 41, Safari 8, Firefox 37 (OSX Yosemite), and IE11 (Windows 7). Unfortunately it still renders as a single line in IE9-10. If you need multi-line display here I'd suggest your own rendering based on mouse events. Note that, whilst text content elements do respect the display property, the presentation of tooltips is entirely up the browser, so this technique may not work in the future. ...'desc' and 'title' elements are not rendered as part of the graphics. User agents may, however, for example, display the 'title' element as a tooltip, as the pointing device moves over particular elements. (emphasis mine) Source: SVG spec, desc and title elements.
score: 9
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25065896

http://stackoverflow.com/comment/38935273
type: Comment
score: 1
has text: "put a zero before every number that has exactly one digit"
comment on: http://stackoverflow.com/a/25034726
type: AnswerComment

http://stackoverflow.com/q/25021994
accepted answer: http://stackoverflow.com/a/25022029
answer count: 1
tagged with: javascript
has body: Cheeky on the fly JS question. I have an element whose value I would like to get. The h4 element is nested under a div of class pricing_numbers. How would I drill down further in the DOM to get the value of H4 that is nested under this element? See the picture attached. I'd like to get the value $59.99 I got this far. But how to drill down to what I need? document.getElementsByClassName("pricing_numbers")
has comment: http://stackoverflow.com/comment/38912058
has comment: http://stackoverflow.com/comment/38912381
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25022029
type: Question
has title: Navigating down the DOM in console
has comment: http://stackoverflow.com/comment/38912753
score: 0

http://stackoverflow.com/a/24950728
has comment: http://stackoverflow.com/comment/38778671
answers question: http://stackoverflow.com/q/24950591
accepted answer of: http://stackoverflow.com/q/24950591
score: 5
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38778558
type: Answer
has comment: http://stackoverflow.com/comment/38778927
upvote count: 5
downvote count: 0
has body: Try using a spread radius of at least half of the blur radius: box-shadow: inset 0 0 12px 6px #fff; Demo

http://stackoverflow.com/comment/38813072
has text: @ArunPJohny, I've tested it. But it isn't working. It can't find the load file's selectors. Please check this [Example](http://cheapgamessales.com/1.php)
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24969493

http://stackoverflow.com/comment/38847560
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24987827
has text: Unaware of float math? Ever heard of Bignum? If working with currency, how about working in cents?
score: 0

http://stackoverflow.com/comment/38763280
has text: I suspect that the ajax call is so quick that the loader doesn't have time to show. Take a look at wrapping your DOM update in jquery's `.promise().done()`. This will ensure the DOM update completes before moving to your AJAX call.
comment on: http://stackoverflow.com/q/24942681
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38964619
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25043633
has text: You were right in that the data 'is' in the success, and to just trust and go with that, and that became the basis for my research/debugging. This led to my finding the issue which was in how I was referencing the data. $scope.customers = customers.goodCustomers; // The view had nothing to show because the returned customers array had a sub-array of types of customers. I appreciated delving into and trying out the routing resolve, however, as well as learning about $scope.apply() - obviously for which neither applied, but was a good learning experience.

http://stackoverflow.com/comment/38828809
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24926610
has text: @frank I have AMD Radeon HD 6310. Isn't versions 29.x the latest Firefox?

http://stackoverflow.com/comment/38977780
has text: Oh, it's alright. I've sorted this out. I've posted the city variable as JSON with AJAX now. Thanks for the help.
comment on: http://stackoverflow.com/q/25045805
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38775604
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24949372
has text: what was the problem, what did you try?
score: 0

http://stackoverflow.com/comment/38861790
type: QuestionComment
has text: @SebastianBochan, only those that correspond to points outside the limits. Here if the limits are 0 and 200, the points to be shown as datalabes should be -15 and 216.4.
comment on: http://stackoverflow.com/q/24963808
score: 0
type: Comment

http://stackoverflow.com/q/24927145
has body: Is there a way to change the height of a 3D Pie Chart? We need to show users differences between a few of charts. Some must be larger in height (they must be rather like pillars then pies), some smaller. In other words, I want the pie itself tot be taller (the y-component of the pie), not the whole chart. Here's the documentation and examples of the pie: https://developers.google.com/chart/interactive/docs/gallery/piechart#3D If it's not possible, maybe there are other good alternatives of 3D-pie charts? I'd appreciate links to tutorials of how to draw a 3D-pie chart (using SVG or Canvas) too.
type: UnansweredQuestion
type: Question
has title: Change the height of a Google 3D-pie chart
tagged with: pie-chart
tagged with: google-visualization
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38748475
has answer: http://stackoverflow.com/a/24931841
score: 0

http://stackoverflow.com/comment/88306059
comment on: http://stackoverflow.com/a/45464959
type: Comment
score: 1
has text: A possible reason some people may not use it is because, according to the page you linked to, it seems there is not full compatibility with locales on mobile platforms.
type: AnswerComment

http://stackoverflow.com/a/24955727
type: Answer
answers question: http://stackoverflow.com/q/24955468
score: 0
accepted answer of: http://stackoverflow.com/q/24955468
has body: The output tag is not supported by Internet Explorer (and Safari) http://www.w3schools.com/tags/tag_output.asp You can just use a span in it's place. And instead of setting result.value use result.innerHTML
type: AcceptedAnswer

http://stackoverflow.com/q/24990764
has answer: http://stackoverflow.com/a/24990844
accepted answer: http://stackoverflow.com/a/24990916
tagged with: javascript
has title: Increasing the titlebar and other elements' width to cover the whole JQuery dialog
possible better answer: http://stackoverflow.com/a/24990844
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
has body: I have a JQuery dialog box that displays a table on button click. I need: 1. The titlebar of the dialog box to cover the entire width of the dialog box. Currently, the title bar has some of the dialog box peeking out on all sides. 2. There is a row in the table. The row should cover the entire dialog box. How do I remove the margins on either side of the row? Setting margin, padding to 0 does not help. HTML: Click 'Word' Javascript/JQuery: $(document).ready(function () { $("#x").click(function () { alert("Button clicked"); startRecorderDialog(); $("#dialog-form-speakingPractice").dialog("open"); }); function startRecorderDialog() { $("#dialog-form-speakingPractice").dialog({ autoOpen: false, height: 'auto', width: 'auto', modal: true, dialogClass: 'recorderDialogCSS', open: function (event, ui) { $(".ui-dialog-titlebar-close").hide(); } }); $("#dialog-form-speakingPractice").dialog('option', 'title', 'Listen to Word'); } }); CSS: .ui-widget-overlay { background: transparent; } .recorderDialogCSS.ui-dialog { color: black; background: rgb(230, 230, 230); } .recorderDialogCSS .ui-dialog-titlebar { font-family: Arial; color: white; background: rgb(0, 83, 146); text-align: center; border: 0px; } #recordTable { padding: 0; margin: 0; } #recordTable td { border: 1px solid black; width: 100%; margin: 0; padding: 0; } #word2Record { background: rgb(133, 184, 56); font-family: Arial; color: white; margin: 0; text-align: center; } I also have a JFiddle here.
type: Question
has answer: http://stackoverflow.com/a/24990916
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 3
upvote count: 1
has answer: http://stackoverflow.com/a/24990863

http://stackoverflow.com/a/28518500
score: 6
upvote count: 7
has comment: http://stackoverflow.com/comment/131624441
downvote count: 1
has body: Attach a value to the modal controller angular.module('app') .controller('TestCtrl',TestCtrl) .value('noteId', null); // optional param
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25046961
type: Answer
accepted answer of: http://stackoverflow.com/q/25046961

http://stackoverflow.com/a/24928595
answers question: http://stackoverflow.com/q/24928345
score: 0
has body: Why not accessing the HTML Textbox via codebehind? Use this to insert a value to a textbox: Request.Form["yourHTMLTBName"] = "new Value inserted"; Decleration in HTML: &lt;input id="tbHTML" type="text" readonly="readonly" name="yourHTMLTBName"/&gt; Try to make it static: ClientIDMode="Static"
type: Answer
has comment: http://stackoverflow.com/comment/38739877

http://stackoverflow.com/comment/38951879
type: AnswerComment
has text: That's why I like doing in in team! :) I always make some stupidity, which later, I cant see myself :) Thank you fellow! :)
type: Comment
comment on: http://stackoverflow.com/a/25042553
score: 0

http://stackoverflow.com/comment/38710415
comment on: http://stackoverflow.com/a/24913492
score: 0
type: Comment
has text: @Radical_Activity Yes, it will cause an error. You cant use `.html` on document. You can however have a `div` result and output your html, but then, script tag will be interpreted : http://jsfiddle.net/5VvfH/3/
type: AnswerComment

http://stackoverflow.com/comment/38968436
type: AnswerComment
score: 0
type: Comment
has text: @CodeWizard I've edited my original reply. When I read OP's code, I thought this was a complete example of something he had written. It would _never_ make sense to in one line add an event listener, and then in the next line unbind the listener. I thought this was the OP's question. If the answer isn't comprehensive enough, I'm open to suggestions :)
comment on: http://stackoverflow.com/a/25051271

http://stackoverflow.com/q/24929083
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
favorite count: 0
upvote count: 1
type: AnsweredQuestion
score: 1
has answer: http://stackoverflow.com/a/24929400
has answer: http://stackoverflow.com/a/24929505
has title: clarification on validating a textbox
type: Question
tagged with: validation
downvote count: 0
has answer: http://stackoverflow.com/a/24929858
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24929176
has body: I have totally 6 textboxes here and i have applied different validations for them but none of them are working. here is my code can someone help me out where i have gone wrong. Each textbox have different condition 1)it should accept only alphabets 2)it should accept only numbers 3)it should accept only email 4)it should accept only alphabets if u enter anything other then alphabet and press submit button background color of that particular textbox will change &lt;!DOCTYPE&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt; Text Boxes &lt;/title&gt; &lt;script&gt; function test(){ if(form.alphabets.value == "") { alert('Please enter name'); return false; } else { if (!form.alphabets.value.match(/^[a-zA-Z]+$/)) { alert("Please Enter only alphabets"); return false; } } if(form.numbers.value == "") { alert('Please enter phone number '); return false; } else { if (!form.numbers.value.match(/^[0-9]+$/)) { form.numbers.value=""; form.numbers.focus(); alert("Please Enter only numbers"); return false; } } if(form.email.value == "") { alert('Please enter email '); return false; } else { if (!form.email.value.match(/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$/) ) { form.email.value=""; alert("Please Enter Valid email address"); form.email.focus(); return false; } } if(form.alphabets1.value == "") { alert('Please don't enter numbers '); return false; } else { if (!form.alphabets1.value.match(/^[a-zA-Z]+$/)) { form.alphabets1.value=""; form.alphabets1.focus(); form.alphabets1.style.background="Red"; alert("Please Enter only alphabets"); return false; } } function check() { var text = document.getElementById("txtarea_content").value; if(text.length &gt;= 4) { alert('Length should not be greater than 4'); return false; } else { return true; } } function sum() { var txtFirstNumberValue = document.getElementById('txt1').value; var txtSecondNumberValue = document.getElementById('txt2').value; if (txtFirstNumberValue == "") txtFirstNumberValue = 0; if (txtSecondNumberValue == "") txtSec…
has answer: http://stackoverflow.com/a/24929176
accepted answer: http://stackoverflow.com/a/24929400

http://stackoverflow.com/comment/38972270
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25053707
has text: Not an appropriate approach, but you can do something like this.. you can write like this...

http://stackoverflow.com/a/24955958
type: Answer
score: 4
has body: In modern browsers(IE8+, FF3.6+, Chrome), you can just listen to the hashchange event on window. $(window).bind('hashchange', function() { window.history.back(); /* things */ }); In some old browsers, you need a timer that continually checks location.hash. If you're using jQuery, there is a plugin that does exactly that. function hashHandler(){ this.oldHash = window.location.hash; this.Check; var that = this; var detect = function(){ if(that.oldHash!=window.location.hash){ window.history.back(); } }; this.Check = setInterval(function(){ detect() }, 100); } var hashDetection = new hashHandler(); Do you work on hash change event.
upvote count: 4
answers question: http://stackoverflow.com/q/24955333
downvote count: 0
has comment: http://stackoverflow.com/comment/38787133

http://stackoverflow.com/comment/38734808
type: Comment
comment on: http://stackoverflow.com/a/24925320
score: 0
type: AnswerComment
has text: Thanks, I missed the single and double quotes mixing, was typing too fast and trying different things

http://stackoverflow.com/q/24910466
has answer: http://stackoverflow.com/a/24911959
has body: I am developing first JSP application. I have two database tables in MS Access connected with JSP using DSN. What I have to do is very simple. I have a input text box which takes "ID" as input and a Button to view Record. On Button Click, result set will be retrieved from both the tables having records with ID same as input in textbox. On Button Click, a table should be dynamically created displaying the values retrieved in result set.OnClick Calls a Javascript method ShowData and passes it the values of result set which are placed in dynamic tables. So form elements' values will be processed after onClick and my result set having records before onClick, as you can see in the code, therefore, I am not able to display correct result as text-input goes null in query and inaccurate result set is achieved. Please guide me how to properly send text input value to query on ButtonClick Event. Hope I am clear. &lt;%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %&gt; &lt;!DOCTYPE html&gt; &lt;%@page import="java.sql.*"%&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;title&gt;JSP Page&lt;/title&gt; &lt;script language="javascript"&gt; // creating dynamic tables function showData(std_id,std_name,std_prog,std_email,std_semester,std_course,std_status,std_title,std_score,std_credit_hour){ var width = 25; var theader = "&lt;table border='5' id='table1' width = ' "+ width +"% '&gt;"; var tbody = ""; var t2header = "&lt;table border='5' id='table2' width = ' "+ width +"% '&gt;"; var t2body =""; tbody += "&lt;tr&gt;"; tbody += "&lt;td&gt;"; tbody += "Student ID"; tbody += "&lt;/td&gt;"; tbody += "&lt;td&gt;"; tbody += std_id; tbody += "&lt;/tr&gt;"; tbody += "&lt;tr&gt;"; tbody += "&lt;td&gt;"; tbody += "Student Name"; tbody += "&lt;/td&gt;"; tbody += "&lt;td&gt;"; tbody += std_name; tbody += "&lt;/tr&gt;"; tbody += "&lt;tr&gt;"; tbody += "&lt;td&gt;"; tbody += "Study Program"; tbody += …
has comment: http://stackoverflow.com/comment/38701674
type: UnansweredQuestion
tagged with: jsp-tags
type: Question
tagged with: html-table
tagged with: javascript
has title: JSP and Javascript values and method call
score: 0
answer count: 1

http://stackoverflow.com/q/24944039
has body: I am trying to understand this javascript code, which extends jquery. I know calling extend on the jquery object will add a tablesorter object to the $ object. I want to clear the cache on a tablesorter object, something like this $("#myTable").tablesorter(); $("#myTable").buildParserCache(); //so as to clear the cache. I get undefined is not a function. $("#myTable").tablesorter().buildParserCache() //also get undefined is not a function Can someone explain why this is not possible and how to clear the cache. I know I am butting up against some JS design patterns and scope rules and I would like to understand them. (function ($) { $.extend({ tablesorter: new function () { var parsers = [], widgets = []; this.defaults = { ... }; /* debuging utils */ function benchmark(s, d) { log(s + "," + (new Date().getTime() - d.getTime()) + "ms"); } function buildParserCache(table, $headers) { if (table.config.debug) { var parsersDebug = ""; }
score: 0
answer count: 1
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24944212
accepted answer: http://stackoverflow.com/a/24944212
tagged with: javascript
tagged with: jquery
has title: Is there any way to call "benchmark" in the javascript code

http://stackoverflow.com/comment/38877315
comment on: http://stackoverflow.com/a/25003624
type: Comment
has text: @JuanMendes I'm really not trying to nitpick. I'm trying to offer justifications for choosing one method over the other.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24920248
type: Question
has body: We have a Typo3 Extbase/Fluid Extension. We want to add PIWIK for usage tracking. For this we use the onclick tracking Event: &lt;f:link.action action="show" controller="Controller" arguments="{foo:foo}" onclick="javascript:_paq.push(['trackEvent', 'Home', 'superactiontext']);"&gt;xyz&lt;/f:link.action&gt; The tracking with PIWIK is optional, so some clients will use it, others not. How would you implement this? Regarding on clean code and performance? Would you use if/else in the templates on each link? Would you let the onclick in each version and check if the option is activated in the main JS of PIWIK? How would you implement this? In our Default Layout template we have the main PIWIK trackingcode. &lt;!-- Piwik --&gt; &lt;script type="text/javascript"&gt; var _paq = _paq || []; _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function() { var u=(("https:" == document.location.protocol) ? "https" : "http") + "://127.0.0.1/analytics/"; _paq.push(['setTrackerUrl', u+'piwik.php']); _paq.push(['setSiteId', 1]); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s); })(); &lt;/script&gt;
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24922321
score: 0
tagged with: typo3
tagged with: architecture
has title: Typo3 Extbase Extension how to implement PIWIK as Option onclick, how to implement the cleanest way, expert advises welcome
tagged with: extbase
type: UnansweredQuestion

http://stackoverflow.com/a/24960551
type: Answer
has body: You can use css on hover with either the visibility attribute or opacity attribute to hide an object, the full implementation of a gallery widget like this is somewhat more complicated though. CSS solution: .dots:hover { opacity:0; } Makes anything with the dots class invisible on mouse over. Or if you don't want it to take up any space when invisible: .dots:hover { display:none; }
answers question: http://stackoverflow.com/q/24960472
score: 0
has comment: http://stackoverflow.com/comment/38796181

http://stackoverflow.com/comment/38759361
score: 1
comment on: http://stackoverflow.com/a/24940760
type: AnswerComment
has text: One Work For You! GREAT
type: Comment

http://stackoverflow.com/comment/38737546
score: 0
type: Comment
has text: be sure to use `escape_javascript` in case `comment.body` contains single or double quotes.
type: AnswerComment
comment on: http://stackoverflow.com/a/24929321

http://stackoverflow.com/a/25017851
has comment: http://stackoverflow.com/comment/38922926
score: 1
answers question: http://stackoverflow.com/q/25012713
has body: You must not execute remote scripts in a privileged context, or execute insecure remote scripts in a potentially secure context. What you're asking fails both: Executing remote scripts in a somewhat privileged context, namely a content script, which has some privileged capabilities regular web site scripts have not. Execute an insecure http:// script (you gave that in the example), in the current tab, which might be https://. This would allow Man-in-the-Middle attacks. (Even if you served your "config" from https, the add-on site would still reject your submission, BTW, because it cannot be reviewed as the active content is not complete). So, effectively, you got two security vulnerabilities, both of which can and should make your add-on end up on the blocklist. However, you can retrieve your configuration using a non-active/non-executable format, such as JSON or XML (or plain text, if you like). Passing these configuration values can be achieved by using either contentScriptOptions (which is not documented in tabs nor worker, but in page-mod but should work for all, as a cursory test shows). Full example: var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { tab.attach({ contentScript: 'console.log(self.options);', contentScriptOptions: {"abc": 123} }); }); Or regular messaging.
upvote count: 1
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38983532
comment on: http://stackoverflow.com/q/25050636
score: 0
type: Comment
type: QuestionComment
has text: possible duplicate of [jQuery Mobile: Markup Enhancement of dynamically added content](http://stackoverflow.com/questions/14550396/jquery-mobile-markup-enhancement-of-dynamically-added-content)

http://stackoverflow.com/q/24957259
score: 2
upvote count: 2
type: UnansweredQuestion
type: Question
has body: Im trying to replicate this local authentication with the passport tutorial. but with an angularJS frontend instead of EJS, until now everything works, but I have a problem when I want to show the user data in the profile page (after a successful login) I'm talking about this piece of code // ===================================== // PROFILE SECTION ===================== // ===================================== // we will want this protected so you have to be logged in to visit // we will use route middleware to verify this (the isLoggedIn function) app.get('/profile', isLoggedIn, function(req, res) { res.render('profile.ejs', { user : req.user // get the user out of session and pass to template }); }); I understand that user is the data that I need, but in the example with EJS is used like this: Local id: <%= user._id %> email: <%= user.local.email %> password: <%= user.local.password %> Can I access this same data with AngularJS? I'm a bit new in this and I don't understand how
has title: How to show user information in angularJS frontend with Passport and nodeJS
has answer: http://stackoverflow.com/a/24957621
has comment: http://stackoverflow.com/comment/42532441
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: passport.js
favorite count: 0
tagged with: angularjs
tagged with: node.js

http://stackoverflow.com/comment/39210613
score: 0
comment on: http://stackoverflow.com/q/25058598
has text: http://plnkr.co/edit/NmyYw3hYzAMMQtxki1yU
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25050811
has comment: http://stackoverflow.com/comment/38967554
type: Answer
downvote count: 0
answers question: http://stackoverflow.com/q/25050502
score: 1
has comment: http://stackoverflow.com/comment/38966914
upvote count: 1
has body: You can't return a value in your synchronous function that was acquired from an asynchronous operation. The async operation won't complete until sometime later so it simply isn't available yet when your getGithubURL() function returns. It's a matter of timing and just something that javascript can't do. You can solve your problem by restructuring how you use promises. What you want to do is to make a .then() handler be the consumer of the final data. That way you can pass the data back through your promise structure. You also want to make use of the promise that $.getJSON() already returns - no need to create your own promise here. Here's one way to do that. getGithubURL("bullcitydave").then(function(url) { // you can use the avatar url here }); function getGithubURL(name){ var ghUserURL = 'https://api.github.com/users/bullcitydave?client_id=-----&amp;client_secret=------'; return $.getJSON(ghUserURL).then(function(data) { return data.avatar_url; }); }; You call $.getJSON(). It returns a promise which you add a .then() handler on in order to extract the actual data you want. From the .then() handler, you return the final data you want. The $.getJSON().then() sequence creates a new promise which is what you return from your getGithubURL() function and is not resolved until the getJSON().then() sequence is done. That will present your avatar URL to the outer .then() handler as shown in the code above. Or, if the caller of your getGithubURL() function isn't going to use promises, then you can make your function take a callback like this: getGithubURL("bullcitydave", function(url) { // you can use the avatar url here }); function getGithubURL(name, fn) { var ghUserURL = 'https://api.github.com/users/bullcitydave?client_id=-----&amp;client_secret=------'; $.getJSON(ghUserURL).then(function(data) { // call the callback and pass it the avatar url fn(data.avatar_url); }); };
has comment: http://stackoverflow.com/comment/38967324

http://stackoverflow.com/comment/38980517
type: Comment
type: QuestionComment
has text: Yea show some input and expected output
comment on: http://stackoverflow.com/q/25058120
score: 0

http://stackoverflow.com/q/24941258
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38760417
accepted answer: http://stackoverflow.com/a/24942002
type: Question
has comment: http://stackoverflow.com/comment/38761942
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38760381
tagged with: ajax
has comment: http://stackoverflow.com/comment/38760617
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24942002
has comment: http://stackoverflow.com/comment/38760770
has title: Why does Jquery AJAX appends empty table cells on top of cells containing data
tagged with: jquery-ajaxq
has comment: http://stackoverflow.com/comment/38761799
has body: So I am using AJAX via jquery to append data to a table after someone clicks on the submit button , IT works , but the thing is that it first appends two horizontal table cells that are empty , then gets followed by the cells containing data and as long as I click on the submit button , those empty cells add up , it looks weird .. is there a way to fix this .. Below is my code . $(document).ready(function() { $( document ).on( 'click', '#submit_button', function () { event.preventDefault(); var sku = $("#sku").val(); var dec = $("#dec").val(); $.ajax({ url:"check_sku.php", data:{sku: sku, dec:dec}, type:"POST", success:function(result){ if(result !="MEID / DEC / SIM needed"){ $(".rows").remove(); $("#submit_button").remove(); $("#cancel").remove(); $("#enter_product_sku").remove(); $("#table_1").append(result); } if(result =="MEID / DEC / SIM needed"){ $("#meid").show(); } } }); }); }); The data that gets appended , contained in the result variable is this ... any reason why it adds a row of two empty table cells first ? $title $count Enter the product SKU console log string Charger2 18 Charger 4 Iphone 6 3 Previal 4 Enter the product SKU
has comment: http://stackoverflow.com/comment/38761498

angularjs-filter
tags question: http://stackoverflow.com/q/24960205
tags question: http://stackoverflow.com/q/25055333
tags question: http://stackoverflow.com/q/24951199
type: Tag
tag name: angularjs-filter

http://stackoverflow.com/comment/38945627
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25038113
type: AnswerComment
has text: That's kind of what I wanted however I wanted it to only generate the checkboxes based on what privileges they had and not generate the 4 checkboxes then depending what privileges they have, have them unticked/unticked. They should always be checked when generated :) What needs to be changed? ^^ I really appreciate the help as well

http://stackoverflow.com/comment/38984722
type: Comment
has text: @mko nice. Good luck on it.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25059776

http://stackoverflow.com/comment/38929868
type: QuestionComment
has text: ok i did that but issue is to show time elapsed
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25030454

http://stackoverflow.com/comment/38880519
score: 1
comment on: http://stackoverflow.com/q/25005335
type: Comment
type: QuestionComment
has text: The cause of this is going to depend on the technology that was used. Please provide a link to the problem, or at least more context. How was the HTML added to the page? Did you type it in or was it rendered by some server-side technology?

http://stackoverflow.com/a/25032624
has body: Since you referring to text fields you can make use of this selector $(row).find('input[type=text]').each(function(element) { element.attr("id","newId"); })
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25032130

http://stackoverflow.com/comment/38777619
score: 0
type: AnswerComment
type: Comment
has text: have a look at my answer it will work for all forms in your page and do add a jquery tag to the question as well
comment on: http://stackoverflow.com/a/24950490

variables
tag name: variables
tags question: http://stackoverflow.com/q/24939072
tags question: http://stackoverflow.com/q/25051733
tags question: http://stackoverflow.com/q/25038364
tags question: http://stackoverflow.com/q/24972412
tags question: http://stackoverflow.com/q/24966742
tags question: http://stackoverflow.com/q/25030503
type: Tag
tags question: http://stackoverflow.com/q/24930335
tags question: http://stackoverflow.com/q/24958422
tags question: http://stackoverflow.com/q/24987297
tags question: http://stackoverflow.com/q/25046548
tags question: http://stackoverflow.com/q/24967747
tags question: http://stackoverflow.com/q/24964481
tags question: http://stackoverflow.com/q/24921281
tags question: http://stackoverflow.com/q/24944738

http://stackoverflow.com/a/24948815
type: Answer
downvote count: 0
score: 5
has body: script tags needs to be reordered.
answers question: http://stackoverflow.com/q/24948593
upvote count: 5

http://stackoverflow.com/comment/38989688
score: 0
type: AnswerComment
type: Comment
has text: set the div `#map` to width 100% in your css. Then use `d3.select(window).on('resize', function() {...})`. Inside that function, recalculate the `width` of `#map` and get the `height` from that as you did earlier in your code. Then call `svg.attr('width', width).attr('height', height)` again to set the new values.
comment on: http://stackoverflow.com/a/25063260

http://stackoverflow.com/a/25039260
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/25039075
accepted answer of: http://stackoverflow.com/q/25039075
type: AcceptedAnswer
downvote count: 0
has body: I make a field required by adding the required attribute After seeing that comment: If the browser is modern, the form wont be submitted till the required fields are filled out. So, if the code enters the handler, everything's fine and you can continue. For older browsers: var valid = !($('[required]').filter(function() { return this.value == ''; }).length &gt; 0); // true or false

http://stackoverflow.com/a/24962096
type: Answer
accepted answer of: http://stackoverflow.com/q/24917500
has body: Finally, I use a ngRoute like this: $routeProvider.when('/:page', { controller: 'MyCtrl1' }); And in the MyCtrl1 on begin I have switch case $routeParams and use action.
answers question: http://stackoverflow.com/q/24917500
score: 0
type: AcceptedAnswer

http://stackoverflow.com/comment/38866205
comment on: http://stackoverflow.com/a/24996763
score: 0
type: AnswerComment
has text: no log output to the console. the onSubmit function must never be running
type: Comment

http://stackoverflow.com/a/26835931
has body: Rather than using google.maps.event.addDomListener to call the initialize function, you should do it the Angular way. First, add the initialize function to the scope and remove the google DomListener: (function() { mapController.$inject = ['$scope', '$routeParams']; function mapController($scope, $routeParams) { $scope.initialize = function() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 5 }; var map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions); } $scope.locationName = $routeParams.locationName; } angular.module("siteLookUpApplication").controller("mapController", mapController); }()); Then you can call initialize straight in the map-canvas div: &lt;div id="map-canvas" ng-init="initialize()"&gt;&lt;/div&gt;
downvote count: 0
answers question: http://stackoverflow.com/q/25018846
type: Answer
score: 3
upvote count: 3

http://stackoverflow.com/comment/38938685
comment on: http://stackoverflow.com/a/25036404
type: AnswerComment
score: 0
type: Comment
has text: Ok so now they're fading in but from the right. Is there any way to have them fade in from above where they would normally sit if the menu was in its expanded state? Also each time I click the nav menu button the menu items fade in slower and slower each time the menu is opened and closed.

http://stackoverflow.com/comment/38819390
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24972746
score: 1
has text: why ``async:false``??

http://stackoverflow.com/comment/38860521
type: QuestionComment
has text: @user3127242 I doubt it as there is not a reference to that whatsoever in the question or tags.
comment on: http://stackoverflow.com/q/24994791
score: 0
type: Comment

http://stackoverflow.com/q/24961957
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38798878
tagged with: php
answer count: 0
has body: I have a form with a captcha... If captcha is entered wrong, I need to go back to form page and let the user know he/she has to try again. I want to use window.history.back as the form fields will still have the values which were entered. Is it possible to append a variable to the url when I use this JS method? I can't use window.location = document.referer because it doesn't retain field values. Any ideas?
has comment: http://stackoverflow.com/comment/38798969
upvote count: 1
type: Question
has title: Append URL variable to window.history.back();
downvote count: 0
tagged with: javascript
score: 1

http://stackoverflow.com/comment/38995669
comment on: http://stackoverflow.com/a/25065703
score: 0
type: Comment
has text: it works. don't know what you mean. Check [JSFiddle](http://jsfiddle.net/b36rV/1/)
type: AnswerComment

http://stackoverflow.com/a/68654923
answers question: http://stackoverflow.com/q/24954973
type: Answer
downvote count: 0
score: 1
has body: Significant correction to the accepted answer: The cited section 10.1.1 no longer exists. Moreover, searching for the terms "authorized" or "other than" in the Terms & Conditions (T&C) returns no hits for a similarly worded replacement. In conclusion, upon reading the T&C it appears that Google no longer explicitly says You must not access or use the Maps API(s) or any Content through any technology or means other than those provided in the Service nor does Google appear to provide a replacement. T&C here: https://cloud.google.com/maps-platform/terms/
upvote count: 1

http://stackoverflow.com/a/25062963
type: Answer
has comment: http://stackoverflow.com/comment/38995066
has body: You can take a look at this FileSaver library: https://github.com/eligrey/FileSaver.js It should be able to do what you're after: saving without having to use a server backend. As for XML generation: You can just use the createElement and appendChild functions for that. var xml = document.createElement("root"); var node = document.createElement("rootchild"); node.appendChild( document.createElement("something") ); node.appendChild( document.createElement("somethingelse") ); node.appendChild( document.createElement("somethingdifferent") ); xml.appendChild(node); alert(xml.innerHTML); As for your secondary question in the comments below: If you want to add "red" to the color element you only need to do this: var colorNode = document.createElement("COLOR"); var colorText = document.createTextNode("red"); colorNode.appendChild(colorText); node.appendChild(colorNode ); If you need any more information, I suggest you take a look at the reference documentation of w3schools: http://www.w3schools.com/jsref/dom_obj_all.asp http://www.w3schools.com/jsref/dom_obj_document.asp
score: 2
has comment: http://stackoverflow.com/comment/38991913
upvote count: 2
has comment: http://stackoverflow.com/comment/38991682
has comment: http://stackoverflow.com/comment/38991488
has comment: http://stackoverflow.com/comment/38989096
has comment: http://stackoverflow.com/comment/38989963
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25062623
answers question: http://stackoverflow.com/q/25062623
has comment: http://stackoverflow.com/comment/38989274

http://stackoverflow.com/comment/38860805
type: Comment
type: QuestionComment
has text: $('#yourdiv').live - http://api.jquery.com/live/
comment on: http://stackoverflow.com/q/24995074
score: 0

http://stackoverflow.com/comment/38877338
score: 0
type: AnswerComment
has text: I have tried something similar (not exactly the same thing though. I tried keydown event).I guess this will be fired every time when keyup happened not just the first.
type: Comment
comment on: http://stackoverflow.com/a/25003653

http://stackoverflow.com/q/25052676
has body: I am developing an application in ASP.Net using C#. Also there are lots of JQuery function used in my application. The application is working fine in Fire Fox and Google Chrome but some of the function is not working in Internet Explorer 10. In my web page I have defined window.bind("load") function. Under this function several JQuery function will execute. This function is working fine in all browsers except IE 10. The code snippet is as follows: $(window).bind("load", function () { //alert("I am In Window Bind Function"); all_blur(); get_all_es(); loadImage(); }); In this code snippet, the alert code is commented. this is not working in IE. But if I put the alert code active then it is working fine. that means the following code working fine for me. $(window).bind("load", function () { alert("I am In Window Bind Function"); all_blur(); get_all_es(); loadImage(); }); But I have to execute this function without alert. How can I do that? Please help me.
linked to: http://stackoverflow.com/q/9651012
has comment: http://stackoverflow.com/comment/38969829
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38970413
has answer: http://stackoverflow.com/a/36885875
type: Question
has title: Some of Jquery function is not working in IE
has comment: http://stackoverflow.com/comment/38969800
tagged with: internet-explorer
has answer: http://stackoverflow.com/a/25053007
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38970267
score: 0

http://stackoverflow.com/comment/38859427
score: 0
comment on: http://stackoverflow.com/q/24994347
type: QuestionComment
has text: Can you use `app.run` instead, or do you need stuff from your Utils service during the config phase?
type: Comment

http://stackoverflow.com/q/25009508
score: 3
tagged with: firefox
downvote count: 0
has comment: http://stackoverflow.com/comment/38888875
answer count: 0
has comment: http://stackoverflow.com/comment/38888811
favorite count: 0
type: Question
has comment: http://stackoverflow.com/comment/40439843
tagged with: opera
has body: Note: I asked this a while ago and it didn't get any answers but it did make me create an interesting fiddle, which is at the end of the post. Check the comments if you're interested. In short, trunc and imul, new additions to the standard, are there to fill a gap when it comes to treating certain types of values properly, without just turning them into 0. Try the fiddle and look at the chart, it should all be clear. Also, check the perf for an idea of the performance difference. original post tl;dr: Is there ever a reason to use the new Math.trunc, especially when going for performance? Would the same apply to Math.ceil? (ps: sorry if I don't make much sense, been up all night, can hardly think clearly :'( ) Earlier today I was reading up on what new ES6 stuff I can use in Firefox and Chrome. That was when I came across Math.imul (integer multiplication, 32-bit) and Math.trunc (truncates number to integer part). Math.trunc struck me as odd that it would exist, since that same truncation can simply be done with Math.imul(n, 1) where n is a floating point number. I had forgotten that the same thing can be done with bitwise operations, but after a bit of searching I found 2 SO questions that where related: `Math.trunc` vs `|0` vs `&lt;&lt;0` vs `&gt;&gt;0` vs `&amp;-1` vs `^0` How does ~~ work as math.floor? However, neither there nor anywhere else did I find information on comparative performance. So I made a quick jsperf and it benched Math.imul(Math.PI, 1) at 50 times faster than Math.trunc(Math.PI). So I thought something's up, since, if Math.imul is so much faster, why would anyone ever use Math.trunc and why add it into the spec when Math.imul can do its job? After reading the aforementioned questions, I made this fiddle which builds a table with all the return values for various inputs to relevant functions (including the bitwise operations). As mentioned in the threads, they behave differently depending on their input - bitwise operations deal only with number…
has comment: http://stackoverflow.com/comment/38888855
has comment: http://stackoverflow.com/comment/40440353
has comment: http://stackoverflow.com/comment/38888810
upvote count: 3
has comment: http://stackoverflow.com/comment/38888701
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38888962
has comment: http://stackoverflow.com/comment/40440244
tagged with: performance
has comment: http://stackoverflow.com/comment/40439134
has title: Performance of integer casts and rounding
has comment: http://stackoverflow.com/comment/40433269
tagged with: javascript
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/22277172
linked to: http://stackoverflow.com/q/22156688

http://stackoverflow.com/comment/38835488
has text: I tried it, no change
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24981481
score: 0

http://stackoverflow.com/q/24921463
tagged with: ajax
has answer: http://stackoverflow.com/a/24921589
answer count: 1
has body: I redirect to the main page during 2 scenarios While the user hits logout The session expires... Logout functionality code... $("#logoutLink").click(Logout); function Logout() { $.post("Logout", { antiCSRF: '{{acsrf}}', session_id: '{{session_id}}' }); alert("You are now securely logged out."); window.location = './'; } Session expiration code function checksession() { $.post("CheckSession", { antiCSRF : '{{acsrf}}', session_id: '{{session_id}}' },validateresult).fail(function() {alert("Session check failed")}) } function validateresult(result){ if (result == "N"){ valid_flag = "N" alert("Your session has been timed-out. Please click OK to be redirected to the login page to start a new session."); window.location = './'; } else { valid_flag = "Y"; return valid_flag } } In the first case ie; when I hit the logout button the page is redirected to the main page without any issues... But the code that gets executed during the ajax call does not work..ie; window.location is not working.. Not sure what is the difference between the
type: UnansweredQuestion
has title: window.location is not working with ajax call
has comment: http://stackoverflow.com/comment/38723763
score: 0
type: Question
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38723193

http://stackoverflow.com/q/25003217
type: Question
has answer: http://stackoverflow.com/a/42660399
has comment: http://stackoverflow.com/comment/38876890
tagged with: javascript
has title: Using encodeURI() vs. escape() for utf-8 strings in JavaScript
answer count: 3
has answer: http://stackoverflow.com/a/33724177
has body: I am handling utf-8 strings in JavaScript and need to escape them. Both escape() / unescape() and encodeURI() / decodeURI() work in my browser. escape() &gt; var hello = "안녕하세요" &gt; var hello_escaped = escape(hello) &gt; hello_escaped "%uC548%uB155%uD558%uC138%uC694" &gt; var hello_unescaped = unescape(hello_escaped) &gt; hello_unescaped "안녕하세요" encodeURI() &gt; var hello = "안녕하세요" &gt; var hello_encoded = encodeURI(hello) &gt; hello_encoded "%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94" &gt; var hello_decoded = decodeURI(hello_encoded) &gt; hello_decoded "안녕하세요" However, Mozilla says that escape() is deprecated. Although encodeURI() and decodeURI() work with the above utf-8 string, the docs (as well as the function names themselves) tell me that these methods are for URIs; I do not see utf-8 strings mentioned anywhere. Simply put, is it okay to use encodeURI() and decodeURI() for utf-8 strings?
downvote count: 0
tagged with: utf-8
tagged with: unicode
favorite count: 0
tagged with: encode
has comment: http://stackoverflow.com/comment/70630635
possible better answer: http://stackoverflow.com/a/66748986
has comment: http://stackoverflow.com/comment/38876282
has answer: http://stackoverflow.com/a/66748986
score: 31
type: AnsweredQuestion
tagged with: escaping
accepted answer: http://stackoverflow.com/a/33724177
linked to: http://stackoverflow.com/q/75980
upvote count: 31

http://stackoverflow.com/comment/38950228
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25036908
has text: @alan.j.m It should be `document.attachEvent` apparently the window does not receive the onmousewheel event

http://stackoverflow.com/a/25023315
answers question: http://stackoverflow.com/q/25021903
score: 8
has comment: http://stackoverflow.com/comment/40681223
accepted answer of: http://stackoverflow.com/q/25021903
type: Answer
downvote count: 0
has body: Repeat only works with arrays. This is a known issue: https://github.com/Polymer/polymer-expressions/issues/11 You can achieve the basic effect you're looking for with a few extra steps, but there are some drawbacks. Here's a simple example with an inline function: &lt;template repeat="{{person in keys(people)}}"&gt; &lt;div class="row" &gt; {{people[person].name}} &lt;/div&gt; Then define the function on your element prototype like this: keys: function(input) { return Object.keys(input); }, Inline function expressions are relatively new, and not in the docs yet, but they work much like filters. You can see this code in action here: http://jsbin.com/puhis/1/edit Note that there are some problems with this approach: adding a new object to people doesn't cause a new row to be added. Replacing the entire people object causes the bindings to be updated, but it's inefficient if only a few items in the object changed. If you maintain an array version of the data in the object, and mutate it when the object mutates, you could observe the array instead. This version is slightly more code, but it updates and it doesn't create or destroy extra DOM nodes when you add or remove an element: http://jsbin.com/puhis/3/edit
upvote count: 8
type: AcceptedAnswer

http://stackoverflow.com/comment/38765070
has text: Yes it does! Thank you so much. I have been looking around for this and come across half a dozen implementations none of which worked.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24943695
type: Comment

http://stackoverflow.com/a/32264230
score: 0
type: Answer
has body: Using webrtc it's possible. Read this manual Webrtc manual or read the book Real-Time Communication with WebRTC: Peer-to-Peer in the Browser
answers question: http://stackoverflow.com/q/24942911

http://stackoverflow.com/q/25028198
has title: Need help with simple angularjs programming
tagged with: javascript
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/25028784
tagged with: angularjs
has answer: http://stackoverflow.com/a/25028481
accepted answer: http://stackoverflow.com/a/25028481
has comment: http://stackoverflow.com/comment/38923926
type: AnsweredQuestion
has body: I am trying to do simple programming in angularjs. I have created two buttons. The first button has text "clickHere", and the second has no text. My task is when I click the button that has text, it will automatically get empty and the second button will have the same text. (and vice versa). var myApp = angular.module('myApp',[]); function MyCtrl($scope) { $scope.name = 'Superhero'; $scope.name1 = ''; var val = 'Hello'; $scope.click0 = function() { //alert("hello!"); $scope.name = $scope.name1; $scope.name1=""; //return val; }; $scope.click1 = function() { //alert("hello!"); $scope.name1 = $scope.name; $scope.name=""; // return val; }; } &lt;body ng-app="myApp"&gt; &lt;div ng-controller="MyCtrl"&gt; &lt;button ng-click="click0()" &gt;{{name}}&lt;/button&gt; &lt;button ng-click="click1()" &gt;{{name1}}&lt;/button&gt; &lt;/div&gt; &lt;/body&gt; Here is my code in jsfiddle. http://jsfiddle.net/simpleorchid/a65zV/
has answer: http://stackoverflow.com/a/25028784
type: Question

http://stackoverflow.com/comment/38790334
has text: Quite wired, It works fine in IE & Chrome just gives me unexpected result in FF. Anyways thanks for your help appreciate that.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24950662

http://stackoverflow.com/a/25119837
has body: Found the solution, as I'm using https I had to load a different script file. So if you want to use aviary over a https connection, use: https://dme0ih8comzn4.cloudfront.net/js/feather.js
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24937997
answers question: http://stackoverflow.com/q/24937997
score: 0
type: Answer

http://stackoverflow.com/a/25003645
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38877160
type: Answer
has comment: http://stackoverflow.com/comment/38877191
accepted answer of: http://stackoverflow.com/q/25003584
has comment: http://stackoverflow.com/comment/38877241
upvote count: 2
answers question: http://stackoverflow.com/q/25003584
has comment: http://stackoverflow.com/comment/38877199
has comment: http://stackoverflow.com/comment/38877282
has comment: http://stackoverflow.com/comment/38877225
has comment: http://stackoverflow.com/comment/38877174
has body: Well technically speaking you can't update the DB in the AJAX call... your AJAX call fires code and an AJAX call is not much different at all than any other HTTP method. I mean it is a HTTP call... so of course it is perfectly fine to update the DB if the code being fired is a result of an AJAX call.
has comment: http://stackoverflow.com/comment/38877288
score: 2

http://stackoverflow.com/a/25043835
score: 1
answers question: http://stackoverflow.com/q/25043033
downvote count: 0
type: Answer
has body: The whole &lt;?php propiertary blah blah ?&gt; makes it hard to decipher but my guess is that the handler is being generated for whatever is being created by php, i.e. the php generates &lt;button id="phpButton"&gt; blah &lt;/button&gt; and then a handler like $("#phpButton").click(....) Notice that the handler is NOT on "#the-standard-button". So, you need make sure that you are using the correct selector when calling the click() in $("#my-custom-button").click(...) Check out this jsFiddle. Notice which secondary click event is fired.
upvote count: 1

http://stackoverflow.com/a/24914994
has body: You can pass an array of promises to $.when, as reported in the documentation
upvote count: 0
has comment: http://stackoverflow.com/comment/38710579
type: Answer
answers question: http://stackoverflow.com/q/24914913
downvote count: 1
has comment: http://stackoverflow.com/comment/38711088
score: -1

http://stackoverflow.com/comment/38904837
has text: You need a state manager then. The state manager can keep track of what state you are in using the $routeProvider, and based on that can set what backUrl and nextUrl. Your controllers and directives should ideally not be responsible for knowing where the back and next buttons go. So the state manager could replace the globals guy and listen for route changes and then adjust the back and next url, or back and next could be functions that are called that then check what route is currently active and then navigate wherever based on that.
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25006309

http://stackoverflow.com/a/24956375
upvote count: 1
answers question: http://stackoverflow.com/q/24956324
type: Answer
has body: Change your function like bellow function tad(strg) { var char = strg.split('-') for (var i = 1; i &lt; char.length; i++) { char[i] = char[i].charAt(0).toUpperCase() + char[i].slice(1) } return char.join(''); }
downvote count: 0
score: 1

http://stackoverflow.com/a/24948364
has comment: http://stackoverflow.com/comment/38774697
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24948345
type: Answer
has comment: http://stackoverflow.com/comment/38774129
answers question: http://stackoverflow.com/q/24948345
has body: Try imagesLoaded: http://imagesloaded.desandro.com/ Usage is straightforward: imagesLoaded( elem, callback );
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38801436

http://stackoverflow.com/comment/38779831
comment on: http://stackoverflow.com/a/24949534
type: Comment
has text: well actually i keep on trying to alter `self.Main` instead of doing on initial `Get` beoz on first load i am using computed to change my format from 12-12-2012 to 12/12/2012 . later i have to convert back but its a tricky scenario now right .
score: 0
type: AnswerComment

http://stackoverflow.com/a/47498056
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25052670
has comment: http://stackoverflow.com/comment/81951364
has body: var fieldStatus = false; $scope.fieldsMsgContainer = $('&lt;div&gt;'); angular.forEach(angular.element(".invalid-cls"), function(value) { var elem = angular.element(value); if (!elem.val()) { var errorMsg = ""; $("&lt;div&gt;").addClass("errorField").html(anacReservationMessages.errorMsg.fieldInvalid + elem.closest('.row').find('label').html()).appendTo($scope.fieldsMsgContainer); fieldStatus = true; errorMsg = 'Specific Error message ' + elem.closest('.row').find('label').html(); } });

http://stackoverflow.com/comment/38987744
comment on: http://stackoverflow.com/a/25061872
has text: @Laya302 if you have a jsfiddle that *doesn't* work, you should post a link to it.
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24969143
has comment: http://stackoverflow.com/comment/38812955
answers question: http://stackoverflow.com/q/24966781
has body: For JSHint, there is a built-in reporter for this purpose, fail. If an error occurs, it will stop your gulp process. You just have to redefine your task like : gulp.task('jshint', function () { return gulp.src(['assets/js/**/*.js']) .pipe(jshint('.jshintrc')) .pipe(jshint.reporter('jshint-stylish')) .pipe(jshint.reporter('fail')) }) With other tasks, you can add an error callback on it and exit the process to prevent subsequent tasks to run. Here is an example with ngmin (cause uglify is hard to break, but it will be the same) : function handleError (err) { console.log(err.toString()) process.exit(-1) } gulp.task('min', function () { return gulp.src(['assets/js/**/*.js']) .pipe(ngmin()) .on('error', handleError) })
upvote count: 9
accepted answer of: http://stackoverflow.com/q/24966781
has comment: http://stackoverflow.com/comment/38812891
has comment: http://stackoverflow.com/comment/38812765
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38812665
type: Answer
score: 9

http://stackoverflow.com/q/25017758
has comment: http://stackoverflow.com/comment/38903869
has body: I experience the problem with parsing json encoded object in js. JSON.parse(word_array); with error Uncaught SyntaxError: Unexpected identifier My investigation showed that object word_array does not exist because of wrong-formation in PHP: it has a unescaped single quote' inside, thus making js consider it as the end of the string. I form encoding next way: echo "&lt;script&gt;var word_array = '"; echo json_encode($word_set); echo "';\n"; As far as I know, json_encode should escape all undesirable charactets like ' but it does not. What might be the problem? My php version: Version PHP: 5.3.13 And $word_set is array of assoc. array: $word_set = array(); while($stmt-&gt;fetch()) { $word_set_tmp[] = array( 'word' =&gt; $word, 'definition' =&gt; $def ); array_push ($word_set,$word_set_tmp); }
has comment: http://stackoverflow.com/comment/38904024
tagged with: php
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38903913
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/25017920
type: Question
has comment: http://stackoverflow.com/comment/38903814
has comment: http://stackoverflow.com/comment/38903885
answer count: 1
tagged with: javascript
has title: PHP json_encode return unescaped '
score: 0
accepted answer: http://stackoverflow.com/a/25017920
has comment: http://stackoverflow.com/comment/38904044

http://stackoverflow.com/q/25043141
linked to: http://stackoverflow.com/q/24205596
tagged with: database
tagged with: javascript
tagged with: rows
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25043210
has answer: http://stackoverflow.com/a/25043309
has title: Multiple rows to database, not adding
type: UnansweredQuestion
has body: I found this script to add rows to my form somewhere and I can add rows that works, the only problem is that when I submit it, only the first row are submitted. Never tried anything like this before so I might be completely off and if that is the case at least I will know that. THIS IS THE HTML + Välj typ SWE INTER Välj Dis D SJ E U K T THIS IS THE PHP/DATABASE PROCESS <?php session_start(); ob_start(); include("function/conn.php"); //Databas koppling mysql_set_charset("utf8"); $Horse_id = addslashes($_POST['Horse_id']); $Year = addslashes($_POST['years']); $Place = addslashes($_POST['place']); $Event = addslashes($_POST['event']); $Class = addslashes($_POST['class']); $Assoc = addslashes($_POST['association']); $Point = addslashes($_POST['points']); $Type = addslashes($_POST['type']); $Dis = addslashes($_POST['dis']); //Sparar värden i variabler ifrån form $result = mysql_query(" INSERT INTO shows (Horse_id, years, place, event, class, association, points, type, dis) VALUES('$Horse_id', '$Year', '$Place', '$Event', '$Class', '$Assoc', '$Point', '$Type', '$Dis') ") or die(mysql_error()); // Lägger in ny post i databasen if ($result){ //Skicka tillbacka användaren till backend header("location: admin.php"); } else{ echo "Something went wrong."; } ?>
tagged with: php
type: Question

http://stackoverflow.com/comment/38703966
comment on: http://stackoverflow.com/q/24911447
has text: Can u give link to Proper code of Own caraosel where I can see fade effect?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24993797
has comment: http://stackoverflow.com/comment/38867878
tagged with: javascript
score: 0
tagged with: memory-leaks
has comment: http://stackoverflow.com/comment/38858470
favorite count: 0
has comment: http://stackoverflow.com/comment/38864682
answer count: 0
type: UnansweredQuestion
upvote count: 1
has comment: http://stackoverflow.com/comment/38858363
downvote count: 1
has title: Memory leak example
has body: Explain please step by step a reason of memory leak in the following part of code: var theThing = null; var replaceThing = function () { var priorThing = theThing; // hold on to the prior thing var unused = function () { // 'unused' is the only place where 'priorThing' is referenced, // but 'unused' never gets invoked if (priorThing) { console.log("hi"); } }; theThing = { longStr: new Array(1000000).join('*'), // create a 1MB object someMethod: function () { console.log(12); } }; }; setInterval(replaceThing, 10);
type: Question

http://stackoverflow.com/a/24919379
type: Answer
has body: It looks as though you're passing the success: function(data) function a variable for the JSON data called data. Then immediately within the success function you're instantiating an entirely new data variable with a DataTable object, thus overwriting the previous data variable containing the returned JSON data. (line: var data = new google.visualization.DataTable();) I would try changing the name of that var data variable to something else, say, data_table, though I haven't actually tried making this change to see if it works. Hope this helps!
score: 1
answers question: http://stackoverflow.com/q/24919143
upvote count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38720469

http://stackoverflow.com/comment/42075063
type: Comment
comment on: http://stackoverflow.com/a/24984393
has text: I had the same problem, and this resolved the error message, but now the animation does not play for me either :(
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38881687
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25005898
type: Comment
has text: Sorry if I'm unclear. Currently, the image resizes just fine. However, I want the nav to be positioned on the right side of the image at a distance equal to the distance from the right side of viewport. [IMG] EQUAL [NAV] EQUAL [Right edge of viewport]

http://stackoverflow.com/q/25032133
favorite count: 0
score: 0
answer count: 3
downvote count: 1
accepted answer: http://stackoverflow.com/a/25032212
possible better answer: http://stackoverflow.com/a/25032249
has answer: http://stackoverflow.com/a/25032212
has answer: http://stackoverflow.com/a/25032249
type: AnsweredQuestion
has body: I have 2 JS(json) obects with identical keys: {"id1" : "some1", "id2" : "some2", "id3" : "some3"} {"id1" : "another1", "id2" : "another2", "id3" : "another3"} I need to convert it into [ { "id" : "id1", "some" : "some1", "another" : "another1" }, { "id" : "id2", "some" : "some2", "another" : "another2" }, { "id" : "id3", "some" : "some3", "another" : "another3" } ] So, this is the question. Thanks!
has answer: http://stackoverflow.com/a/73060002
type: Question
has title: Convert two objects into one array (JavaScript)
upvote count: 1
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/38748482
has text: hey why has the question been downvoted? its a perfectly sensible question.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24935133

http://stackoverflow.com/q/24973929
has answer: http://stackoverflow.com/a/24973979
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24973979
has answer: http://stackoverflow.com/a/24973960
has answer: http://stackoverflow.com/a/24974075
downvote count: 1
has answer: http://stackoverflow.com/a/24974087
type: Question
accepted answer: http://stackoverflow.com/a/24973960
has title: Comparing 2 array with different value positions
tagged with: javascript
score: -1
upvote count: 0
has body: I have two unknown arrays, and I want to know if they are equal, no matter the position of their elements, ex: A = [1,3,7] B = [3,7,1] -&gt; return true A = [1,3] B = [1,3,7] -&gt; return false A = [1,3,7] B = [1,4] -&gt; return false Should I sort it first, and then compare? Or is there a better way?
tagged with: jquery
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/24974144

http://stackoverflow.com/q/24959909
downvote count: 0
tagged with: javascript
score: 6
favorite count: 0
has body: I'm trying to have a certain scene in my game where all of the game sprites have a gray overlay on them. I thought about just creating a gray version of each sprite, but then I realized that is not very DRY or easy. I need this overlay for both a singular sprite, like so: sprite = game.add.sprite(x, y, "name_of_sprite"); And I need it for a group: group = game.add.group(); How do you this in context of phaser?
has title: Giving sprites an overlay in the Phaser framework
tagged with: http://stackoverflow.com/tag/html
answer count: 1
upvote count: 6
has answer: http://stackoverflow.com/a/25000109
has comment: http://stackoverflow.com/comment/38870629
has comment: http://stackoverflow.com/comment/38811640
has comment: http://stackoverflow.com/comment/38964539
tagged with: phaser-framework
type: AnsweredQuestion
type: Question
accepted answer: http://stackoverflow.com/a/25000109

http://stackoverflow.com/comment/38751266
score: 0
comment on: http://stackoverflow.com/a/24936031
type: Comment
type: AnswerComment
has text: this is my question , not sure how i can call a javaScript function form insdie the success ?

http://stackoverflow.com/comment/38960759
has text: @bad_boy - I didn't mention `header('Content-Type: application/json');` which can be used as well. I'd say - whichever approach works for you.
type: Comment
comment on: http://stackoverflow.com/a/25047044
score: 0
type: AnswerComment

http://stackoverflow.com/a/24989927
has comment: http://stackoverflow.com/comment/38866016
has comment: http://stackoverflow.com/comment/38867333
type: AcceptedAnswer
has body: 2017 update: First, for readers coming today - here is a version that works with Node 7 (4+): function enforceFastProperties(o) { function Sub() {} Sub.prototype = o; var receiver = new Sub(); // create an instance function ic() { return typeof receiver.foo; } // perform access ic(); ic(); return o; eval("o" + o); // ensure no dead code elimination } Sans one or two small optimizations - all the below is still valid. Let's first discuss what it does and why that's faster and then why it works. What it does The V8 engine uses two object representations: Dictionary mode - in which object are stored as key - value maps as a hash map. Fast mode - in which objects are stored like structs, in which there is no computation involved in property access. Here is a simple demo that demonstrates the speed difference. Here we use the delete statement to force the objects into slow dictionary mode. The engine tries to use fast mode whenever possible and generally whenever a lot of property access is performed - however sometimes it gets thrown into dictionary mode. Being in dictionary mode has a big performance penalty so generally it is desirable to put objects in fast mode. This hack is intended to force the object into fast mode from dictionary mode. Bluebird's Petka himself talks about it here. These slides (wayback machine) by Vyacheslav Egorov also mentions it. The question "*https://stackoverflow.com/questions/23455678/pros-and-cons-of-dictionary-mode*" and its accepted answer are also related. This slightly outdated article is still a fairly good read that can give you a good idea on how objects are stored in v8. Why it's faster In JavaScript prototypes typically store functions shared among many instances and rarely change a lot dynamically. For this reason it is very desirable to have them in fast mode to avoid the extra penalty every time a function is called. For this - v8 will gladly put objects that are the .prototype property of functions in fast mode since they wi…
downvote count: 0
has comment: http://stackoverflow.com/comment/38851528
upvote count: 325
has comment: http://stackoverflow.com/comment/64880508
accepted answer of: http://stackoverflow.com/q/24987896
type: Answer
score: 325
answers question: http://stackoverflow.com/q/24987896
has comment: http://stackoverflow.com/comment/64897050
has comment: http://stackoverflow.com/comment/38867489
has comment: http://stackoverflow.com/comment/46840577
has comment: http://stackoverflow.com/comment/38851889
has comment: http://stackoverflow.com/comment/38866125

http://stackoverflow.com/comment/102986370
comment on: http://stackoverflow.com/a/55807565
type: Comment
score: 3
type: AnswerComment
has text: This is the correct answer and is so simple. Thanks!

http://stackoverflow.com/q/24920826
tagged with: javascript
has answer: http://stackoverflow.com/a/24920913
answer count: 2
downvote count: 3
has answer: http://stackoverflow.com/a/24920851
tagged with: jquery
favorite count: 0
has body: I have some dropdown menus that all have the same class. When I click the dropdown, the submenu appears underneath. The problem is that after adding a second dropdown, when I click on either of them, both submenús appear. I have tried using different applications of $(this) with no success... $('.dropdown').click(function() { $('.subdropdown').toggleClass("select"); }); "dropdown" is the parent element. When I click it, all subdropdowns are toggled.
type: UnansweredQuestion
score: -3
tagged with: http://stackoverflow.com/tag/html
tagged with: css
upvote count: 0
has title: jQuery: How do I affect only the child element of the element I clicked?
type: Question

http://stackoverflow.com/comment/38855445
type: QuestionComment
has text: @Nate: point taken. The question should've explain the context better.
comment on: http://stackoverflow.com/q/24991377
score: 0
type: Comment

http://stackoverflow.com/comment/38733059
type: Comment
score: 0
type: AnswerComment
has text: Thanks for the time you spent on this issue. It's so useful to get help from the community when we are stuck on an issue.
comment on: http://stackoverflow.com/a/24923681

http://stackoverflow.com/a/25011169
type: Answer
has comment: http://stackoverflow.com/comment/38893480
has comment: http://stackoverflow.com/comment/38892350
score: 0
has body: you need simply add $(document).ready(function(){ ... } to use jquery
has comment: http://stackoverflow.com/comment/38895704
answers question: http://stackoverflow.com/q/25011112

http://stackoverflow.com/comment/39405385
comment on: http://stackoverflow.com/a/25252446
has text: okay, i have implemented on javascript as well. i had to debug a while, but the main bug was in my code, that javascript dividing produces floats, so you have to use Math.floor() everytime where a simple divide was enough java.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/25012285
has body: For your better understanding, this script is called from within the 1.php file. As you can see I'm trying to retreive the $PHPvariable variable declared in 2.php. Am I doing it correctly?? For passing variable from 1.php and 2.php you have to use the form. This is a example for the login user username: password: Now inside the file 2.php you verification the variable passing. <?php ini_set('display_errors', 1); error_reporting(E_ALL & ~E_NOTICE); if (isset($_POST['invio'])) if (empty($_POST['userName']) || empty($_POST['password'])) $messaggio = "dati mancanti"; else { session_start(); $_SESSION['userName'] = $_POST['userName']; $_SESSION['dataLogin'] = time(); $_SESSION['ruolo'] = $ruolo[0]; $messaggio = ' Benvenuto '; ; } ?> Now you can print (always inside the page 2.php) the result of message: <?php echo $messaggio; echo $_POST['userName']; ?> And for return in the page 1.php you can with: <?php header('Location: 1.php'); ?> Inside the script of php. If you want to use AJAX and without refreshing page I think that you want this exercise And I suggest for you case this: var value="your value" xmlhttp.open("GET","gethint.asp?q="+value,true); And on gething.php <?php //get the q parameter from URL $q=$_GET["q"]; //lookup all hints from array if length of q>0 if (strlen($q) > 0) { echo $q; }else{ echo "miss value"; } ?>
has comment: http://stackoverflow.com/comment/38893676
answers question: http://stackoverflow.com/q/25011909
has comment: http://stackoverflow.com/comment/38895568
has comment: http://stackoverflow.com/comment/38895435
score: 0
has comment: http://stackoverflow.com/comment/38893913
has comment: http://stackoverflow.com/comment/38893986
type: Answer

http://stackoverflow.com/comment/38941735
comment on: http://stackoverflow.com/a/25038108
type: Comment
has text: ah thanks, everyone gave the same answer but you were first by about 5 seconds :P will accept after 10 minutes is up
score: 0
type: AnswerComment

http://stackoverflow.com/q/25023203
accepted answer: http://stackoverflow.com/a/25023324
answer count: 3
has comment: http://stackoverflow.com/comment/38914546
favorite count: 0
has comment: http://stackoverflow.com/comment/38924598
has answer: http://stackoverflow.com/a/25023267
upvote count: 2
has comment: http://stackoverflow.com/comment/38914957
linked to: http://stackoverflow.com/q/16063394
possible better answer: http://stackoverflow.com/a/25023318
has title: Array prototype and literal
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/25023318
tagged with: prototype
type: Question
has body: Array.prototype.slice === [].slice // output true console.log(Array.prototype) // output [] Why the following condition is false (taking above statements in count) Array.prototype === [] //output (false)
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25023324

http://stackoverflow.com/a/25060934
downvote count: 0
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25060308
answers question: http://stackoverflow.com/q/25060308
type: AcceptedAnswer
has body: cat1 is a variable array where as this.id represents a string of 'cat1', not the array variable - what you may want to do is use an associative array to store your arrays: var cats = {}; cats['cat1'] = ['a.jpg']; $(".manual2").click(function(e) { e.preventDefault(); $.fancybox(cats[this.id], { 'padding' : 0, 'transitionIn' : 'none', 'transitionOut' : 'none', 'type' : 'image', 'changeFade' : 1 }); }); Or you could just convert the string into the variable using window[this.id]. Eg $.fancybox(window[this.id], ...etc
type: Answer
score: 2

http://stackoverflow.com/a/24984925
type: Answer
answers question: http://stackoverflow.com/q/24981481
score: 0
has body: I like your third attempt best. Assuming your data is in order, you just need to brush up on the jQuery API. Here's a working version of what I gather you're trying to do: function createDDL(data) { var options = $.parseJSON(data.Data); $.each(options, function(n, option) { var $option = $('&lt;option /&gt;').text(option.name).val(option.id); $("#productDDL").append($option); }); } Fiddle: http://jsfiddle.net/klenwell/Esr5q/

http://stackoverflow.com/a/24946648
accepted answer of: http://stackoverflow.com/q/24946627
has body: You need to use ng-repeat to iterate over the array https://docs.angularjs.org/api/ng/directive/ngRepeat Do this {{zones.zone}} {{zones.network}} {{ip}} {{zones.ipv6}}
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24946627
type: Answer
score: 0

http://stackoverflow.com/q/24913179
linked to: http://stackoverflow.com/q/4968406
linked to: http://stackoverflow.com/q/11922383
has comment: http://stackoverflow.com/comment/38706920
duplicate of: http://stackoverflow.com/q/4968406
has answer: http://stackoverflow.com/a/24913302
duplicate of: http://stackoverflow.com/q/11922383
has body: I need to know why this isn't working. My Javascript code accesses a variable in an object. But it appears not to be working, partly because I can't figure out the syntax. var obj = { size:"small", big:false, thing:true } alert(obj[size]); I'm just not sure if I got the syntax right…
type: Question
answer count: 2
tagged with: javascript
has title: JavaScript Calling Object Syntax
score: 0
accepted answer: http://stackoverflow.com/a/24913302
has answer: http://stackoverflow.com/a/24913226
has comment: http://stackoverflow.com/comment/38706973
possible better answer: http://stackoverflow.com/a/24913226
tagged with: node.js
tagged with: object
type: AnsweredQuestion

http://stackoverflow.com/q/24936873
tagged with: ajax
has comment: http://stackoverflow.com/comment/38757413
possible better answer: http://stackoverflow.com/a/24937913
has answer: http://stackoverflow.com/a/24937945
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38754090
type: AnsweredQuestion
has title: How to post and receive data in a loop using AJAX to and from a servlet
tagged with: java
type: Question
has answer: http://stackoverflow.com/a/24937913
has comment: http://stackoverflow.com/comment/38751722
tagged with: javascript
has answer: http://stackoverflow.com/a/24937112
accepted answer: http://stackoverflow.com/a/24937112
score: 0
answer count: 3
has body: I am working on a news summarizer and one of its requirements is to display a list of article titles dynamically on a webpage using AJAX called from a database. I have been able to successfully configure the datastore(google app engine) and use the AJAX call to display article title. However, there is one big issue here. I am only able to call and show a single title. I want to run the AJAX call inside a loop so that I can display 10 news articles stored in datastore from 1 to 10 using the variable i of the loop as the unique reference. The AJAX CODE : function change(element) { var xmlhttp; var i = 1; var param = "category=" + element + "&amp;no=" + i; // This i is the key to my operation. alert(param); //testing purpose xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { //alert('function()'); if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { var div = document.getElementById('content'); div.innerHTML = ''; for (i = 1; i &lt;=10; i++) { var a = document.createElement('a'); a.href = "#"; a.onclick = rem.bind(null, i); a.innerHTML = '&lt;h2 id="theading'+i+'"&gt;' + xmlhttp.responseText + '&lt;/h2&gt;'; //the title will go here. div.appendChild(a); div.appendChild(document.createElement('br')); } } } xmlhttp.open("POST", "/display?" + param, true); xmlhttp.send(); } I also request to suggest JavaScript code and not jquery, as I am unfamiliar with it. These are my humble beginnings. UPDATE MY SERVLET CODE: public class ArticleHandler extends HttpServlet { public void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { resp.setContentType("text/html"); PrintWriter out = resp.getWriter(); String category=req.getParameter("category"); String number=req.getParameter("no"); int i = Integer.parseInt(number); List&lt;EntityArticles&gt; articles = RegisterClass.ofy().load().type(EntityArticles.class).filter("category ",category).list(); out.write(articles); // Is this the correct way to send this list articles ? …
has comment: http://stackoverflow.com/comment/38754920
has comment: http://stackoverflow.com/comment/38755098

http://stackoverflow.com/q/25003761
tagged with: javascript
answer count: 3
downvote count: 0
tagged with: jquery
has title: Remove Appended Element on Second Click jQuery
favorite count: 0
has answer: http://stackoverflow.com/a/25003896
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25003943
has body: When you click the gray heart, the div gets appended to a container on the right side. I want it to remove the appended element when you click the pink heart. It just keeps appending the content... $('.icon-heart').click(function(){ var $newEl = $(this).closest('.color-container').html(); if( $(this).css('color') === 'rgb(204, 204, 204)' ) { // if gray $(this).css('color', 'rgb(234, 76, 136)'); // turn to pink $('.b').append($newEl); // append new element } else if( $(this).css('color') === 'rgb(234, 76, 136)' ) { // if pink $(this).css('color', 'rgb(204, 204, 204)'); // turn to gray $newEl.remove(); // remove appended element } }); Here is the Fiddle
has answer: http://stackoverflow.com/a/25003871
type: AnsweredQuestion
score: 1
upvote count: 1
possible better answer: http://stackoverflow.com/a/25003871
type: Question
accepted answer: http://stackoverflow.com/a/25003896

http://stackoverflow.com/comment/39010981
comment on: http://stackoverflow.com/q/25065954
score: 0
has text: This might be of help: http://stackoverflow.com/questions/7375456/append-html-to-webview-content
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38713649
score: 1
has text: Check out the [documentation, under events](https://developers.google.com/youtube/js_api_reference) for what you'd need to get your event listener to fire on if you go down the youtube js api route.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24916463

http://stackoverflow.com/comment/38996908
type: Comment
has text: I think this is actually an improvement. Now it says, "We were unable to load Disqus. If you are a moderator please see our troubleshooting guide." The troubleshooting guide it links me to is here: https://help.disqus.com/customer/portal/articles/472007-i-m-receiving-the-message-%22we-were-unable-to-load-disqus-%22
comment on: http://stackoverflow.com/a/25066985
type: AnswerComment
score: 0

http://stackoverflow.com/q/24945895
upvote count: 1
type: Question
tagged with: angularjs-directive
has body: Summary : When attempting to modify a scope variable (an array) that has been set for two way data binding within an isolate scoped directive, the modifications to the variable within the isolated scope directive do not reflect the changes within the controller's scope. Toy Example : Currently I have a sorting directive that I want to define on a table that is using ng-repeat. ng-repeat is using the same data in the ATableController controller scope to create the table: $scope.tableData = [{'col1' : 1,'col2' : 'fff'}, {'col1' : 2,'col2' : 'aaa'}, {'col1' : 3,'col2' : 'bbb'}, {'col1' : 4,'col2' : 'ccc'}]; I want the sorting directive to manipulate the same data from within its isolated scope. Set up in the directive as the following ... scope : { tableSortData : '=', tableSortRowAccessor : '=', tableSortPrimer : '=' }, ... Referred to in index as the following ... ... Within the link function a click handler is assigned to the table header. On click this handler fires off the sort function which eventually runs this line of code. scope.tableSortData = []; //which would be a sorting line in the real code These changes are NOT made from within the controller and thus the table doesn't change as expected. Is this a vanilla js problem, (wrong references are being made, etc...) or is it something with my angular directive. Either way, what am I doing wrong and how can this be fixed? The Code : plunkr http://plnkr.co/edit/5yxRj6?p=info index.html Column1 Column2 {{row.col1}} {{row.col2}} script.js var myApp = angular.module('myApp', []) .controller('ATableController', function($scope) { $scope.tableData = [{'col1' : 1,'col2' : 'fff'}, {'col1' : 2,'col2' : 'aaa'}, {'col1' : 3,'col2' : 'bbb'}, {'col1' : 4,'col2' : 'ccc'}]; }) .directive('tableSort', [function() { return { restrict : 'A', replace : false, scope : { tableSortData : '=', tableSortRowAccessor : '=', tableSortPrimer : '=' }, link : function(scope, element) { console.log(scope.tableSortData); // Await click events…
has title: Isolated scope directive with two way binding doesn't reflect changes in controller's scope
tagged with: javascript
has answer: http://stackoverflow.com/a/24945956
answer count: 1
downvote count: 0
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24945956
type: AnsweredQuestion
score: 1

http://stackoverflow.com/comment/38995759
comment on: http://stackoverflow.com/q/25066342
type: QuestionComment
type: Comment
has text: I also don't discourage downvotes, but would appreciate reasoning
score: 0

django
tags question: http://stackoverflow.com/q/24931135
tags question: http://stackoverflow.com/q/25050579
type: Tag
tags question: http://stackoverflow.com/q/24951335
tags question: http://stackoverflow.com/q/25021360
tags question: http://stackoverflow.com/q/24923134
tags question: http://stackoverflow.com/q/25000584
tags question: http://stackoverflow.com/q/25006572
tag name: django
tags question: http://stackoverflow.com/q/25030496
tags question: http://stackoverflow.com/q/24975978
tags question: http://stackoverflow.com/q/25064876
tags question: http://stackoverflow.com/q/25038202
tags question: http://stackoverflow.com/q/24944148
tags question: http://stackoverflow.com/q/25036054
tags question: http://stackoverflow.com/q/25024248
tags question: http://stackoverflow.com/q/24942347
tags question: http://stackoverflow.com/q/24987791
tags question: http://stackoverflow.com/q/25056028
tags question: http://stackoverflow.com/q/24971729
tags question: http://stackoverflow.com/q/24986962
tags question: http://stackoverflow.com/q/24914783
tags question: http://stackoverflow.com/q/25039263
tags question: http://stackoverflow.com/q/25063643
tags question: http://stackoverflow.com/q/25065194
tags question: http://stackoverflow.com/q/24990497

http://stackoverflow.com/comment/38998996
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25068004
has text: Right, I understand, but I would need to post so much code it wouldn't be efficient. Thanks for the heads up.
score: 0

http://stackoverflow.com/q/25007928
has answer: http://stackoverflow.com/a/25008116
type: Question
tagged with: arrays
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has title: Using jQuery slideToggle to toggle created arrays
type: UnansweredQuestion
has body: I am using forms to create events, with title, date, time, location and a description. When you press the button, it creates an underscored list of the events that i made by array. (I know that the validEvent() code is out of use, I plan on changing this to jQuery if you can help with that it would help me out a lot!) But my current problem is I wish to make use of jQuery to make the event arrays I make, become slideToggle for each event created to make it look a lot better. If anyone could help me I would highly appreciate it!. My Event Page Date Time

http://stackoverflow.com/comment/38815911
score: 0
comment on: http://stackoverflow.com/q/24971127
has text: you might want to resolve all the syntax errors first. maybe the problem will solve itself then. hint: turn on error reporting.
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25017960
favorite count: 0
has answer: http://stackoverflow.com/a/25018030
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/40470841
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
has title: Why doesn't Bootstrap datepicker work here?
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: datepicker
has body: I am trying to use datepicker from http://www.eyecon.ro/bootstrap-datepicker/?utm_source=twitterfeed&amp;utm_medium=twitter. Question updated to include complete code: &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt; &lt;meta name="description" content=""&gt; &lt;meta name="author" content=""&gt; &lt;title&gt;Calendar&lt;/title&gt; &lt;!-- Bootstrap core CSS --&gt; &lt;link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"&gt; &lt;!-- Custom styles for this template --&gt; &lt;link rel="stylesheet" href="navbar.css"&gt; &lt;link rel="stylesheet" href="js/datepicker/css/datepicker.css"&gt; &lt;script src="js/datepicker/js/bootstrap-datepicker.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="js/fullcalendar-2.0.2/fullcalendar.css"&gt; &lt;link rel="stylesheet" href="js/fullcalendar-2.0.2/fullcalendar.print.css"&gt; &lt;script src="js/fullcalendar-2.0.2/lib/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="js/fullcalendar-2.0.2/lib/moment.min.js"&gt;&lt;/script&gt; &lt;script src="js/fullcalendar-2.0.2/fullcalendar.min.js"&gt;&lt;/script&gt; &lt;!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries --&gt; &lt;!--[if lt IE 9]&gt; &lt;script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"&gt;&lt;/script&gt; &lt;script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"&gt;&lt;/script&gt; &lt;![endif]--&gt; &lt;script type='text/javascript'&gt; $(document).ready(function() { // page is now ready, initialize the calendar... $('#calendar').fullCalendar({ // put your options and callbacks here }) }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="container"&gt; &lt;!-- Static navbar --&gt; &lt;div class="navbar navbar-default" role="navigation"&gt; &lt;div class="container-fluid"&gt; &lt;div class="navbar-he…
linked to: http://stackoverflow.com/q/24093115

http://stackoverflow.com/q/25021383
has body: The following code does not work on all input elements: $(':input').on('input', function(){ alert('boom shakalaka'); }); It has no effect on check-boxes even though they are input elements, and checking or unchecking changes its state. I can add the change event too inside on() but then the same event will be fired twice on other input fields. Is there any reliable input state-change event that is consistent for all form elements?
tagged with: input
score: 10
has comment: http://stackoverflow.com/comment/38910759
upvote count: 11
has comment: http://stackoverflow.com/comment/38910974
answer count: 3
has comment: http://stackoverflow.com/comment/38911109
has comment: http://stackoverflow.com/comment/38911090
has answer: http://stackoverflow.com/a/25021607
has comment: http://stackoverflow.com/comment/38910927
downvote count: 1
has answer: http://stackoverflow.com/a/25021541
tagged with: javascript
type: UnansweredQuestion
tagged with: forms
has title: oninput does not fire on checkboxes?
tagged with: jquery-events
has comment: http://stackoverflow.com/comment/38910806
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38911258
type: Question
has answer: http://stackoverflow.com/a/54448839

http://stackoverflow.com/q/25041929
tagged with: security
has comment: http://stackoverflow.com/comment/38951127
score: 20
has body: I'm doing authentication and authorization in the server side. In angularJs I'm doing the routing using the routeProvider like this. $routeProvider. when('/', { templateUrl: 'partials/_home', controller: 'HomeCtrl' }). when('/home', { templateUrl: 'partials/_home', controller: 'HomeCtrl' }). when('/users', { templateUrl: 'partials/_users', controller: 'UserCtrl' }). when('/users/:id', { templateUrl: 'partials/_userForm', controller: 'UserCtrl' }). otherwise({ redirectTo: '/' }); And here is the problem to solve, when I get a 403 angular is not showing the server page, it just does not do nothing. Did some one has a suggestion of how to handle this?
has comment: http://stackoverflow.com/comment/38951283
has comment: http://stackoverflow.com/comment/38951259
accepted answer: http://stackoverflow.com/a/25043231
type: AnsweredQuestion
tagged with: javascript
tagged with: http-status-code-403
type: Question
has comment: http://stackoverflow.com/comment/38951203
tagged with: angularjs-routing
upvote count: 20
answer count: 1
downvote count: 0
has title: AngularJs routeProvider http status 403
favorite count: 0
has answer: http://stackoverflow.com/a/25043231
has comment: http://stackoverflow.com/comment/60171362

http://stackoverflow.com/comment/117782087
comment on: http://stackoverflow.com/a/49420913
type: Comment
score: 0
type: AnswerComment
has text: I have copy-pasted and tried `let b = _.findIndex(a, function(el) { return el[0] == 'cow'; });` and got **ReferenceError: _ is not defined**

http://stackoverflow.com/comment/38852168
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24990284
has text: Does that delete all local storages? Is there a way to only delete a specific one?

http://stackoverflow.com/comment/38789278
type: QuestionComment
has text: View source on the page. It is probably a little more complicated than it needs to be.
comment on: http://stackoverflow.com/q/24943576
score: 0
type: Comment

http://stackoverflow.com/q/24995121
type: AnsweredQuestion
upvote count: 0
has comment: http://stackoverflow.com/comment/38861060
has answer: http://stackoverflow.com/a/24995162
downvote count: 1
has comment: http://stackoverflow.com/comment/38860839
type: Question
possible better answer: http://stackoverflow.com/a/24995164
tagged with: javascript
score: -1
has answer: http://stackoverflow.com/a/24995183
has comment: http://stackoverflow.com/comment/38860856
has comment: http://stackoverflow.com/comment/38860902
answer count: 3
tagged with: jquery
favorite count: 0
has title: getAttribute method with jquery object
has comment: http://stackoverflow.com/comment/38860879
has answer: http://stackoverflow.com/a/24995164
accepted answer: http://stackoverflow.com/a/24995162
has body: I am using filter to return a particular element. I want to know why .getAttribute is not working with returned object while it is working fine with .attr(). jsfiddle var c = $('ul li').filter(function(){ if($(this).text()=='d') return this; }); console.log(c.getAttribute('value'));

http://stackoverflow.com/q/25059586
score: 2
has comment: http://stackoverflow.com/comment/38982889
upvote count: 2
type: UnansweredQuestion
has body: Is there a way to check if Google Chrome is installed (and default browser) via web page / JavaScript without installing anything to client PC? Edit: Or is there something fancy using Flash?
tagged with: google-chrome
has answer: http://stackoverflow.com/a/25060068
has title: Is there a way to check if Google Chrome is installed (and default browser) via web page / JavaScript without installing anything to client?
type: Question
tagged with: browser
answer count: 2
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25059824
tagged with: windows
favorite count: 0

http://stackoverflow.com/comment/38853559
type: Comment
comment on: http://stackoverflow.com/q/24991072
score: 0
has text: Also, I not aware of any `HTMLElement` instance that has a `show()` method. I think you mean to set the open attribute like `element.setAttribute('open', 'open')`
type: QuestionComment

http://stackoverflow.com/a/25053808
score: -6
type: Answer
downvote count: 6
has comment: http://stackoverflow.com/comment/40081070
has comment: http://stackoverflow.com/comment/41768588
answers question: http://stackoverflow.com/q/24928672
has body: The URL configuration for the qunit html file in the Grunt task was not correct!
upvote count: 0
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/41768630
accepted answer of: http://stackoverflow.com/q/24928672

http://stackoverflow.com/q/25047262
has comment: http://stackoverflow.com/comment/38959721
has comment: http://stackoverflow.com/comment/38959835
tagged with: javascript
has comment: http://stackoverflow.com/comment/38960323
has title: JavaScript: what is the meaning of "!!"?
has answer: http://stackoverflow.com/a/25047335
score: 0
linked to: http://stackoverflow.com/q/4686583
answer count: 4
favorite count: 0
duplicate of: http://stackoverflow.com/q/4686583
possible better answer: http://stackoverflow.com/a/25047310
has comment: http://stackoverflow.com/comment/38959773
has answer: http://stackoverflow.com/a/25047310
linked to: http://stackoverflow.com/q/784929
upvote count: 1
has answer: http://stackoverflow.com/a/25047276
has comment: http://stackoverflow.com/comment/38959796
has body: I just ran into this var strict = !! argStrict; I can't help but wonder, what is the meaning of !!? Is it a double negative? Seems pretty redundant, not likely that the guys from php.js would use that in such case? source: http://phpjs.org/functions/in_array/
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25047331
duplicate of: http://stackoverflow.com/q/784929
has comment: http://stackoverflow.com/comment/38959809
accepted answer: http://stackoverflow.com/a/25047276
has comment: http://stackoverflow.com/comment/38959877
downvote count: 1
has comment: http://stackoverflow.com/comment/38959741
type: Question

http://stackoverflow.com/comment/38956730
comment on: http://stackoverflow.com/q/25045681
has text: It doesn't matter that they are both on the same EC2 instance. They are on different ports, CORS is specifically about the URL being hit and since they are both on different ports they are different urls Try this: http://leopard.in.ua/2012/07/08/using-cors-with-rails/
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24969866
answer count: 0
tagged with: master-pages
tagged with: javascript
tagged with: jquery
type: UnansweredQuestion
tagged with: asp.net
type: Question
has comment: http://stackoverflow.com/comment/38813569
score: 0
has title: Access master page control in content page through javascript
tagged with: c#
has body: I am having a problem in accessing Master Page Label in Content page through javascript Here's the code: MasterPage Code: <asp:Label runat="server" ID="lblsubtotal" CssClass="lblcart"></asp:Label> Loading please wait... CART SUBTOTAL: <asp:Label runat="server" ID="lblsubtot"></asp:Label> Content Page Code (Products.aspx) $.ajax({ url: '/ViewProducts.aspx/AjaxShowCart', type: "POST", contentType: "application/json; charset=utf-8", dataType: "json", // data: '{ "startindex":"' + startIndex + '", "pagesize":"' + pageSize + '"}', success: function (result) { $('#img_loading').hide(); var count11 = 0; $.each(result.d, function () { count11 = count11 + 1; }); if (count11 > 0) { // Here I've been trying to access label named lblsubtot, lblsubtotal and div named CartContent with different methods.. But I am not able to acces them. var lbl = Master.FindControl("ContentPageHolder1").FindControl(lblsubtot); var subtot = document.getElementsByClassName["lblcart"]; var no = document.getElementById('<%=Page.Master.FindControl("lblsubtot").ClientID %>').value; parent.document.getElementById('CartContent').textContent = ""; parent.document.getElementById('CartTemplate').tmpl(result.d).appendTo(parent.document.getElementById('CartContent')); } else { } } }); Tell me if there's any way to access those labels (lblsubtot, lblsubtotal and CartContent) of master page in ContentPage. Thanx In advance
has comment: http://stackoverflow.com/comment/38813711

http://stackoverflow.com/comment/38853383
type: AnswerComment
score: 0
type: Comment
has text: @Mark Won't matter when you're using document ready, it won't actually do anything earlier then it would, included in the bottom of body? morkro is right, bottom of body is better.
comment on: http://stackoverflow.com/a/24990780

http://stackoverflow.com/q/24954516
has body: I have created one sample app from create pdf file from html string using phonegap android.I have write the code for Creating PDF file in java.Code, public class PdfGenerator { private WebView mAppView; private DroidGap mGap; public PdfGenerator(DroidGap gap, WebView view) { mAppView = view; mGap = gap; } public void generatePDF() { File root = Environment.getExternalStorageDirectory(); File gpxfile = new File(root, "test.pdf"); System.out.println("Path ::::"+gpxfile); try{ Document document = new Document(PageSize.LETTER); PdfWriter.getInstance(document, new FileOutputStream(gpxfile)); document.open(); document.addAuthor("Real Gagnon"); document.addCreator("Real's HowTo"); document.addSubject("Thanks for your support"); document.addCreationDate(); document.addTitle("Please read this"); HTMLWorker htmlWorker = new HTMLWorker(document); String str = " "+ "Real's HowTo" + " Show your support " + " It DOES cost a lot to produce this site - in ISP storage and transfer fees, " + "in personal hardware and software costs to set up test environments, and above all," + "the huge amounts of time it takes for one person to design and write the actual content." + " If you feel that effort has been useful to you, perhaps you will consider giving something back?" + " Donate using PayPal® to real@rgagnon.com." + " Contributions via PayPal are accepted in any amount " + " Java HowTo " + " Javascript HowTo Powerbuilder HowTo " + " "; htmlWorker.parse(new StringReader(str)); document.close(); System.out.println("Done"); } catch (Exception e) { e.printStackTrace(); } } } my mian class code is, public class MainActivity extends DroidGap { PdfGenerator pdf; public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); pdf = new PdfGenerator(this, appView); appView.addJavascriptInterface(pdf, "PdfGenerator"); super.loadUrl("file:///android_asset/www/test.html"); } } Javascript code, whan i call generatePDF from javascript i got the following error, U…
type: UnansweredQuestion
tagged with: android
has answer: http://stackoverflow.com/a/24961548
tagged with: java
type: Question
has title: Unable to call java methods from phonegap android?
tagged with: javascript
has comment: http://stackoverflow.com/comment/38786727
score: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38786325
has comment: http://stackoverflow.com/comment/38785837
tagged with: cordova

http://stackoverflow.com/comment/38894490
type: Comment
has text: Hi Barmar, hope you read this. Using your method I tried adding a new person into the Array of PRIVILEGE_PROFILES who also had the company code XC, however it only loads JWilliams. JSFiddle of what I mean, can you help me out? ^^ http://jsfiddle.net/j7w8r/5/
comment on: http://stackoverflow.com/a/25011854
score: 0
type: AnswerComment

http://stackoverflow.com/tag/csv
type: Tag
tags question: http://stackoverflow.com/q/25065774
tag name: csv
tags question: http://stackoverflow.com/q/25008009
tags question: http://stackoverflow.com/q/24915609
tags question: http://stackoverflow.com/q/25047438
tags question: http://stackoverflow.com/q/25009295
tags question: http://stackoverflow.com/q/24919143
tags question: http://stackoverflow.com/q/25020601
tags question: http://stackoverflow.com/q/24964746
tags question: http://stackoverflow.com/q/24924073
tags question: http://stackoverflow.com/q/25043967
tags question: http://stackoverflow.com/q/24951042
tags question: http://stackoverflow.com/q/25026245
tags question: http://stackoverflow.com/q/25025311
tags question: http://stackoverflow.com/q/24938042

http://stackoverflow.com/comment/38835763
type: QuestionComment
comment on: http://stackoverflow.com/q/24981534
score: 0
type: Comment
has text: without js can not do? With js I have already done that, just wondering if it was possible without js.

http://stackoverflow.com/a/24937497
score: 1
has body: Perhaps I don't fully understand your question, but you can use JavaScript/HTML to open a link in a new window with the following code: Click here That new document could house the view for your images (alternatively, you could just change the first argument of open() to the image itself), and from that new window your "textfield" to change is the url.
has comment: http://stackoverflow.com/comment/38752814
upvote count: 1
answers question: http://stackoverflow.com/q/24937082
type: Answer
downvote count: 0

http://stackoverflow.com/q/25034267
accepted answer: http://stackoverflow.com/a/25034536
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25034656
has answer: http://stackoverflow.com/a/25034656
has title: JS code to change table caption to display when overflow scroll bar appears
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25034536
score: 0
has body: I'm new to this site so forgive me if I've posted incorrectly! I'm trying to write JS so that the table caption property in a table appears when the overflow of a table causes a scroll bar to appear, (most likely on a mobile device or due window re-sizing). How would I go about doing this? My current code for the table is: .datatable table{ max-width: 100%; display: block; position: relative; width: 100%; overflow-x:auto; } I want to be able to set: .datatable table caption{ display:none; } To something else once the overflow scroll bar appears using JS. Any help would be much appreciated.
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/q/25059601
accepted answer: http://stackoverflow.com/a/25059902
type: Question
tagged with: javascript
tagged with: google-chrome-extension
answer count: 1
has answer: http://stackoverflow.com/a/25059902
score: 0
tagged with: google-chrome
type: AnsweredQuestion
has body: I am using chrome.webRequest.onBeforeRequest in my background script to listen to all request a user is making. My extension now is just a manifest and this bg script. I then check if the url matches a regex: chrome.webRequest.onBeforeRequest.addListener( checkRedirect, {urls: ["&lt;all_urls&gt;"]}, ["blocking"] ); function checkRedirect(details) { var location = getLocation(details.url); if(/some_regex/.test(details.url)) { var redirect_url = 'http://some_redirect.com' + location.pathname; chrome.tabs.update({url: redirect_url}); } return {cancel: false}; } function getLocation(href) { var l = document.createElement('a'); l.href = href; return l; }; So if a user enters a page or clicks on a link to that page, I'd like to redirect him. The code above works almost fine; the problem is when the page requests e.g. CSS then those CSS end up on the user screen. So what I'd want is to only filter requests to pages / clicks.. how to do this?
has title: How to redirect some pages in Google chrome extension?

http://stackoverflow.com/comment/38865782
has text: If I moved the onclick functions to within a `script` tag as opposed to inline, how would I call the Perl variables? would `var a = <%= $STATE_NEW %>` work?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24964810
type: AnswerComment

http://stackoverflow.com/a/25045765
type: Answer
answers question: http://stackoverflow.com/q/25045402
has body: In jQuery you can do it with the 'autocomplete' function. Here is the link: http://jqueryui.com/autocomplete/ I show you my example: Town: And the 'search_town.php': <?php if ( !isset( $_REQUEST['term'] ) ) { exit; } require("dbconnect.php"); $data = array(); $term = mysqli_real_escape_string( $conn, $_REQUEST['term'] ); $sql = "SELECT name, postcode FROM town WHERE lower(name) LIKE lower('$term%') ORDER BY name"; $result = mysqli_query( $conn, $sql ) or trigger_error( mysqli_error( $conn ) ); while ( $row = mysqli_fetch_object( $result ) ) { $data[] = array( 'label' => $row->name.' ('.$row->postcode.')', 'value' => $row->name ); } mysqli_free_result( $result ); echo json_encode( $data ); flush(); ?>
score: 0

http://stackoverflow.com/comment/38928714
score: 1
comment on: http://stackoverflow.com/q/25030993
type: Comment
has text: See http://api.jquery.com/on/
type: QuestionComment

http://stackoverflow.com/comment/38827309
type: Comment
comment on: http://stackoverflow.com/a/24977113
score: 1
has text: This looks like a plausible answer but it could be improved with an explanation of why that is necessary e.g. what "tracking" is all about and what ng-repeat does by default that's messing things up.
type: AnswerComment

http://stackoverflow.com/a/24977647
score: 2
has body: Use the CSS property white-space to accept \n as new lines. div { white-space: pre; } JSFiddle
upvote count: 3
has comment: http://stackoverflow.com/comment/38843035
downvote count: 1
has comment: http://stackoverflow.com/comment/38828291
accepted answer of: http://stackoverflow.com/q/24977624
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38828217
answers question: http://stackoverflow.com/q/24977624
has comment: http://stackoverflow.com/comment/38828229
type: Answer

http://stackoverflow.com/a/24913226
has comment: http://stackoverflow.com/comment/38706928
answers question: http://stackoverflow.com/q/24913179
type: Answer
upvote count: 1
score: 1
downvote count: 0
has body: This will work here. obj.size //returns small OR obj["size"] //returns small OR var my_var = "size" obj[my_var] //returns small

http://stackoverflow.com/a/25012591
has body: Your link variable comes out as 'Email', so it looks like you're missing a closing quotation mark. Try var link = ('<' + 'a' + ' ' + 'h' + 'r' + 'e' + 'f' + '=' + '"' + 'm' + 'a' + 'i' + 'l' + 't' + 'o' + ':' + 'c' + 'j' + 's' + 'h' + '@' + 'c' + 'j' + 's' + 'h' + '.' + 'n' + 'a' + 'm' + 'e' + '?' + 's' + 'u' + 'b' + 'j' + 'e' + 'c' + 't' + '=' + 'T' + 'o' + '+' + 't' + 'h' + 'e' + 'A' + 'u' + 't' + 'h' + 'o' + 'r' + '">' + 'E' + 'm' + 'a' + 'i' + 'l' + '<' + '/' + 'a' + '>');
has comment: http://stackoverflow.com/comment/38894148
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/25012531
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25012531

http://stackoverflow.com/q/25066538
upvote count: 1
has answer: http://stackoverflow.com/a/25066599
type: Question
type: AnsweredQuestion
downvote count: 3
accepted answer: http://stackoverflow.com/a/25066607
possible better answer: http://stackoverflow.com/a/25066596
has answer: http://stackoverflow.com/a/25066596
has comment: http://stackoverflow.com/comment/38995881
tagged with: javascript
favorite count: 0
has body: How do I output the current year and month (in numbers) in javascript? getUTCMonth() logs: getUTCMonth is not defined getUTCMonth() logs: getMonth is not defined
answer count: 3
has title: Current month (number) + year (number)
score: -2
has answer: http://stackoverflow.com/a/25066607

http://stackoverflow.com/a/24948778
answers question: http://stackoverflow.com/q/24948734
type: Answer
upvote count: 1
has body: .size also work for this $("ul &gt; li").size() //deprecated but it is deprecated after jQuery 1.8. so go for it $("ul &gt; li").length //prefered
score: 1
downvote count: 0

http://stackoverflow.com/q/25023118
tagged with: socket.io-1.0
tagged with: socket.io
answer count: 1
accepted answer: http://stackoverflow.com/a/25024104
score: 8
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38914611
upvote count: 8
type: Question
has comment: http://stackoverflow.com/comment/38914405
has body: I have been reading many blogs about Socket.IO these days and impressed by features of it. I am planning to use it one of chat applications and for normal number of users with minimal number of users it is working perfectly. But are there any pitfalls in Socket.IO when used in production networks? Is Socket.IO best fit for large scale messaging system where messaging flow will be very huge. If yes, what is the best technology stack to be used along Socket.IO to make it work "100% reliable even when load is more". Anyone have already have an experience with Socket.IO in implementing large scale messaging system. Stack I want to use is Socket.IO, Redis, Cassandra and MySQL. As of now I have gone through many examples of Socket.IO and many people were trying to do in different ways. Some people used Array to store Socket ids while some using Redis. I understand that using Redis will help definitely. But I do not want to stop there. I would like to learn best architecture for Socket.IO application. Please suggest me a path to it. Edit For me best stack is nothing but, something for which rate of failure is less compared to others.
has answer: http://stackoverflow.com/a/25024104
tagged with: node.js
has title: Is Socket.IO a reliable Chat server for large number of users, if yes what's your stack?
has comment: http://stackoverflow.com/comment/38914432

http://stackoverflow.com/q/25052667
favorite count: 0
answer count: 5
has comment: http://stackoverflow.com/comment/38969606
has answer: http://stackoverflow.com/a/25052704
tagged with: php
has answer: http://stackoverflow.com/a/25052711
type: AnsweredQuestion
has body: I have a form in my web page and I want to submit form data automatically when user open this on his web browser. This form contain fixed data from my side and use didnt have to add any data. So here is my form code... &lt;form action="data.php" method="post" enctype="plain" id="theForm"&gt; &lt;input type="text" name="Visitor" value="FIXED-DATA-FROm-ME" /&gt; &lt;input type="submit" value="Send" /&gt; &lt;/form&gt; How to do this? Please share some simple steps or light coding...
upvote count: 1
tagged with: forms
possible better answer: http://stackoverflow.com/a/25052711
downvote count: 1
has answer: http://stackoverflow.com/a/25052791
has answer: http://stackoverflow.com/a/25052712
type: Question
has comment: http://stackoverflow.com/comment/38969712
has comment: http://stackoverflow.com/comment/38969650
accepted answer: http://stackoverflow.com/a/25052704
has answer: http://stackoverflow.com/a/25052855
has comment: http://stackoverflow.com/comment/38969624
tagged with: javascript
tagged with: jquery
score: 0
linked to: http://stackoverflow.com/q/1200266
tagged with: http://stackoverflow.com/tag/html
has title: How To Submit A Form On WebPage Load Automatically?

http://stackoverflow.com/a/24935950
accepted answer of: http://stackoverflow.com/q/24934655
score: 0
answers question: http://stackoverflow.com/q/24934655
type: Answer
has comment: http://stackoverflow.com/comment/38750459
has body: Looks like you're missing a linebreak before the first row of your data. Here's a fixed example. Value,FacTy,Latitude,Longitude 1,112,42.27426,-83.365717 2,113,42.274082,-83.3623 3,30,42.337196,-83.487672 should be Value,FacTy,Latitude,Longitude 1,112,42.27426,-83.365717 2,113,42.274082,-83.3623 3,30,42.337196,-83.487672
type: AcceptedAnswer

http://stackoverflow.com/q/24947060
has comment: http://stackoverflow.com/comment/38771221
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/24947066
has title: Customization of css attributes
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24947146
tagged with: css
type: AnsweredQuestion
has body: I'm trying to customize the color attribute of this element this way: TEST js code (included in the top of the html page) (function(){ document.getElementsByClassName('main-title').color = 'black'; })(); Doing this wouldn't change the color. Including it at the bottom of the page involves the same issue. Also, I've tried to include a css file which contains(.main-title{color:black;}) instead of that js file, but it still the same. How to fix this, please? Any brilliant idea ?
possible better answer: http://stackoverflow.com/a/24947146
has answer: http://stackoverflow.com/a/24947066
type: Question
tagged with: javascript

http://stackoverflow.com/q/24924683
answer count: 3
tagged with: http
has answer: http://stackoverflow.com/a/24938535
has title: Parse Cloud Code httprequest error
has answer: http://stackoverflow.com/a/24928038
tagged with: javascript
has body: I've been programming in Objective-C for years, but I need to work with Parse Cloud Code and I'm new to Javascript. Here's my code: Parse.Cloud.define("test", function(request, response) { return Parse.Cloud.httpRequest({ url: 'https://api-ilv.trulioo.com/partner/v3/truDetect', params: { 'Content-Type' : 'application/json', 'api_key':'1234567890', 'provider_name':'fb', 'provider_url':'https://www.facebook.com/testing' } }).then(function(httpResponse) { console.log(httpResponse.text); response.success(httpResponse.text); }, function (httpResponse, error) { console.error('Request failed with response: ' + httpResponse.text); response.error('Request failed with response: ' + httpResponse.text) }); }); What could I be doing wrong? EDIT Made some changes to log in the code above. Here's the response: {"code":141,"error":"Request failed with response: 405: Method Not Allowed"} So now, it looks like the method is returning the error correctly. However, what does error code 405 mean?
possible better answer: http://stackoverflow.com/a/24925471
type: AnsweredQuestion
score: 2
has answer: http://stackoverflow.com/a/24925471
downvote count: 0
accepted answer: http://stackoverflow.com/a/24938535
favorite count: 0
tagged with: parse-platform
type: Question
has comment: http://stackoverflow.com/comment/38765120
upvote count: 2

http://stackoverflow.com/q/24962042
has comment: http://stackoverflow.com/comment/38805923
has comment: http://stackoverflow.com/comment/38800316
accepted answer: http://stackoverflow.com/a/24962259
possible better answer: http://stackoverflow.com/a/42439260
has body: I am trying to set up password confirmation in sails 0.10.0-rc9. this is for a new user sign-up. when i use the same password in both fields, console confirms it's grabbing the same passwords, then spits out the error that they don't match. I want to know what I'm missing... the model - user.js - looks like https://github.com/mrcn/C_Express/blob/master/api/models/User.error.js module.exports = { schema: true, attributes: { name: { type: "string", required: true }, email: { type: "string", email: true, required: true, unique: true }, encryptedPassword: { type: "string" }, toJSON: function() { var obj = this.toObject(); delete obj.password; delete obj.confirmation; delete obj.encryptedPassword; delete obj._csrf; return obj; } }, beforeCreate: function (values, next) { console.log("Called beforeCreate User "); console.log(values); if(!values.password || values.password != values.confirmation) { console.log("\n if statement call \n"); return next({ err : ["password dont match."] }); } } }; the form looks like this: https://github.com/mrcn/C_Express/blob/master/views/user/new.ejs &lt;input type="text" class="form-control" placeholder="your name" name="name" required /&gt; &lt;input type="email" class="form-control" placeholder="email address" name="email" data-parsley-trigger="change" required /&gt; &lt;input type="password" class="form-control" placeholder="password" name="password" required /&gt; &lt;input type="password" class="form-control" placeholder="confirmation" name="confirmation" required /&gt; &lt;br /&gt; &lt;input type="submit" class="btn btn-lg btn-primary btn-block" value="Create Account" /&gt; &lt;input type="hidden" name="_csrf" value="&lt;% _csrf %&gt;" /&gt; when i use random "wer" for everything, Console logs" Called beforeCreate User { name: 'wer', email: 'wer@wer.com', password: 'wer', confirmation: 'wer', _csrf: '', id: null } if statement call { err: [ 'password dont match.' ] }
tagged with: node.js
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38800075
upvote count: 1
downvote count: 1
has title: password confirmation with sails.js
type: Question
tagged with: sails.js
has answer: http://stackoverflow.com/a/24962259
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38799668
has comment: http://stackoverflow.com/comment/38799775
favorite count: 0
has answer: http://stackoverflow.com/a/42439260

http://stackoverflow.com/q/24970931
type: AnsweredQuestion
tagged with: java
linked to: http://stackoverflow.com/q/7544671
type: Question
upvote count: 2
has answer: http://stackoverflow.com/a/25087030
accepted answer: http://stackoverflow.com/a/25087030
tagged with: rrule
has body: I want to generate a human readable text (natural language) from a RRULE string (RFC2445). I have googled for it, what I have found is only a JavaScript library (rrule.js) which can generate such a text. But I need this functionality in Android (Java). Is there a library wrriten in Java like this ? If not, I heared about a couple of JavaScript engines in Java (Rhino for example) But I'm very worry about my Android app performace because It seems this engines is a bit heavy weight.
tagged with: javascript
possible better answer: http://stackoverflow.com/a/45425426
has answer: http://stackoverflow.com/a/45425426
has answer: http://stackoverflow.com/a/63428636
answer count: 3
has title: RRULE to human readable text
tagged with: android
favorite count: 0
score: 2
downvote count: 0

http://stackoverflow.com/comment/38972912
type: AnswerComment
has text: ... fixes Chrome, yes, but breaks Internet Explorer (at least 11, that's all I can test)
type: Comment
comment on: http://stackoverflow.com/a/24912457
score: 0

http://stackoverflow.com/comment/38765835
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24940678
type: AnswerComment
has text: @Kevkong True; if the bare HTMLElement is desired the last `.eq(0)` in the chain should become a `.get(0)`. It's unclear OP's original intent in that area, since they were focusing on traversal.

http://stackoverflow.com/comment/38866676
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24996943
score: 0
has text: @Michael well actually your `index` idea suggested me a way to prevent the bad things happening due to the function being executed more than once, I am setting a boolean value to `false` in `done()` and changing it's value to true in the `delay()` function, whose body is now wrapped in an `if` statement checking the value of that boolean. However, this is not preventing the function from being executed twice, it's just an ugly patch :(

http://stackoverflow.com/a/24953608
answers question: http://stackoverflow.com/q/24953345
has comment: http://stackoverflow.com/comment/38783688
has comment: http://stackoverflow.com/comment/38784181
has body: Sure: var jsonObj = {"fold1": { "name": "Too book for ", "items": {} }}; // or do JSON.parse on your original json var items = {"fold1-key1":{"name":"Van Antwerpen"},"fold2-key2":{"name":"Delporte"},"fold3-key3":{"name":"Lallemand"}}; jsonObj.fold1.items = items; var result = JSON.stringify(jsonObj); will return: {"fold1": {"name":"Too book for ", "items": {"fold1-key1":{"name":"Van Antwerpen"}, "fold2-key2":{"name":"Delporte"}, "fold3-key3":{"name":"Lallemand"} } } }
score: 0
has comment: http://stackoverflow.com/comment/38783482
has comment: http://stackoverflow.com/comment/38784636
type: Answer
has comment: http://stackoverflow.com/comment/38783105

http://stackoverflow.com/q/25057165
has body: I'm using the JavaScript Google visualization API to query tables of a spreadsheet. This works fine if I don't specify a specific query (or use 'select *'), but on using Query.setQuery('select ...') the requestId seems to get lost: Uncaught Error: Missing query for request id: undefined Code: // Load the Visualization API and the piechart package. google.load('visualization', '1.0', {'packages':['corechart']}); // Set a callback to run when the Google Visualization API is loaded. google.setOnLoadCallback(queryTable); function queryTable() { var query = new google.visualization.Query( 'https://docs.google.com/spreadsheets/d/129uqCEZksVwOSlqTYF7HVrnbOqD3HqPq-warEMvdur8/edit#gid=0'); query.setQuery('select Date, Time, Name, Type, Preference'); // remove this line and it works query.send(handleQueryResponse); } function handleQueryResponse(response) { if (response.isError()) { alert('Error in query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); var numrows = data.getNumberOfRows(); var tableHtml = '&lt;table width="320"&gt;'; for (var row=0; row &lt; numrows; row++) { var date = data.getValue(row, 0); var time = data.getValue(row, 1); var name = data.getValue(row, 2); var type = data.getValue(row, 3); var pref = data.getValue(row, 4); tableHtml += '&lt;tr&gt;&lt;td&gt;' + name + '&lt;/td&gt;&lt;td&gt;' + type + '&lt;/td&gt;&lt;td&gt;' + pref + '&lt;/td&gt;'; } tableHtml += '&lt;/table&gt;'; $('#table').append(tableHtml); } The test spreadsheet is viewable here: https://docs.google.com/spreadsheets/d/129uqCEZksVwOSlqTYF7HVrnbOqD3HqPq-warEMvdur8/edit?usp=sharing Sorry if this is a Noob question but can't seem to find a solution. Thanks
type: Question
tagged with: google-sheets
tagged with: google-visualization
tagged with: javascript
score: 0
has title: Javascript Query.setQuery() to Google sheets using the Google visualization API gives 'Missing query for request id: undefined"
answer count: 1
has answer: http://stackoverflow.com/a/25059545
accepted answer: http://stackoverflow.com/a/25059545
type: AnsweredQuestion

http://stackoverflow.com/comment/38719684
score: 0
has text: Returns null when it runs. I also tried it onload, which it never runs.
comment on: http://stackoverflow.com/a/24918521
type: Comment
type: AnswerComment

http://stackoverflow.com/comment/38873380
comment on: http://stackoverflow.com/a/24999503
type: Comment
score: 0
type: AnswerComment
has text: Hello @rlatief,I have another question for you, can you let me know how to generate event when the dynamically generated radio button is selected. I have tried $(".click").click(function(){});

http://stackoverflow.com/q/24916604
possible better answer: http://stackoverflow.com/a/24916652
has comment: http://stackoverflow.com/comment/38713699
type: AnsweredQuestion
has body: New to JavaScript and CSS and I am trying to give the user a button that will change the background color of a game board (set up with div) randomly when pressed. &lt;style type="text/css"&gt; div.conway { overflow: hidden; font-family: courier; float: left; width: 800px; height: 488px; background-color: green; font-size: 10px; color: gold; } &lt;/style&gt; and inside my script tag I have the following: function getRandomColor() { var letters = '0123456789ABCDEF'.split(''); var color = '#'; for (var i = 0; i &lt; 6; i++ ) { color += letters[Math.floor(Math.random() * 16)]; } return color; } my.changeBackgroundColor = function () { document.getElementById(conway).style.background-color = getRandomColor(); } But the DOM is not letting me assign the new color. What am I doing wrong?
has answer: http://stackoverflow.com/a/24916652
score: 1
has answer: http://stackoverflow.com/a/24916673
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24916679
tagged with: javascript
has answer: http://stackoverflow.com/a/24916655
has answer: http://stackoverflow.com/a/24916743
downvote count: 0
has title: Trying to change colors, but not sure how to change div element from JavaScript
favorite count: 0
answer count: 5
accepted answer: http://stackoverflow.com/a/24916655
tagged with: css

http://stackoverflow.com/q/25026829
accepted answer: http://stackoverflow.com/a/25027142
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
score: 1
favorite count: 0
has body: I'm trying to implement an effect similar to this Hacker Typer site in AngularJS. I've based some of what I've got so far on the responses in this thread but instead of using a timer I'm just counting up based on ng-keyup. As it is now, each individual ng-keyup reveals a single character. But I'd like it to reveal three at once. This is the approach I tried, but it seems to only reveal every third character. Any suggestions? HTML KeyUps: {{count}} {{typewritten}} JS app.controller('WriterCtrl', ['$scope', function($scope) { var content = 'Mary Ann! Mary Ann! said the voice.'; $scope.count = 0; $scope.typewritten = ''; $scope.ghostWriter = function() { if ($scope.count < content.length) { $scope.typewritten = $scope.typewritten + content[$scope.count]; $scope.count +=2; } }; } ]);
tagged with: angularjs
has answer: http://stackoverflow.com/a/25027142
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24895718
upvote count: 3
downvote count: 2
has title: Hacker Typer Effect (reveal specific text on random key press) in AngularJS
type: Question

http://stackoverflow.com/comment/38943733
has text: Yes, but that code is not meteor or backbone specific. They are just frameworks and you could achieve this in either. Mongodb could work fine for this sort of thing. If the image is not on the server you need to decide whether to do the image manipulation work on the front or backend - both would look similar using JavaScript. On the backend you also have easy access to anything you can find that will help on npmjs.org (Meteor has the concept of a /server/ folder for node.js based server-side code)
score: 0
comment on: http://stackoverflow.com/q/25038885
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38929468
score: 0
comment on: http://stackoverflow.com/q/25031477
has text: You mean you want the user prompted for all the file locations and only after that have the downloads start ?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38818167
type: AnswerComment
type: Comment
has text: Ah. Don't worry about it. You're always welcome. This is what this website is all about.
comment on: http://stackoverflow.com/a/24971102
score: 1

http://stackoverflow.com/a/25031592
type: Answer
score: 0
answers question: http://stackoverflow.com/q/25002797
has body: I experienced the same problem. But I replaced js files with an older version of this plugin (responsive slider 4.1.1). Now it's working fine for me. But I'm not sure this is the correct way to solve this problem.

http://stackoverflow.com/a/24970590
upvote count: 1
has comment: http://stackoverflow.com/comment/38822695
type: AcceptedAnswer
downvote count: 0
has body: It seems like one way is more concise Then use that. in case you add code later. You ain't gonna need it. Not until later, at least.
type: Answer
answers question: http://stackoverflow.com/q/24970141
accepted answer of: http://stackoverflow.com/q/24970141
score: 1

http://stackoverflow.com/q/25044799
tagged with: disabled-input
has answer: http://stackoverflow.com/a/41845160
type: Question
score: 3
tagged with: internet-explorer
has comment: http://stackoverflow.com/comment/39011523
tagged with: javascript
has answer: http://stackoverflow.com/a/25541958
answer count: 2
has comment: http://stackoverflow.com/comment/39026890
downvote count: 0
has body: I have a select multiple element with scrollbars that is disabled. In Chrome and Firefox on Windows it is still scrollable but no selections can be made. However in IE its not scrollable, so not all options can be seen. Is there any way to force IE to behave like Chrome/FF in the same way? This is basically a read-only presentation of the multi-select picklist where they can see which elements where selected. Here's some example code and a fiddle (http://jsfiddle.net/2ET44/2/: value number 1 val 2 val 3 val 4 val 5 value 6 val 7 val 8 val 9 val 10 Thanks!
favorite count: 0
tagged with: html-select
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/4755063
has title: vertical scrolling of disabled mutliple element not working in IE
has comment: http://stackoverflow.com/comment/39023662
upvote count: 3

http://stackoverflow.com/a/25064499
type: Answer
has comment: http://stackoverflow.com/comment/38992523
has body: It's not clear which platform you're using, but I think these suggestions might be mostly platform independent. First of all this doesn't sound like a true application global state attribute, but rather a user or session attribute. If you want your app to remain "pure" stateless, this edit mode data should be part of the models/viewmodels you send to and receive from the front end. Your controllers can then read and react to the mode change and modify the value as appropriate before sending to your front end. And the front end JS can also read and change the value as appropriate. Also though, the standard session should also be available too and can be used but of course that breaks the "statelessness" of your app.
answers question: http://stackoverflow.com/q/25061243
has comment: http://stackoverflow.com/comment/39025412
score: 0

http://stackoverflow.com/q/24997163
score: 0
has answer: http://stackoverflow.com/a/25001775
answer count: 1
accepted answer: http://stackoverflow.com/a/25001775
has comment: http://stackoverflow.com/comment/38872096
favorite count: 0
tagged with: parsing
tagged with: casperjs
has title: How can I return the path of a screenshot capture to a function and return via JSON to javascript?
has comment: http://stackoverflow.com/comment/38868918
has comment: http://stackoverflow.com/comment/38865699
upvote count: 1
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38870958
linked to: http://stackoverflow.com/q/24266164
has comment: http://stackoverflow.com/comment/38865078
tagged with: javascript
tagged with: jquery
has body: I have a PHP script that invokes a casperjs script via exec function and this is working fine. Is it possible to return the path where I saved a screenshot via exec as JSON? My scripts are below: PHP code: // Execute to CasperJS via asynchronous process &lt;?php $username = $_POST['username']; $password = $_POST['password']; $target = $_POST['target']; $filename = $_POST['file']; $retorno = array() try { exec("{$casperjs_run} {$script} {$username} {$password} {$filename} 2&gt;&amp;1", $output); } catch (Exception $e) { $retorno['error404'] = "Desculpe! Não foi possivel acessar a página solicitada."; } // Return Data if success // Retorna para front-end if (empty($output)){ $retorno['success'] = $output; echo json_encode($retorno); return false; } else { $retorno['error'] = $output; echo json_encode($retorno); return false; } ?&gt; CasperJS code: casper.thenOpen(minhaoi, function myaccount() { this.capture('pic2.png'); this.log('Acessando informações da conta, aguarde...'); if (!this.exists(('div.panel-horizontal'))) { this.log(JSON.stringify("Não foi encontrado um plano colaborador, aguarde...")); noDetails = this.captureSelector(filename + '.png', 'div.panel-horizontal', {quality: 100}); } else { casper.waitForResource("Análise de Conta", function orderDetails(details) { return details; }, function onReceive() { this.log('ScreenShot Begin'); myDetails = this.captureSelector(path_images + filename + '.png', '#content', { quality: 100 } ); this.log(' ScreenShot Done'); }); }); } }); // Logout &amp; Exit casper.eachThen(oi_out, function () { this.capture('pic3.png'); if (noDetails != "") { return noDetails; } else { return myDetails; }).run(); Here my JS code that receive the information from casperjs via JSON. Javascript Code: success: function(data) { if (data.success) { $('#retorno').html(data.success); $('#imagem').attr('src', '/details/' + filename); $('#resultado').show(); } }, error: function(data) { // check error $('#retorno').attr("class='alert alert-danger'…

http://stackoverflow.com/a/24950767
upvote count: 2
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24950494
has body: If you want to do the same thing in Dojo, it's also possible: require([ "dojo/query", "dojo/dom-attr", "dojo/domReady!", "dojo/NodeList-dom", "dojo/NodeList-traverse" ], function(query, domAttr) { query("#menuContainer a").on("click", function(evt) { query(".row &gt; div") .style("display", "none") .parents(".row") .query(domAttr.get(evt.target, "href")) .style("display", "block"); }); }); For example: http://jsfiddle.net/YBae9/

http://stackoverflow.com/comment/38820109
comment on: http://stackoverflow.com/q/24973186
type: QuestionComment
has text: see also http://stackoverflow.com/questions/7823801/remove-php-extention-stop-access-of-url-with-php-extention-and-remove-trailing | http://stackoverflow.com/a/7823959/689579
type: Comment
score: 0

http://stackoverflow.com/comment/38988729
has text: Have you tried anything yet?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25062855
score: 4

openlayers-3
type: Tag
tags question: http://stackoverflow.com/q/24977152
tag name: openlayers-3
tags question: http://stackoverflow.com/q/25036432

http://stackoverflow.com/comment/38940865
type: Comment
comment on: http://stackoverflow.com/a/25034233
type: AnswerComment
score: 0
has text: I have seen an example in some forums and tried the same. But this doesnt work for me. Please suggest if the code is incorrect or if there is any other better approach. Thanks

http://stackoverflow.com/comment/38904199
type: Comment
comment on: http://stackoverflow.com/a/25017890
score: 0
type: AnswerComment
has text: @Andy I think you are right. Will delete it, once OP make it clear what he wants.

http://stackoverflow.com/q/25025791
tagged with: javascript
has title: Dynamic routing in ember shows the parent's model instead of its own
upvote count: 1
tagged with: ember.js
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25026449
accepted answer: http://stackoverflow.com/a/25026449
type: AnsweredQuestion
has body: I'm trying to create a simple route from a list of colors to a single color. Unfortunately, once you navigate to colors/:color, ie colors/red, the model is not overridden property to the single model, and still reflects the color list. How can I properly drill down to a single model? Routes: App.ColorsRoute = Ember.Route.extend({ model: function() { return this.store.findAll('color'); } }); App.ColorRoute = Ember.Route.extend({ model: function(params) { console.log(params); return this.store.findBy("color", params.colors_id); } }); Router: App.Router.map(function() { this.resource("colors", function(){ this.resource("color", {path: "/:colors_id"}); }); }); Issue reproduced in jsbin: http://jsbin.com/sipexu/3/edit
score: 1
type: Question
downvote count: 0

http://stackoverflow.com/comment/38886014
comment on: http://stackoverflow.com/a/25006601
type: AnswerComment
type: Comment
score: 0
has text: Please fix that ugly deferred anti pattern. You can simply `return $q.when(objFromCache || $http(...` :)

http://stackoverflow.com/comment/38937605
comment on: http://stackoverflow.com/q/25035738
score: 0
type: QuestionComment
has text: can you post a fiddle link
type: Comment

http://stackoverflow.com/a/25048346
score: 2
downvote count: 0
upvote count: 2
has body: The difference isn't with the click handler, the difference is the order of execution. In the first example you define something (the function) then reference it (in the HTML). In the second example you reference something (the HTML element) and then define it. So in the second example the call to getElementById("btn") doesn't find anything, because at the time it executes that element doesn't exist yet. HTML and JavaScript execute in the order in which they exist on the page as the page is being rendered. From the top of the document to the bottom.
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/25048323
answers question: http://stackoverflow.com/q/25048323

http://stackoverflow.com/comment/38831284
comment on: http://stackoverflow.com/q/24978426
has text: OK finally got it working with `document.onclick` instead of `window.onclick`, latter being not supported in IE 8. Thanks to [quirksmode](http://www.quirksmode.org/dom/events/click.html) for information. Also @Dr.Molle Trust you are right jsfiddle doesnot work in IE8 in general and it has nothing to do with the content. That remark from my side was irrelevant. Thank you all for the help.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38715299
has text: Yes it is, I did that earlier in the controller
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24917380

http://stackoverflow.com/comment/38897815
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25014600
score: 1
has text: Why are you putting `data` and `resource` into arrays?

http://stackoverflow.com/q/25033263
has title: The best way to play videos on website
type: Question
has comment: http://stackoverflow.com/comment/38932862
has comment: http://stackoverflow.com/comment/38933956
has answer: http://stackoverflow.com/a/25034313
accepted answer: http://stackoverflow.com/a/25034313
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
upvote count: 8
has comment: http://stackoverflow.com/comment/38932946
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38934034
has body: According to a Post from w3schools, the best way to play videos on a website is to use HTML5 with fallbacks below: &lt;video width="320" height="240" controls&gt; &lt;source src="movie.mp4" type="video/mp4"&gt; &lt;source src="movie.ogg" type="video/ogg"&gt; &lt;object data="movie.mp4" width="320" height="240"&gt; &lt;embed src="movie.swf" width="320" height="240"&gt; &lt;/object&gt; Please update your browser. Thanks! &lt;/video&gt; I have tried to use the code above, and it works on Chrome. Also with IE9. But when my client sent me a feedback, he says the video is not playing on his IE8 browser. So I checked and used IE8 and it does fail. I could tell him to upgrade his browser but that won't work with all users viewing the website. So I switched to youtube solution, from w3schools' post. Now it's playing on his IE8 (hurray!). But a new problem arise. The video can't be played on his iPad. Possibly he got his youtube app disabled. I also tried using my iPad. Suprisingly, it didn't worked too (shocking!). Problem: What's the very best way to play videos on a website? Maybe not a 100% fail-free solution but would play on most cases. Criteria: Autoplay Cross-browser (including Android's default browser) No to ready-made plug-ins/players Large video file (50MB+)
downvote count: 2
score: 6
linked to: http://stackoverflow.com/q/1055183
has comment: http://stackoverflow.com/comment/38961464
tagged with: php
tagged with: video
type: AnsweredQuestion

http://stackoverflow.com/q/24917752
has title: Value passed from textbox to textarea is automatically deleted
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24917945
has body: I am trying to pass a value entered in a textbox to a text area. However when I run my code the value appears in the textarea and it disapears. Html code: Customer Name Javascript: function transferData() { var customer = document.getElementById("name1TXT").value; if (customer != "") document.getElementById('productList').value += customer + "," document.getElementById('name1TXT').value = ""; } Does anyone know why this would happen? Edit Here is all of my code. Customer Name Coating Galvanized Powder Coat None Weight Length Pieces Pounds Tons Customer Name Coating Galvanized Powder Coat None Weight Length Pieces Pounds Tons Customer Name Coating Galvanized Powder Coat None Weight Length Pieces Pounds Tons Submit Reset Add New Form Pounds Total Tons Total Save Input Javascript: //number correlate with form in order //functions for first form function sum1() { var txtFirstNumberValue = document.getElementById('weight1TXT').value; var txtSecondNumberValue = document.getElementById('length1TXT').value; var txtThirdNumberValue = document.getElementById('pcs1TXT').value; var result = parseInt(txtFirstNumberValue) * parseInt(txtSecondNumberValue) * parseInt(txtThirdNumberValue); if (!isNaN(result)) { document.getElementById('pounds1TXT').value = result; } } function convertPounds1() { var txtFirstNumberValue = document.getElementById('pounds1TXT').value; var result = parseInt(txtFirstNumberValue) / 2000; if (!isNaN(result)) { document.getElementById('tons1TXT').value = result; } } function galvCalc1() { var galvOption = document.getElementById('').value } //functions for second form function sum2() { var txtFirstNumberValue = document.getElementById('weight2TXT').value; var txtSecondNumberValue = document.getElementById('length2TXT').value; var txtThirdNumberValue = document.getElementById('pcs2TXT').value; var result = parseInt(txtFirstNumberValue) * parseInt(txtSecondNumberValue) * parseInt(txtThirdNumberValue); if (!isNaN(result)) { document.getElementById('pounds2TXT'…
tagged with: javascript
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38716036
tagged with: function
possible better answer: http://stackoverflow.com/a/24917834
accepted answer: http://stackoverflow.com/a/24917945
has answer: http://stackoverflow.com/a/24917834
has comment: http://stackoverflow.com/comment/38716077
has comment: http://stackoverflow.com/comment/38716220
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/25046513
score: 14
has comment: http://stackoverflow.com/comment/44722700
has comment: http://stackoverflow.com/comment/38959897
has comment: http://stackoverflow.com/comment/38958587
accepted answer of: http://stackoverflow.com/q/25046386
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25046386
type: Answer
upvote count: 15
has body: According to the docs ngClick can give you the $event object which can tell you if the shift key is pressed. Apple ... $scope.addFruit = function(fruitName,$event) { $scope.fruitObject.name = fruitName; if($event.shiftKey){ //logic } };
downvote count: 1

http://stackoverflow.com/comment/38943398
comment on: http://stackoverflow.com/q/25038769
score: 0
type: QuestionComment
type: Comment
has text: I'm seeing a dramatic difference too. Dunno why, though I suspect the answer is something along the lines of one function happening to trigger the JIT and the other getting interpreted.

http://stackoverflow.com/q/24966003
has body: This is possibly duplicated, however, things are changing fast in JavaScript world with new browsers. I'm using some resources that used in AS3 a long time ago and now it's finally popular in JavaScript. However, I still can't make events work in my classes. I did this simple example using Mozilla MDN as guide: var endEvent = new Event("end"); function MyClass(text){ this.text = text; this.show = function(){ console.log("MyText: "+this.text); this.dispatchEvent(endEvent); } } function End(evt){ console.log("Event dispatched: "+evt); } function run(){ var MyInstance = new MyClass("I have something to say..."); MyInstance.addEventListener("end", End, false); MyInstance.show(); } At the first line, Safari returns: "TypeError: '[object EventConstructor]' is not a constructor (evaluating 'new Event("end")')". It means won't work? Is there a way to create and dispatch custom events in PURE JavaScript (won't use jQuery or anything like)?
upvote count: 2
answer count: 2
accepted answer: http://stackoverflow.com/a/24966028
has title: How to work with events in pure JavaScript?
possible better answer: http://stackoverflow.com/a/24966245
has comment: http://stackoverflow.com/comment/38806844
tagged with: custom-events
has answer: http://stackoverflow.com/a/24966245
score: 2
downvote count: 0
tagged with: javascript
linked to: http://stackoverflow.com/q/22186467
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24966028
tagged with: events
favorite count: 0
linked to: http://stackoverflow.com/q/22571250

http://stackoverflow.com/q/25026164
has comment: http://stackoverflow.com/comment/38920132
has comment: http://stackoverflow.com/comment/38920022
has title: slide div left and right depending on the content of the div?
has answer: http://stackoverflow.com/a/25026722
answer count: 1
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25026722
favorite count: 0
score: 0
has comment: http://stackoverflow.com/comment/38920088
tagged with: http://stackoverflow.com/tag/html
has body: First off, I do apologize if this is a bit vague. I will try my best to explain this as best as I can. I am trying to create a slideshow affect with a div content. the content of the div is not images but they are HTML stuff.... buttons to be exact. I have a div with an overflow hidden and an inner div inside this div with a width of 500000px. I know this is a ridiculous width size but i only done this because the content of this div is pulled from a database and i don't know how much data might be in there in the future. i did try width:auto; but that didn't work. anyway, this is what I have in my page: &lt;div style="padding-left:15px; overflow:hidden;"&gt; &lt;div class="innerBottom" style="width:500000px;"&gt; &lt;?PHP echo $date_list; ?&gt; &lt;/div&gt; &lt;/div&gt; now, I need to create a function using jquery that would allow me to slide the innerBottom to left or right using two buttons. for example if the content is pulled from the database and there is not enough content for the slide to work then the slide is disabled but if there is enough content then the slide to the right is enabled at first and when the slided to the right once, then the slide to left is enabled. I hope this makes sense and someone could help me out with this. I did try something like this using jquery: &lt;script&gt; $("#button-bottom").click(function () { $('.innerBottom').animate({'margin-left':'3px'}); }, function() { $('.innerBottom').animate({'margin-left':'1003px'}); }); &lt;/script&gt; but that only does the left slide once and the inner div disappears for good. Thanks in advance
tagged with: css
upvote count: 1
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/38920177
type: Question
type: AnsweredQuestion

http://stackoverflow.com/comment/38864161
has text: This is, if I understand it correctly, the reason custom names are not recommended. The issue is that, without the `require.config` setup, in asynchronous mode RequireJS has no way of knowing where `dummy` maps to - so it falls back on it's default algorithm (`basePath + module/id`). When you *build* your modules (with `r.js` or similar) this is not a problem because both modules are loaded in the bundle.)
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24996065
score: 1

http://stackoverflow.com/comment/38750128
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24936070
has text: there are many scripts http://riotdesign.eu/assets/js/main.js?v=3

http://stackoverflow.com/q/24987791
has comment: http://stackoverflow.com/comment/38847655
has comment: http://stackoverflow.com/comment/38847705
score: 2
has comment: http://stackoverflow.com/comment/38847547
tagged with: highcharts
answer count: 0
downvote count: 0
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38847620
has comment: http://stackoverflow.com/comment/38863751
has comment: http://stackoverflow.com/comment/38848468
favorite count: 0
has comment: http://stackoverflow.com/comment/38847715
has body: How would I go about allowing a user to change the status of a graph and updating it on the page? For example, allowing a user to adjust the size of a graph without having to rePOST. I am using High charts in Django, what I have thought about doing is this. Send all the data over, and set a default size so that there is something to display. Then add a dropdown or something that allows the user to increase the size of the graph. When a user selects one of them, I somehow slice the data to increase the size. E.g., list L = [1,2,3,4,5,6,7,8,9,10] is sent over, but the default size is 5. So only L[:5] is displayed. The user selects the size to be 6, so it reloads so that L[:6] is displayed. Example graph: Below are code snippets of my class based view. A user searches the reddit user he/she wants to analyse -> data is collected, fun things happen and all charts are set up -> def post(self, request): ... top_chart_series = collected user data, ready to be parsed in JS. # currently I am only sending over the default size of data (top 10 words) # but what I would like to do is send ALL of the data and then deal with it in JS. return render(request, &lt;htmlpage.html&gt;, .... lots of variables, {'top_chart_series': top_chart_series...}) .... to the JS # So this is where I am a bit confused. # At this point, the page is being loaded and the charts are being set up via JS: # My question then, is how can I allow the user to adjust the size of the graph without having # to rePOST? # I lack JS knowledge so that is probably why I am so confused in how I can approach this. # Anyway, what I was thinking was, once ALL the data is sent, I first chart a graph # with the default size (10 words), and then if the user decides to adjust the data # I run the function again(?) with the selected size. # Here is the JS that I use currently, I haven't implemented anything I have described. function top_words(target, title, categories, data){ // The parameters are variables sent in by django …
type: Question
upvote count: 2
has comment: http://stackoverflow.com/comment/38848021
has title: Dynamically changing chart data using Django and Highcharts?
tagged with: django
has comment: http://stackoverflow.com/comment/38847679
tagged with: python
has comment: http://stackoverflow.com/comment/38878176

http://stackoverflow.com/a/25053600
has comment: http://stackoverflow.com/comment/38972035
answers question: http://stackoverflow.com/q/25053513
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38971612
type: Answer
has body: You can't do database operations directly in Javascript. What you need to do is to simply make a new AJAX request on success to a php file on the backend to update given table. However this would mean two AJAX requests to the backend, both of which manages database data. Seems a bit unnecessary. Why not just do the update operation after the delete operation in the php file itself?
upvote count: 1

http://stackoverflow.com/comment/38786483
comment on: http://stackoverflow.com/q/24955503
has text: Have you included references to the libraries? Not using Visual Studio myself but I think this guy is doing the same setup as you http://www.rosher.co.uk/post/2013/10/22/Unit-Testing-AngularJS-with-Jasmine-Chutzpah-and-Visual-Studio.aspx
type: Comment
type: QuestionComment
score: 2

http://stackoverflow.com/comment/38739697
comment on: http://stackoverflow.com/q/24930601
score: 0
type: Comment
type: QuestionComment
has text: @NayeemMansoori I've tried adding `AutoPostback="True"` but the debug writeline still does not fire or the method not called as far as i am aware etc

http://stackoverflow.com/a/24969034
has body: You want to do this: $.ajax({ type: "GET", url: "/loadmore/dj/", data: { 'slug': $('.dj_slug').text().trim(), 'song_rank': $("#dj_song_list").find('.song_block').length }, dataType: 'html' }).done(function (response) { $(response).appendTo($('#dj_song_list')).hide().slideDown(1000); });
score: 1
has comment: http://stackoverflow.com/comment/38812331
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38812231
has comment: http://stackoverflow.com/comment/38812572
has comment: http://stackoverflow.com/comment/38812411
has comment: http://stackoverflow.com/comment/38814440
downvote count: 0
has comment: http://stackoverflow.com/comment/38814611
has comment: http://stackoverflow.com/comment/38814491
has comment: http://stackoverflow.com/comment/38812218
has comment: http://stackoverflow.com/comment/38812774
answers question: http://stackoverflow.com/q/24969024
has comment: http://stackoverflow.com/comment/38813278
has comment: http://stackoverflow.com/comment/38813112
accepted answer of: http://stackoverflow.com/q/24969024
type: Answer
upvote count: 1

http://stackoverflow.com/comment/38977168
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25056683
type: AnswerComment
has text: Thanks. The mistake was that i was doing `.then(myTask())` instead of `.then(function() { myTask() })`. It was right in front of my eyes but i missed it.

http://stackoverflow.com/comment/38857697
type: QuestionComment
comment on: http://stackoverflow.com/q/24993242
has text: Check console log in the fiddle, http://jsfiddle.net/bg4CE/1/
score: 0
type: Comment

http://stackoverflow.com/q/24978824
accepted answer: http://stackoverflow.com/a/24978899
linked to: http://stackoverflow.com/q/8228281
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24978899
type: Question
has body: how to convert the following setInterval() to requestAnimationFrame()? Below is a simple working setInterval model that I'm using. $(document).ready(function() { $("#add").click(function() { $('#result').html( (parseFloat($('#numA').val()) + parseFloat($('#numB').val())).toString() ); }); setInterval(function () {$("#add").click()}, 1000); }); http://jsfiddle.net/nqqfq/4/ I've seen one that requires loop (game loop), but my code isn't about gaming. It's about parsing strings. The documentation is a bit complicated. I've tried some trial-errors, but no success so far. Thank you for any input.
has comment: http://stackoverflow.com/comment/38830434
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38830451
has title: setInterval to requestAnimationFrame
score: 0

http://stackoverflow.com/q/25033964
has answer: http://stackoverflow.com/a/25036493
has answer: http://stackoverflow.com/a/45132577
downvote count: 0
tagged with: javascript
has body: I am trying to fetch profile picture from facebook. Right now I am getting all information from facebook but unable to get profile pic of the user. Here is my code: function getFBData () { FB.api('/me', function(response) { fbinfo = new Array(); fbinfo[0] = response.id; fbinfo[1] = response.first_name; fbinfo[2] = response.last_name; fbinfo[3] = response.email; FB.api('/me/picture?type=normal', function (response) { var im = document.getElementById("profileImage").setAttribute("src", response.data.url); alert(im); }); How can I get picture from response of this API.
favorite count: 0
tagged with: ajax
has answer: http://stackoverflow.com/a/41107947
has comment: http://stackoverflow.com/comment/38934635
answer count: 10
has answer: http://stackoverflow.com/a/34804512
has answer: http://stackoverflow.com/a/42595454
has comment: http://stackoverflow.com/comment/38934707
has comment: http://stackoverflow.com/comment/38934769
has title: How to fetch profile picture from facebook javascript SDK?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38934502
tagged with: facebook
upvote count: 7
has answer: http://stackoverflow.com/a/25036386
has answer: http://stackoverflow.com/a/45335234
has comment: http://stackoverflow.com/comment/38934556
has answer: http://stackoverflow.com/a/37583624
score: 7
has answer: http://stackoverflow.com/a/54613073
has answer: http://stackoverflow.com/a/53379002
has comment: http://stackoverflow.com/comment/38934471
type: Question

http://stackoverflow.com/a/25068931
type: Answer
answers question: http://stackoverflow.com/q/25063816
has body: Try adding styles for all div inside tab-container like this: .tab-container div { float:left; clear:both; width:100%; } or try using the css example of EasyTab website: .etabs { margin: 0; padding: 0; } .tab { display: inline-block; zoom:1; *display:inline; background: #eee; border: solid 1px #999; border-bottom: none; -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; } .tab a { font-size: 14px; line-height: 2em; display: block; padding: 0 10px; outline: none; } .tab a:hover { text-decoration: underline; } .tab.active { background: #fff; padding-top: 6px; position: relative; top: 1px; border-color: #666; } .tab a.active { font-weight: bold; } .tab-container .panel-container { background: #fff; border: solid #666 1px; padding: 10px; -moz-border-radius: 0 4px 4px 4px; -webkit-border-radius: 0 4px 4px 4px; } I hope this help!
score: 0

http://stackoverflow.com/q/24984083
tagged with: express
favorite count: 0
has answer: http://stackoverflow.com/a/24987986
has body: I have an express app with session in the back end, and in the front I have Backbone+RequireJS. My problem is with the session Model I have, and the change event that triggers the render method on the views. So: The app has a Home view, that has a listener to the "change" event of the Session Model, and runs the "render" method. An users with no credentials go into a public page from the home, let's say to /about In there, the user logins from the header that has a login form (user/password). Because of the listener in item 1, the container element gets an updated with the new home content, but the user is still in /about. So, the question is: How do I avoid this bad behavior, so the views only listen to events if the correct route is active? A code example: "use strict"; var SessionModel = Backbone.Model.extend({}); var sessionModel = new SessionModel(); var HomeView = Backbone.View.extend({ initialize: function() { this.listenTo(sessionModel, "change", this.render); }, render: function() { // updates the main container element } }); var AppRouter = Backbone.Router.extend({ "": "home", "about": "about" }); var appRouter = new AppRouter(); appRouter.on("route", function() { sessionModel.fetch(); // Updates session model on every route change }); appRouter.on("route:home", function() { var homeView = new HomeView(); homeView.render(); });
tagged with: node.js
tagged with: backbone.js
possible better answer: http://stackoverflow.com/a/24986614
has comment: http://stackoverflow.com/comment/38846559
has answer: http://stackoverflow.com/a/24986614
tagged with: requirejs
upvote count: 1
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24987986
has comment: http://stackoverflow.com/comment/38846855
score: 1
has comment: http://stackoverflow.com/comment/38842662
has title: Backbone model change and view render update
type: Question
answer count: 2
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/24923708
tagged with: javascript
has body: &nbsp;&nbsp;I want to use next PHP script to serve combined, pre-gzipped and minified JS and CSS files. source code is available here: https://code.google.com/p/compress/ There is a WAMP localhost with wordpress installed. And what I have done: added three files (jsmin.php, cssmin.php, compress.php) in child-theme's folder; added directory 'min' in child-theme folder; created file 'compress_timestamp.php' added code below into header.php (tried functions.php then tried first line of header.php) require_once('compress_timestamp.php'); //load timestamp created by compress.php module sets field $compress_stamp=unix_timestamp if (stripos($_SERVER['HTTP_ACCEPT_ENCODING'],'GZIP')!==false) $gz='gz'; else $gz=null; echo '&lt;link rel="stylesheet" type="text/css" href="min/css_schedule_'.$compress_stamp.'.css'.$gz.'" /&gt;',PHP_EOL; // the following scripts were combined into css_schedule // echo '&lt;link rel="stylesheet" type="text/css" href="CSS/menu.css" /&gt;',PHP_EOL; // echo '&lt;link rel="stylesheet" type="text/css" href="CSS/ThreeColumnFixed.css" /&gt;',PHP_EOL; // echo '&lt;link rel="stylesheet" type="text/css" href="CSS/sprite.css" /&gt;',PHP_EOL; // echo '&lt;link rel="stylesheet" type="text/css" href="CSS/iCal.css" /&gt;',PHP_EOL; changed lines accordingly to child-theme and parent folders: echo '&lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;',PHP_EOL; echo '&lt;link rel="stylesheet" type="text/css" href="../twentyfourteen/style.css" What was missed and what is the right way to make it work? And finally when all is done how to launch that script remotely on XAMP (VPS)?
upvote count: 1
tagged with: minify
favorite count: 0
downvote count: 0
has comment: http://stackoverflow.com/comment/39433574
type: UnansweredQuestion
tagged with: css
score: 1
tagged with: compression
tagged with: wordpress
type: Question
has title: Minify css and js with PHP compression script in Wordpress child-theme
answer count: 1
has answer: http://stackoverflow.com/a/29611620

http://stackoverflow.com/q/25053093
downvote count: 1
has answer: http://stackoverflow.com/a/25152112
tagged with: performance
has title: How to perform batch inserts into SQLite using JavaScript ? I am using the phonegap+sencha framework
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: sqlite
favorite count: 0
tagged with: sencha-touch
tagged with: cordova
type: UnansweredQuestion
has body: I am retrieving 4 mb of JSON data from the server and inserting it into the local database on an android phone. Does sencha support this feature ? Sample code would be appreciated.
upvote count: 1

http://stackoverflow.com/comment/38921157
comment on: http://stackoverflow.com/a/25023601
score: 0
type: AnswerComment
type: Comment
has text: I'm not exactly sure because I have personally never used it, but I believe it toggles to either the width of the element or the width of the container.

http://stackoverflow.com/comment/38898414
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25014911
score: 0
has text: Could you please share with us the requirement that led you to investigate this? Perhaps we can suggest a solution if we understand the context.

http://stackoverflow.com/comment/38956292
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25045467
has text: Did you try placing the script before your button definition?

http://stackoverflow.com/q/25006078
has answer: http://stackoverflow.com/a/25006309
downvote count: 0
answer count: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25006309
score: 3
favorite count: 0
tagged with: angularjs
has title: Global back/next buttons in AngularJS
type: AnsweredQuestion
upvote count: 3
has body: I have some navigation buttons on an Angular wizard-style webapp. For cosmetic reasons they need to be removed from each partial and added to the root "index.html": Back Next I've attempted to isolate this logic using directives and scope variables to bind the click event and apply target destinations for each partial: .directive('nextAction', ['$location', function($location) { return { restrict: 'A', link: function(scope, elm) { elm.on('click', function () { var nextUrl = scope.nextUrl; $location.url(nextUrl); }); } }; }]) The URL's are then defined in each controller: .controller('FirstStepCtrl', ['$scope', function ($scope) { $scope.backUrl = '/'; $scope.nextUrl = '/first/second'; ... The problem is that scope.nextUrl is undefined since the directive scope does not inherit the controller scope. Along with the fact it doesn't currently work, this approach also seems a bit fragile to me since it relies on navigation logic embedded in the controller code. How might I create better global back/next buttons that dynamically redirect based on the current "page"?
tagged with: angularjs-scope
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/q/25008753
linked to: http://stackoverflow.com/q/203198
has comment: http://stackoverflow.com/comment/38887689
answer count: 0
has title: A simple .click() and .html() not working
duplicate of: http://stackoverflow.com/q/203198
type: Question
has comment: http://stackoverflow.com/comment/38889525
has comment: http://stackoverflow.com/comment/38887913
has comment: http://stackoverflow.com/comment/38888693
tagged with: javascript
has comment: http://stackoverflow.com/comment/38887057
has comment: http://stackoverflow.com/comment/38886742
has comment: http://stackoverflow.com/comment/38887704
score: 0
has comment: http://stackoverflow.com/comment/38887936
upvote count: 1
has body: UPDATE: Here is a jsfiddle that better exhibits my problem. Several attempted solutions are at the bottom of the post. http://jsfiddle.net/2ZLse/7/ Now I know I should know how to do this, but this simple .click() then .html() event is not working. It's part of something slightly more complicated, but I don't see how any of that could be preventing this from working. The functionality is a control panel that takes over the image displaying div when it needs more room to display input forms. I hope that makes sense. I've tried putting the event other places in the code, changing classes to IDs, and lots of little things I was pretty sure wouldn't fix the problem. It might be something simple, I hope it is. Here is what is hopefully the relevant code. HTML <?php session_start(); ?> <?php //prompt for username before creating page include 'login.php'; if(!isset($_SESSION['name'])){ loginForm(); } else { //begin page content //don't know if the fact this is all inside of php brackets is relevant. Might be. ?> Talk Shout Watch Show Share Leave And here is the javascript and jquery, which I suspect is where the problem lay. var imagebox = ' ' + ' ' + ' '; var watchform = ' ' + ' ' + ' ' + ' ' + ' ' + ' nevermind '; $(document).ready(function(){ //control functionality $('.nevermind').click(function(){ $('#imagebox').html(imagebox); }); $('#watchcontrol').click(function(){ $('#imagebox').html(watchform); }); }); UPDATE: I did as HoangHieu suggested below, this did not work. $('.nevermind').innerHTML(); $('.nevermind').on("click",function(){ $('#imagebox').html(imagebox); }); Also, the duplicate I was marked as is not helping, but I'll keep reading it and try to apply it to my code. UPDATE: I kept reading, and I just don't see it. It seems to be a question about .hover and a loop. Is there something I'm missing? UPDATE: I tried as Antti Haapala suggested below, and it did not work either. $(document).on('click', '.nevermind', function() { $('#imagebox').html(imagebox); }); …
downvote count: 1
has comment: http://stackoverflow.com/comment/38888136
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38890852
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38887728

http://stackoverflow.com/comment/38885588
has text: Why not to [study it](https://developer.mozilla.org/en-US/docs/Web/CSS/transform#scale) yourself?
type: QuestionComment
comment on: http://stackoverflow.com/q/24995173
score: 0
type: Comment

http://stackoverflow.com/q/25013232
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25013351
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 2
score: 1
has body: I am trying to make the current submenu stay active and the other ones to hide, but failing to understand how the this keyword works. Currently all the sub-menu stays active when a link from any submenu is clicked because of the $('.nav-second-level').show(); and I think here I need to modify but can't understand how. I am a jquery Noob. HTML Administration Users Groups ANother Submenu More Users MoreGroups JQUERY $(document).ready(function() { var aObj = $('a'); var found = false; for(var i=aObj.length-1; i>=1 && !found; i--) { if(document.location.href.indexOf(aObj[i].href)>=0) { $(aObj[i]).addClass('active-me'); found = true; } } var submenulink = $('.nav-second-level > li > a'); if(submenulink.hasClass('active-me') == true){ $('.nav-second-level').show(); } });
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25013351
tagged with: javascript
has title: Show current sub menu and hide the other ones

http://stackoverflow.com/comment/38861516
score: 0
type: QuestionComment
has text: nope, nothing happens. The error is the one I wrote above on this line of code: navigator.screenshot.save(function(error,res){
type: Comment
comment on: http://stackoverflow.com/q/24994824

http://stackoverflow.com/comment/38799981
type: AnswerComment
has text: Yes. If you are using any other components other than core angular you would need to include its own typings.
score: 1
type: Comment
comment on: http://stackoverflow.com/a/24962404

http://stackoverflow.com/comment/38903449
type: AnswerComment
has text: You don't need the parens around the function expression, having `==` on the LHS is sufficient to make it a function expression rather than a declaration. `1 == function () { return 1; }()`
type: Comment
score: 3
comment on: http://stackoverflow.com/a/25017577

http://stackoverflow.com/comment/38926680
type: Comment
has text: @JoshuaBrand: did you eventually fixed the issue?
comment on: http://stackoverflow.com/a/25012497
score: 0
type: AnswerComment

http://stackoverflow.com/q/24927519
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38734634
has comment: http://stackoverflow.com/comment/38734606
tagged with: forms
type: Question
has answer: http://stackoverflow.com/a/24928876
has title: In a dynamically changing fields using jquery same field gets posted twice
has body: I'm working on a form where I have a text field which will be changed on radio button selection. $("#id_radio1").click(function() { $("#multi_language").hide(); $("#single_language").show(); }); $("#id_radio2").click(function() { $("#single_language").hide(); $("#multi_language").show(); }); Say suppose id_radio1 and id_radio2 are two radio buttons and selecting each changes the form fields differently. Now I was able to do it successfully. My problem is when I submit the form after single language button is clicked the values are stored as multi as the values of the multi language hidden fields are submitted overridding the values of first.CAn I disable the other field without interference of the same on submission. How can I correct this? I'm new to such problem. I want the field to be submitted only once.i.e, if single language field is selected single should be posted and not multi(as it is working now) and when multilanguage is selected multi should be posted.How can I correct this now with the following code. Fiddle I have other fields common for both single and multi language in the same form as well, whose values are not changed on submission Now, in the console I see there are two posts for the same fields in the response i.e. one for single language and other multi language.
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/24927956
answer count: 3
has answer: http://stackoverflow.com/a/24928105
tagged with: jquery
type: UnansweredQuestion

submit
tags question: http://stackoverflow.com/q/25053639
tags question: http://stackoverflow.com/q/24913512
tags question: http://stackoverflow.com/q/25043227
tags question: http://stackoverflow.com/q/24933898
tags question: http://stackoverflow.com/q/24924669
tag name: submit
tags question: http://stackoverflow.com/q/25064009
type: Tag
tags question: http://stackoverflow.com/q/25020237

http://stackoverflow.com/comment/38793697
type: Comment
has text: Xan That's a really good question. That actually may explain it! I am going to give that a shot! I didn't even think about that.
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24959208

http://stackoverflow.com/q/25051575
tagged with: javascript
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25051624
linked to: http://stackoverflow.com/q/9183381
tagged with: jquery
has body: Here my code: Assign Labels <g:render template=""/> function showAssignLabelsInMain(elm) { $.ajax({type: 'POST', url: '${createLink(controller: "HRAdmin", action: "labelListInMain")}', success: function (data, textStatus) { $('#labelListInMain').html(data); } }); var offset = $(elm).offset(); $("#labelListInMain").css({top: offset.top + 25, left: offset.left - 18, position: 'absolute'}); $('#labelListInMain').toggle('fast'); $(".container").mouseup(function (e) { var subject = $("#labelListInMain"); alert(e.target.id) if (e.target.id != subject.attr('id')) { subject.fadeOut(); } }); It means that when I clicked the button, toggle will show up, but when I click inside that toggle, it fades out. It is not supposed to fade out and I don't know what's wrong.
type: Question
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25051624
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/25051698
has title: Mouse-up event goes wrong
possible better answer: http://stackoverflow.com/a/25051688
has answer: http://stackoverflow.com/a/25051688
has comment: http://stackoverflow.com/comment/38967682

http://stackoverflow.com/comment/38975358
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25055753
has text: no.. but you can do: ocject.method1("data1").method2("data2").method3("data3");
score: 0

http://stackoverflow.com/a/24968357
has comment: http://stackoverflow.com/comment/38810756
answers question: http://stackoverflow.com/q/24968328
has body: $("#container img").length - For img tag count To extract strings for each, $("#container").find("p, h").not("div").each(function() { console.log($(this).get(0)); //Object }); Note: You are using some weird &lt;h&gt; element which is an invalid HTML tag, I think its &lt;h1&gt; or some other header element.
type: Answer
has comment: http://stackoverflow.com/comment/38810741
has comment: http://stackoverflow.com/comment/38810860
has comment: http://stackoverflow.com/comment/38810849
has comment: http://stackoverflow.com/comment/38810905
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24968328

postback
tag name: postback
type: Tag
tags question: http://stackoverflow.com/q/24927651

http://stackoverflow.com/comment/38912842
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25020786
has text: This makes sense. Sorry it took me so long to read over, I'm very new to angular, and I wanted to try everything you posted to see if I truly grasped it. Thank you so much for all of your time in typing this up for me. I really appreciate it.
type: Comment

http://stackoverflow.com/comment/38853386
has text: Perhaps you can use this http://bseth99.github.io/projects/jquery-ui/7-jquery-ui-labeled-slider.html
type: Comment
comment on: http://stackoverflow.com/q/24982280
score: 0
type: QuestionComment

http://stackoverflow.com/q/24983421
favorite count: 0
type: UnansweredQuestion
has body: So I have a list that has Home, Shop, Forums, and Apps/Applications. On that list I want to have Apps to be shown but when you hover over the list item for it to change to the word Applications. I want it to change anywhere inside the list item and not only on the text hover. So I want to be able to hover anywhere in the list area and not just on the word for it to change. If anyone knows how to do this then that would be awesome. I just need the code and for you to tell me where I would put this in my code and what I need to change the names to. Thank you. This is the html I have for the list item Apps
has title: How to change the text inside a list item on hover
downvote count: 5
type: Question
has comment: http://stackoverflow.com/comment/38840521
upvote count: 0
score: -5
answer count: 1
has answer: http://stackoverflow.com/a/24983675
tagged with: javascript
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38839291

http://stackoverflow.com/comment/38881281
score: 0
comment on: http://stackoverflow.com/a/25005768
type: AnswerComment
has text: No, you can pass an Anonymous function, or unexecuted function, which looks like a variable in JavaScript.
type: Comment

http://stackoverflow.com/q/24943868
has comment: http://stackoverflow.com/comment/38765366
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38765398
downvote count: 2
type: Question
duplicate of: http://stackoverflow.com/q/855360
has comment: http://stackoverflow.com/comment/38765393
has answer: http://stackoverflow.com/a/24943920
score: -2
has comment: http://stackoverflow.com/comment/38765422
linked to: http://stackoverflow.com/q/128923
has title: return false/web development javascript/jquery
upvote count: 0
answer count: 1
linked to: http://stackoverflow.com/q/855360
tagged with: javascript
tagged with: jquery
has body: I have some code examples like this ---------------------- First example ----------------- var rightFunction=function() { if (options.currentPage &lt; options.numberOfPages) { options.currentPage += 1; ajaxConnection(); } return false; }; $('#newsContainer #rightSlider').click(rightFunction); $('#rightSliderHigh').click(rightFunction); ---------------------- Second example------------------- $('#rightSliderPagination').click(function(){ if (parseInt(_pagina_last_link.html()) &gt;= options.numberOfPages) { return false; } _first_page_num = parseInt(_pagina_first_link.html()); paginationGenerator(_first_page_num + options.centerNumber - 1); $('#slider-inner').slider("option", "value", _first_page_num + options.centerNumber - 1); return false; }); ------------------------Third example ---------------------- $(".download").click(function(){ if($(this).attr('goToPage')=='true') { var url=$(this).attr('href'); document.location.href=url; return false; } var _this = $(this); var thistext = $("#bg-download-box").html(); var _whattoshow = $(this).parent().find(".what-to-show").html(); if (_whattoshow){ $("#bg-download-box form").html(_whattoshow); } else{ $("#bg-download-box").html("&lt;div id='bg-download-box-inner' style='height:132px'&gt;&lt;/div&gt;"); } if ($(".reccomend-box").length != 0){ $("#rightColumn").css("z-index",99999); } $("#bg-download-box").show(); var whattocopy = $("#bg-download-box"); $(whattocopy).insertAfter(_this); $("ul#songs-list").css("z-index","99999"); $("ul#songs-list li.b-a-r").removeClass("emph"); $(this).parent().parent().parent().addClass("emph"); return false; }); Why is return false is used at end of these functions. Please, somebody could explain the purpose of return false.
favorite count: 0
has comment: http://stackoverflow.com/comment/38765404
duplicate of: http://stackoverflow.com/q/128923

http://stackoverflow.com/q/24937182
type: Question
has answer: http://stackoverflow.com/a/24937221
tagged with: javascript
has body: I have an equation where the last operator is specified consecutively it should remove the last operator. I amnot sure how to do this using regex i.e var operators = ['*', '-', "+']; if(operators.indexOf(eql.innerText.slice(-1)) &gt; -1) { eqText = eqText.replace(/.$/, ''); } in this case if my equation is 9 * *, i want it to strip the last * along with the space before it. basically it should be 9 * instead of 9 * * any pointers
score: 0
answer count: 1
type: UnansweredQuestion
tagged with: regex
has title: regexp to strip empty space in an equation

http://stackoverflow.com/a/24987777
upvote count: 1
has comment: http://stackoverflow.com/comment/38857930
has comment: http://stackoverflow.com/comment/38870655
has comment: http://stackoverflow.com/comment/38856721
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Your libs should all be minified already, or available like that, and your app should reside in a single object. Generally: FILE-BOOTSTRAP // Create Global "extend" method var extend = function(obj, extObj) { if (arguments.length &gt; 2) { for (var a = 1; a &lt; arguments.length; a++) { extend(obj, arguments[a]); } } else { for (var i in extObj) { obj[i] = extObj[i]; } } return obj; }; FILE-A window.APP=window.APP||{}; extend(window.APP,{ //subsystem A functionality subsystemA:{ } }); FILE-B window.APP=window.APP||{}; extend(window.APP,{ //subsystem B functionality subsystemB:{ } }); FILE-Z window.APP.boot(); So you just concat the files and minify. If you have a bunch of functions/classes in Global, you will have to have enclose your whole mess in a self-executing function before minification.
accepted answer of: http://stackoverflow.com/q/24982592
type: Answer
answers question: http://stackoverflow.com/q/24982592

http://stackoverflow.com/a/24967317
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24950193
accepted answer of: http://stackoverflow.com/q/24950193
has body: Finally found it. Turns out this was as easy as I thought. All I had to do was add this line of code into the request section: var request = gapi.client.blogger.posts.list({ 'blogId': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'fields': 'items(content,title,updated,id,labels)', 'labels': 'XYZ', 'fetchBodies': true }); Couple of things that tripped me up were that the field is 'labels', plural, not 'label', singular. Also, for some reason, it seems that the 'labels' specification has to come before 'fetchBodies', or the code fails. I'm not sure why that would be, but that was my experience.

http://stackoverflow.com/q/24922127
linked to: http://stackoverflow.com/q/7273927
tagged with: css
possible better answer: http://stackoverflow.com/a/24922592
has title: How can I track down a:hover jquery source?
favorite count: 0
upvote count: 0
has body: I want to display some footer logos in white. Then, on hover, they reveal the logos' true colors. I have implemented this on other websites and the background of the original link is simply replaced with the hover background. I tried implementing this on some newer themes purchased from themeforest, which leads me to believe some newer version of query is doing something weird. On the newer sites, the new background will slide up, or from the bottom right corner. Here is an example of the undesired behavior: http://idtools.org/id/grasshoppers/new/about.php I have tried removing .js files and .css files one by one and none had an effect, not even using different jquery versions. How can I figure out what is responsible for this hover animation? link to desired logos: http://itp.lucidcentral.org/id/palms/palm-id/index.html HTML
has comment: http://stackoverflow.com/comment/38755220
has answer: http://stackoverflow.com/a/24923695
downvote count: 1
tagged with: hover
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24941188
score: -1
has answer: http://stackoverflow.com/a/24922592
type: Question
has comment: http://stackoverflow.com/comment/38724357
has comment: http://stackoverflow.com/comment/38739042
has answer: http://stackoverflow.com/a/24941188
tagged with: javascript
tagged with: jquery
answer count: 3
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24979512
has body: I have created dc.js visualization have four different bar graphs. Also each graph have a button to open that particular graph in new browser window. For that purpose I have created separate HTML file for each graph. I want to interact between the graphs opened in two different windows. Is it possible? How? Thanks!
answer count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: dc.js
has title: interact between two different graphs in two different browser windows in dc.js crossfilter
type: Question
tagged with: d3.js
has answer: http://stackoverflow.com/a/24979542
score: 0

http://stackoverflow.com/comment/38837649
has text: Thanks, I have it working now however I have realised I need this to repeat/cycle through and start from the beginning. So instead of after 6 seconds it should be "every 6 seconds" or "every 12 seconds" or "every 18 seconds". I have updated JSFiddle and it works but no cycle nor animation http://jsfiddle.net/K5Pk3/9/
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24982698

http://stackoverflow.com/q/24928454
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38736467
has comment: http://stackoverflow.com/comment/38737168
type: UnansweredQuestion
tagged with: angular-directive
has comment: http://stackoverflow.com/comment/38736657
upvote count: 3
has comment: http://stackoverflow.com/comment/38738909
tagged with: unit-testing
has comment: http://stackoverflow.com/comment/38738891
type: Question
has answer: http://stackoverflow.com/a/24932533
score: 3
has title: AngularJS – how to write unit-test in Jasmine for enter events directive
has comment: http://stackoverflow.com/comment/38738805
has comment: http://stackoverflow.com/comment/38738209
has comment: http://stackoverflow.com/comment/38735903
has comment: http://stackoverflow.com/comment/38737910
has comment: http://stackoverflow.com/comment/38740403
has body: I have created enter event directive in AngularJS, so that i want to run test case for that directive. but i don't know how to write code for enter event. describe('Unit Test: Enter Event', function() { var elm, compile, scope; beforeEach(function() { module('att.sandbox.attEnterEvent'); inject(function($compile, $rootScope) { compile = $compile; scope = $rootScope.$new(); }); }); /*scenarion 1*/ it("Enetr Key should call the method inside controller", function() { elm = angular.element('&lt;input type="text" att-enter-event="enterEvent()"&gt;'); elm = compile(elm)(scope); scope.$digest(); scope.enterEvent = jasmine.createSpy(); //**Here i want to add enter event test case** expect().toHaveBeenCalled(); }); })
has comment: http://stackoverflow.com/comment/38738467
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jasmine
favorite count: 0

http://stackoverflow.com/a/25022252
type: Answer
upvote count: 1
has body: Some debugging thoughts: Well, firstly you should have checked if the function was running or not(it wasn't for me) I modified it like this: Tutorials Secondly, getElementsByClassname returns an array so modify your script like this: function activateTutorials(){ console.log(document.getElementsByClassName('Tutorials')); if(document.getElementsByClassName('Tutorials')[0].classList.contains('underlist')) { document.getElementsByClassName('Tutorials')[0].classList.remove('underlist'); }else{ document.getElementsByClassName('Tutorials')[0].classList.add('underlist'); } }; You might have noticed a console statement in the begining of your function, it is a means of debugging(in chrome access it with Ctrl+Shift+J).
score: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25022107
downvote count: 0
answers question: http://stackoverflow.com/q/25022107

http://stackoverflow.com/q/24962802
accepted answer: http://stackoverflow.com/a/24965248
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has body: In my page I have a download button that download the screen content in a CSV file. The CSV file is generated by another function in Javascript based on my grid data. The code I´m using to generate data is based on that post. All is fine, except that I don´t want to have an tag on my screen, but a styled button. I can´t have a form on that place neither. Just a plain button. So, I have to create the on the fly, fire it and then delete it. Here is my code: Export Now my function: var buttonClicked = function () { var content = getMyCsvData(); /// custom function to get CSV data if (window.navigator.msSaveOrOpenBlob) { alert('blob'); var fileData = [content]; blobObject = new Blob(fileData); window.navigator.msSaveOrOpenBlob(blobObject, "download_data"); } else { var tempRef = $("download"); var url = "data:text/plain;charset=utf-8," + encodeURIComponent(content); $(tempRef).attr("href", url); this.element.append(tempRef); $(tempRef).click(); this.element.remove(tempRef); } This code sounds strange for me and it´s not working for Chrome (that uses the href approach for downloading data). So, quetions: Is there a better way of attaching the event to the button without creating the ? If not, how can I create my anchor, fire my temporary anchor and then delete it without affecting my current screen ? Thanks for help.
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
has title: Javascript create, fire an anchor tag and remove it alternatives
linked to: http://stackoverflow.com/q/3665115
has answer: http://stackoverflow.com/a/24965248
type: Question

http://stackoverflow.com/comment/38793314
score: 0
type: QuestionComment
type: Comment
has text: What is `(var i=p.length; --i>=0;)` supposed to be doing? Is this an `if` statement? A `for` loop? In its current state this snippet of code will not achieve anything.
comment on: http://stackoverflow.com/q/24959202

http://stackoverflow.com/a/24911053
has comment: http://stackoverflow.com/comment/38703622
score: 3
has comment: http://stackoverflow.com/comment/38703288
upvote count: 3
has body: You are using a scheme relative url for your reference to Angular: src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js" This uses the same scheme as you use to access your HTML document and will work perfectly if you load your HTML document using http:// or https://. Your local file is, presumably, being loaded from your file system (with a file:// URI) instead of a local website (with http://localhost/) and the resource is not available at file://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js. You can quickly hack this by using src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js" But you would be better off using a local webserver for testing as there are plenty of things (especially around Ajax, which you are using) that work differently between file:// and http://.
accepted answer of: http://stackoverflow.com/q/24910653
has comment: http://stackoverflow.com/comment/38702751
answers question: http://stackoverflow.com/q/24910653
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38703942
has comment: http://stackoverflow.com/comment/38702833
type: Answer

http://stackoverflow.com/comment/38922967
has text: Are you using jQuery at all?
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25027715

http://stackoverflow.com/q/24961858
answer count: 0
has title: How to detect if view-source is valid for Location Object in the current browser?
has comment: http://stackoverflow.com/comment/38798585
type: Question
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38798728
has body: There are a Javascript (or jQuery) method or property, that can detect if a window.location assign command, window.location.assign("http://www.stackoverflow.com") will be used to show the source-code of the page? That is, if the command, window.location.assign("view-source:http://www.stackoverflow.com") works with the client's browser. Related questions: https://stackoverflow.com/q/24894999/287948 ...
type: UnansweredQuestion

cell
tags question: http://stackoverflow.com/q/24999301
tag name: cell
type: Tag

http://stackoverflow.com/q/25002287
has comment: http://stackoverflow.com/comment/38937033
has comment: http://stackoverflow.com/comment/39038643
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/2496710
type: Question
has comment: http://stackoverflow.com/comment/38996861
has body: I searched around and found pieces of what I want to do and how to do it but I have a feeling combining them all is a process I shouldnt do and that I should write it a different way. Currently I had a small application that would use a MSSQL library in Node to Query a SQL Server with a sql command and get the results and store it as an object. Which then I use express and some javascript to decipher it or modify it before calling it with an AJAX call and responding it as a proper JSON object. SQLDB -> NodeJs -> API -> localhost My problem now is I want to repurpose this and expand it. Currently storing the SQLDB responses as objects inside an array is becoming a huge memory problem. Considering some of these requests can be hundred thousands of rows with hundreds of columns, the node process begins eatingup outrageous amounts of RAM. I then thought, maybe I could easily just take that object when it comes through in the result and write it to file. Then when ajax calls come to expressjs, it can read from the file and res.json from there. Will this work if say 50-200 some people request data at the same time? Or should I look for another method?
has comment: http://stackoverflow.com/comment/39022112
tagged with: javascript
tagged with: ajax
tagged with: sql-server
has title: Object inside Array as External File for Express
score: 0
has comment: http://stackoverflow.com/comment/39013066
answer count: 0
type: UnansweredQuestion
tagged with: node.js

http://stackoverflow.com/comment/38944265
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25039281
has text: There's still no guarantee anything would be sent. Did you place a console.log in the there to see if fires at all ?
score: 0

http://stackoverflow.com/comment/38736314
comment on: http://stackoverflow.com/q/24928846
score: 0
type: Comment
type: QuestionComment
has text: better to get a callback in function `x` and call that function with done.

http://stackoverflow.com/comment/38992717
comment on: http://stackoverflow.com/q/25064884
has text: Plus, you seem to be mixing MySQL APIs in two different bodies of code.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38946505
type: Comment
comment on: http://stackoverflow.com/a/25031439
score: 0
type: AnswerComment
has text: @Niang I did gave you an example, check it again

http://stackoverflow.com/comment/38757847
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24939704
type: Comment
has text: Yes it works now! Now, is it possible to only make this work on the FIRST focus, and not subsequent ones? I'm sure I can get it to do that on my own, but I might as well ask.

http://stackoverflow.com/q/24959759
has comment: http://stackoverflow.com/comment/38794804
score: 0
has title: .htaccess how to not cache post requests
has comment: http://stackoverflow.com/comment/38794559
tagged with: .htaccess
has comment: http://stackoverflow.com/comment/38794750
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38794875
has comment: http://stackoverflow.com/comment/38794686
answer count: 0
has body: I'm using the following code to browser cache my static js files. Wordpress uses some get parameters for versioning e.g. file.js?ver=3.9.2 &lt;filesMatch "\.(js)$"&gt; Header set Cache-Control "private, max-age=700000" &lt;/filesMatch&gt; I was wondering whether were is a setting to not cache dynamically generated js files? E.g if it is a post request or a specific get request?
tagged with: wordpress
type: Question
tagged with: javascript

http://stackoverflow.com/q/25047439
score: 0
answer count: 1
favorite count: 0
tagged with: ajax
tagged with: magnific-popup
accepted answer: http://stackoverflow.com/a/25047511
has title: PHP Calculator - Show results on page and in Ajax Popup
linked to: http://stackoverflow.com/q/25007571
tagged with: popup
upvote count: 1
downvote count: 1
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25047511
tagged with: javascript
has body: UPDATE - this was solved by adding $('.popup-with-form').magnificPopup('open'); to the StateChanged function in the JS. Thanks to @Bollis. Original Question: I have a simple calculator here: http://www.roofingcalculator.org/popup/popup.htm when click on "Calculate" button, i need results to be displayed on that page AND initiate Ajax Popup (Magnific inline) with results displayed in popup as well. Question: How do i make it so that pressing "calculate" button would both of these at the same time: 1) display results on page 2) Launch pupup with results of calculator Right now, to show Popup, user needs to click on the link "Open Form". If you open popup AND don't click "calculte" button, no results are displayed. If you click Calculate first and then open popup, results are shown on both the page and in popup (see image). The two things that initiate popup are: &lt;a class="popup-with-form" href="#test-form"&gt; If i add class="popup-with-form" and href="#test-form" to the Calculate button, it launches popup, but no calculation is done. All codes for calculator (JS / PHP) can be seen here. Here is AJAX code that opens popup (i think) $(document).ready(function() { $('.popup-with-form').magnificPopup({ type: 'inline', preloader: false, focus: '#name', // When elemened is focused, some mobile browsers in some cases zoom in // It looks not nice, so we disable it: callbacks: { beforeOpen: function() { if($(window).width() &lt; 700) { this.st.focus = false; } else { this.st.focus = '#name'; } } } }); });

http://stackoverflow.com/comment/38744509
type: QuestionComment
comment on: http://stackoverflow.com/q/24932829
has text: try to change the `type` instead of `get` use `post`
score: 0
type: Comment

http://stackoverflow.com/a/24948743
has comment: http://stackoverflow.com/comment/38774579
has body: Use text() to change the text value $('.create-password-account').text('Sign up here for a new account');
type: Answer
answers question: http://stackoverflow.com/q/24948725
has comment: http://stackoverflow.com/comment/38774713
has comment: http://stackoverflow.com/comment/38774614
has comment: http://stackoverflow.com/comment/38774629
has comment: http://stackoverflow.com/comment/38774788
score: 0

http://stackoverflow.com/q/25004264
answer count: 1
tagged with: jquery
type: UnansweredQuestion
tagged with: wordpress
has title: WordPress and Waypoint Js
type: Question
tagged with: javascript
has body: i'm trying to work Waypoints with WordPress and went through many posts and tutorials on Google and for some reason it's still not working for me.. I put the waypoints.min.js and waypoints.js and the rest of the files in the download folder inside the js folder on my template's folder. I loaded it from the admin and checked with the inspector and the links are good. Here is my code- &lt;script type="text/javascript"&gt; jQuery(function() { jQuery('.slidingFacebook').hide(); jQuery('.content').waypoint(function(direction) { if (direction == 'down') { jQuery('.slidingFacebook').fadeIn(); } if (direction == 'up') { jQuery('.slidingFacebook').fadeOut(); } }); }); &lt;/script&gt; I tried placing it in few different areas/pages and it still doesn't get to the waypoint function.. You can see it here- http://aviv.xcore.co.il/another-sample-post-show-website/ Thanks to all helpers!
score: 0
has answer: http://stackoverflow.com/a/25016657

http://stackoverflow.com/comment/104012365
score: 1
has text: Hey Travis =) I feel like your post is ultimately the more important one for the overall info contained in it. It was not the answer to this question though, as Jessie's answer actually got me to figuring it out. I feel like your answer below will continue to receive the attention it deserves and upvotes for it =)
comment on: http://stackoverflow.com/q/25063868
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38971239
comment on: http://stackoverflow.com/q/25053427
type: Comment
has text: @webkit i don't have a link yet...still waiting on FTP info from the client. I'll try your suggestion in the morning. Not a bad idea! Thanks!
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38919091
has text: Sure, read these http://www.w3schools.com/jsref/jsref_obj_date.asp and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date The tell you all about the javascript date function.
comment on: http://stackoverflow.com/a/25025165
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24946364
upvote count: 1
answers question: http://stackoverflow.com/q/24945323
has comment: http://stackoverflow.com/comment/38770329
score: 1
accepted answer of: http://stackoverflow.com/q/24945323
has comment: http://stackoverflow.com/comment/38770766
has body: Take a look into console and observe that AngularJS tries to load templates from /partials/index then from /dashboard/partials/index Solution set templateUrl path as /dashboard/partials/index in config section. Reason: angular-route.js templateUrl = $sce.getTrustedResourceUrl(templateUrl); if (angular.isDefined(templateUrl)) { next.loadedTemplateUrl = templateUrl; template = $http.get(templateUrl, {cache: $templateCache}). then(function(response) { return response.data; }); } There is no concatenation templateUrl with route path – just load tempalteUrl from Angular root of application.
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38771357
has comment: http://stackoverflow.com/comment/38770887
has comment: http://stackoverflow.com/comment/38770246
type: Answer
has comment: http://stackoverflow.com/comment/38770410
has comment: http://stackoverflow.com/comment/38770834

http://stackoverflow.com/q/24983620
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38839450
tagged with: css
has comment: http://stackoverflow.com/comment/38839853
has answer: http://stackoverflow.com/a/24983740
answer count: 4
favorite count: 0
has comment: http://stackoverflow.com/comment/38839626
has answer: http://stackoverflow.com/a/24983725
type: UnansweredQuestion
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38839596
has answer: http://stackoverflow.com/a/24983804
type: Question
has title: Target only one element with jQuery
has comment: http://stackoverflow.com/comment/38839456
tagged with: javascript
tagged with: jquery
score: 0
has body: I have this little problem with my code, and I though guys at Stack Overflow might know how to solve this. So here's the scenario: I need to append strong inside p into another element which will be post caption. I have been able to create solution this, but I'm having problem. Photo caption duplicates into other same named elements, which I don't want to happen. So post may have photo caption, but not always, but it still needs to work. HTML Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ornare erat sit amet nulla faucibus pharetra. Donec in mauris lorem. Pellentesque egestas aliquet lobortis. Praesent molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ornare erat sit amet nulla faucibus pharetra. Donec in mauris lorem. Pellentesque egestas aliquet lobortis. Praesent molestie. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut ornare erat sit amet nulla faucibus pharetra. Donec in mauris lorem. Pellentesque egestas aliquet lobortis. Praesent molestie. This is a caption. JS var $caption = $(".post strong:first-child").text(); var $removable = $(".post strong:first-child"); $(".post strong:first-child").parent().remove(); $removable.remove(); $(".post").append(" " + $caption + " "); Here's Codepen snippet: http://codepen.io/aleksitappura/pen/auvrE I'll appreciate all of your help.
has answer: http://stackoverflow.com/a/24983729

http://stackoverflow.com/comment/38981352
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25054366
score: 0
has text: As a start, is it possible to try with the latest release? `//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js`

http://stackoverflow.com/q/24924428
answer count: 1
has body: The site has a problem on showing pictures in an iphone device, replicated this issue with the browser by minimizing it horizontally. Here is the link showing the problem. My manual fix is that i zoom out the browser(ctrl+-), here a link for the demo. Is there anyway that this can be tackled with html, css or javascript/jquery. I already have a responsive tag for the pages: This is the html for the image div: <a href="customize/fabric/<?php echo $x['hash'];?>/<?php echo $_SESSION['customize_mode'];?>"> <img data-src="<?php echo ap($x['thumb']);?>" class="lazy img-responsive" src="<?php echo $conf->bg;?>"> <a href="customize/option_item/<?php echo $x['id'];?>"><?php echo $x['name']?> <h4 data-option-group="<?php echo $x['option_group_hash'];?>" data-toggle="tooltip" data-placement="top" title="" data-original-title="<?php echo $data_original_title;?>" id="wishlist-<?php echo $x['id']?>" class="wishlist-button pull-right"> <span class="glyphicon <?php echo $glyphicon;?>"> <a href="customize/option_item/<?php echo $x['id'];?>" class="btn btn-declothe-gray btn-xs">Details Click here for the link of the page
has title: Some pictures not displaying on iphone layout
type: UnansweredQuestion
tagged with: php
tagged with: css
has answer: http://stackoverflow.com/a/24925665
has comment: http://stackoverflow.com/comment/38730030
has comment: http://stackoverflow.com/comment/38728506
type: Question
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38757310
type: Comment
comment on: http://stackoverflow.com/a/24939704
type: AnswerComment
score: 0
has text: Indeed, this doesn't seem to be working for me either. I'm using the latest Firefox. Here is what actually seems to be happening: If I click on the word "beautiful" itself, then for a split second, the entire word is selected, then it is no longer selected. If I click anywhere else in the box, then nothing special happens.

http://stackoverflow.com/comment/38967856
has text: Every time someone loaded the page, the server would tell the client how much time there was left on the item. Then, the client would display a toner which would decrement every second or whatever, and would maybe check every so often to synchronize itself with the server. When the button was clicked, a query would be sent to the server, the server would then check it's own current time against the closing time in the database, and if it was valid, would but the item or whatever.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25051212
score: 0

http://stackoverflow.com/comment/38724214
has text: @Exception which code are you talking about? The code at that pastie.org link?
comment on: http://stackoverflow.com/a/24921703
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38876346
type: QuestionComment
has text: I believe that this answer i wrote will suit you. http://stackoverflow.com/a/22970430/2589202
score: 0
comment on: http://stackoverflow.com/q/25003064
type: Comment

http://stackoverflow.com/q/24941368
tagged with: javascript
has comment: http://stackoverflow.com/comment/38762855
score: 0
tagged with: templates
has comment: http://stackoverflow.com/comment/38760662
tagged with: angularjs
type: UnansweredQuestion
has title: Refactoring templates in angular js
answer count: 0
has body: I have a problem of big amount of bad readable html in my angular templates. The first idea what I have is to move validation messages from templates. What approaches do you use to handle this problems? Here is example of my template with bad smell: New word Word Invalid: Word is required. Invalid: Word is already taken. Translation Translation name is required Speech part is required remove Add translation Phrasal verbs Phrasal verb name is required remove Add phrasal verb Create word
type: Question
has comment: http://stackoverflow.com/comment/38762072
has comment: http://stackoverflow.com/comment/38760372

http://stackoverflow.com/comment/38833739
comment on: http://stackoverflow.com/a/24980541
type: AnswerComment
has text: Thanks A lot this was save the problem!why,can you explain shortly please
score: 0
type: Comment

http://stackoverflow.com/a/24912260
answers question: http://stackoverflow.com/q/24911860
type: Answer
has body: When adding elements dynamically to the DOM, they are not accessible by jQuery like an element which was there at page load. say you have this div: &lt;div id="div"&gt;&lt;/div&gt; and you add some content with jQuery so it now looks like this: &lt;div id="div"&gt;&lt;span id="span"&gt;&lt;/span&gt;&lt;/div&gt; you cannot refer directly to the span using jQuery with $('span[id=span]'), you have to target a containing element then filter which contained element you want: $('#id').on('click','span',function(){});
score: 0

http://stackoverflow.com/a/24932510
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38743104
has body: You can use a recursive function like the following. There is no normalisation, you may wish to remove excess whitespace and insert spaces between the text from each element. // Get the text within an element // Doesn't do any normalising, returns a string // of text as found. function getTextRecursive(element) { var text = []; var el, els = element.childNodes; for (var i=0, iLen=els.length; i&lt;iLen; i++) { el = els[i]; // May need to add other node types here that you don't want the text of // Exclude script element content if (el.nodeType == 1 &amp;&amp; el.tagName &amp;&amp; el.tagName.toLowerCase() != 'script') { text.push(getTextRecursive(el)); // If working with XML, add nodeType 4 to get text from CDATA nodes } else if (el.nodeType == 3) { // Deal with extra whitespace and returns in text here if required text.push(el.data); } } // Insert a space between each text string and return // a single string return text.join(' '); }
upvote count: 1
answers question: http://stackoverflow.com/q/24932325

http://stackoverflow.com/comment/38873823
comment on: http://stackoverflow.com/a/25000491
has text: I don't mean to sound rude, but you should be wary that what works isn't necessarily the best way. :x
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/a/25020467
type: Answer
has comment: http://stackoverflow.com/comment/38909141
downvote count: 0
score: 3
has comment: http://stackoverflow.com/comment/38909127
has body: matches = "Hey @user, have you heard from @user2?".match(/(@\w+)/g)
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25020354
has comment: http://stackoverflow.com/comment/38909321
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25020354

http://stackoverflow.com/a/25035589
answers question: http://stackoverflow.com/q/25035011
has comment: http://stackoverflow.com/comment/38938168
has comment: http://stackoverflow.com/comment/72912575
has body: Immediately-executed functions are essentially just a means of avoiding polluting the global scope with variables that should be private. Your approach is fine, but what if you want your library to internally reference private data that should not be part of your public API? Example: var Some_class = (function() { var foobar = 'foo'; //private; library can read it but public API can't var api = function() { /* constructor */ }; api.prototype.method = function() { return foobar == 'foo' ? 1 : 0; } return api; })(); var instance = new Some_class(); instance.method(); foobar is a private (i.e. internal) variable for use BY your library, but not publicly accessible via its API.
has comment: http://stackoverflow.com/comment/38939643
has comment: http://stackoverflow.com/comment/72918373
has comment: http://stackoverflow.com/comment/38938849
type: AcceptedAnswer
downvote count: 0
upvote count: 2
type: Answer
score: 2
accepted answer of: http://stackoverflow.com/q/25035011
has comment: http://stackoverflow.com/comment/38938371

http://stackoverflow.com/q/25039187
has comment: http://stackoverflow.com/comment/38943992
has title: How can I link a JavaScript command to a form button in php? ( )
favorite count: 0
has comment: http://stackoverflow.com/comment/38944115
type: UnansweredQuestion
downvote count: 2
tagged with: php
has comment: http://stackoverflow.com/comment/38943944
score: -2
has comment: http://stackoverflow.com/comment/38944025
type: Question
has comment: http://stackoverflow.com/comment/38943999
has answer: http://stackoverflow.com/a/25039708
upvote count: 0
has body: I have a footer banner on a website that I manage and when I click hide or hide forever it called the following javascript to hide or hide forever the banner: /** * Main JS File * * @author Your Inspiration Themes * @package YITH Footer Banner * @version 1.0.3 */ jQuery(document).ready(function($) { if($.cookie(templateDir) == '1') { $(".fbanner").hide(); } $("#showhidefbanner a").on('click',function(event){ event.preventDefault(); $('.fbanner').hide(); }); $("#showhideforever").on('click',function(event){ event.preventDefault(); $(".fbanner").hide(); $.cookie(templateDir, '1',{ expires: 365, path: '/' }); }); }); Until here everything ok. The problem is that when someone send the form the banner the banner keeps appearing. Therefore I want to called this javascript to never show this banner again. Here is my php code: <?php /** * Footer Banner page * * @author Your Inspiration Themes * @package YITH Footer Banner * @version 1.0.0 */ ;?> <?php if (get_option('yith_fbanner_link')):?><a href="<?php echo get_option('yith_fbanner_link');?>" title="<?php echo get_option('yith_fbanner_message');?>"><?php endif;?> <img src="<?php echo get_option('yith_fbanner_image');?>" alt="<?php echo get_option('yith_fbanner_message');?>"/> <?php if (get_option('yith_fbanner_link')):?><?php endif;?> <?php if (get_option('yith_fbanner_link')):?><a href="<?php echo get_option('yith_fbanner_link');?>" title="<?php echo get_option('yith_fbanner_message');?>"><?php endif;?> <?php echo get_option('yith_fbanner_message');?> <?php if (get_option('yith_fbanner_link')):?><?php endif;?> <?php if (get_option('yith_fbanner_link')):?><a href="<?php echo get_option('yith_fbanner_link');?>" title="<?php echo get_option('yith_fbanner_message');?>"><?php endif;?> <?php echo get_option('yith_fbanner_sub_message');?> <?php if (get_option('yith_fbanner_link')):?><?php endif;?> <?php if ( get_option('yith_fbanner_enable_newsletter_form') == true ): ?> <form method="<?php echo get_option('yith_fbanner_newslet…
answer count: 1
tagged with: javascript

http://stackoverflow.com/comment/38900581
has text: So, you don't use the `$output` array from `exec` anymore, but the `exec` return value? Do you write the filename as the `die` message? You can just as easily write the filename of the `myDetails` block. On second thought, your `waitForResource` is completely wrong. Have you tested it in plain casper? There cannot be a resource with spaces and the passed functions also don't make sense. Please consult the [documentation](http://docs.casperjs.org/en/latest/modules/casper.html#waitforresource).
type: AnswerComment
comment on: http://stackoverflow.com/a/25001775
score: 0
type: Comment

http://stackoverflow.com/a/24970238
accepted answer of: http://stackoverflow.com/q/24970076
type: Answer
has body: Your counts array appears to be a list of unique strings and values associated with them. Use an object instead, keyed on the unique strings, e.g.: var counts = { gfdg: 34243, jhfj: 543554, ... }; This will massively improve the performance by removing the need for the O(n) inner loop by replacing it with an O(1) object key lookup. Also, avoid divisions - log(1 / n) = -log(n) - and move loop invariants outside the loops. Your log(1/len) * Math.LOG10E is actually a constant added in every pass, except that in the first if branch you also need to factor in Math.log(replace), which in log math means adding it. p.s. avoid using the outer scoped state variables for the score, too! I think the below replicates your scoring algorithm correctly: var len = Object.keys(counts).length; function score(text) { var result = 0; var factor = -Math.log(len) * Math.LOG10E; for (var x = 0, n = text.length - 4; x &lt; n; ++x) { var qgram = text.substring(x, x + 4); var replace = counts[qgram]; if (replace) { result += Math.log(replace) + factor; } else { result += len * factor; // once for each ngram } } return result; }
upvote count: 3
has comment: http://stackoverflow.com/comment/56631347
score: 3
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24970076
has comment: http://stackoverflow.com/comment/38814240
has comment: http://stackoverflow.com/comment/56579915
downvote count: 0
has comment: http://stackoverflow.com/comment/38814233

http://stackoverflow.com/a/24930291
has body: Also remember that textarea doesn't have value attribute as you can read in http://www.w3schools.com/tags/tag_textarea.asp Value is a property so the statment you are using is correct for putting text in the text area input.value = "text"; But remember that creating and changing a value attribute doesn't change value property.
type: Answer
score: 1
answers question: http://stackoverflow.com/q/24930105
upvote count: 1
downvote count: 0

css-sprites
type: Tag
tags question: http://stackoverflow.com/q/25037822
tags question: http://stackoverflow.com/q/24982898
tag name: css-sprites

http://stackoverflow.com/comment/38848445
comment on: http://stackoverflow.com/q/24988231
has text: and li dont't have a src attribute
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24963251
has title: Trigger Javascript for a Server side Checkbox
has body: I have a situation where i am performing some server action the click of the checkbox and then redirecting the user to another page. But the problem is, After i click the checkbox, it is taking time to redirect as it is slightly slow and hence the users are able to click on other checkboxes. I want to either disable the whole page or disable all the Check boxes. I wrote a javascript but it gets triggered only when the page is loaded again. My Html : &lt;div&gt; &lt;asp:CheckBox ID="checkbox1" runat="server" OnCheckedChanged="checkbox1_CheckedChanged" AutoPostBack="true" CssClass="chk-facet-checkbox"/&gt; &lt;asp:CheckBox ID="checkbox2" runat="server" OnCheckedChanged="checkbox2_CheckedChanged" AutoPostBack="true" CssClass="chk-facet-checkbox"/&gt; &lt;asp:CheckBox ID="checkbox3" runat="server" OnCheckedChanged="checkbox3_CheckedChanged" AutoPostBack="true" CssClass="chk-facet-checkbox"/&gt; &lt;/div&gt; &lt;div id='blockerdiv'&gt; &lt;/div&gt; My Jquery : if ($(".chk-facet-checkbox").is(":checked")) { $('.blockerdiv').show(); //Code to show the 'blockerdiv' as an overlay blocking the whole page // All we need to do is show the blockerdiv. There is already Code to take care of the overlay }
type: Question
answer count: 2
tagged with: .net
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24963483
has comment: http://stackoverflow.com/comment/38801428
has answer: http://stackoverflow.com/a/24963342

http://stackoverflow.com/comment/125170268
type: AnswerComment
score: 0
type: Comment
has text: If the answer doesn't make sense at all why not delete it?
comment on: http://stackoverflow.com/a/24964953

http://stackoverflow.com/a/24963453
has comment: http://stackoverflow.com/comment/38802151
accepted answer of: http://stackoverflow.com/q/24963285
has comment: http://stackoverflow.com/comment/38802556
has body: Your HTML is most likely being added after the handlers are bound - you can use .on to get around this: $(document).on("change", "select", function() { $('select').val( this.value ) }); You should replace document with a container that is present at the time of page load and contains your dynamic content - else this event is going to fire each time the document is changed (and check if a select was actually changed) With a common class: 111 222 111 222 $(document).on("change", "select.common", function() { $("select.common").not(this).val( this.value ) //added .not(this) since we dont need to change the value of the select being interacted with });
type: AcceptedAnswer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38802438
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38801875
has comment: http://stackoverflow.com/comment/38801854
has comment: http://stackoverflow.com/comment/38801982
has comment: http://stackoverflow.com/comment/38803428
answers question: http://stackoverflow.com/q/24963285

http://stackoverflow.com/q/25010008
answer count: 3
has answer: http://stackoverflow.com/a/25010267
has answer: http://stackoverflow.com/a/25010251
downvote count: 1
favorite count: 0
has title: Click HTML element without Id or Name with JavaScript in Android
type: UnansweredQuestion
tagged with: android
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38889202
has comment: http://stackoverflow.com/comment/38889296
upvote count: 0
type: Question
has answer: http://stackoverflow.com/a/25010217
tagged with: href
tagged with: javascript
score: -1
has body: I'm new programming with JavaScript, I'm making and app to Loggin automatically in the Web of my University and get some data. In JavaScript for change a value or make and action I first need to find the element in the HTTP code with: document.getElementsByName or document.getElementById But if I have this piece of HTML code with no Id or name: ALUMNOS How can I get the href, or click them, or click the item that contains it?

http://stackoverflow.com/a/24977839
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: This is untested, but I see two things wrong here: You should call setWebViewClient with your WebViewClient implementation before you call loadUrl. However, loadUrl is asynchronous, so it probably would not make a difference, but this is worth a try I think. You are not calling super.onPageFinished(view, url); in onPageFinshed. You should add this call. EDIT 2: I finally took a look at the actual page you are working with. The problem is that the page loads content in a different frame, so you actually have to make the getElementsByName call on a different document. The frame in which both of the inputs you want are located has the name mainFrame in your page. So, you should write the javascript like this and load that into the WebView as you have done above: window.frames["mainFrame"].document. getElementsByName('p_codigo_c')[0].value = "user"; window.frames["mainFrame"].document. getElementsByName('p_clave_c')[0].value = "password";
answers question: http://stackoverflow.com/q/24977781
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24977781
has comment: http://stackoverflow.com/comment/38840568
has comment: http://stackoverflow.com/comment/38848506
has comment: http://stackoverflow.com/comment/38829004

http://stackoverflow.com/comment/38820742
score: 0
type: Comment
type: QuestionComment
has text: What is the element `yelp-rating`?
comment on: http://stackoverflow.com/q/24973569

http://stackoverflow.com/comment/38744067
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24932912
has text: yes using @Ajax.ActionLink() @Saranga
score: 0

http://stackoverflow.com/comment/38970657
type: Comment
comment on: http://stackoverflow.com/q/25041829
type: QuestionComment
has text: I read that, but really ? I juste can't ? Even if I forceY to 1 or yDomain to [1,XXX] ?
score: 0

http://stackoverflow.com/q/25021360
favorite count: 0
tagged with: cordova
linked to: http://stackoverflow.com/q/22294866
has comment: http://stackoverflow.com/comment/38912309
tagged with: android
tagged with: django
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25022373
type: Question
upvote count: 4
tagged with: csrf
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/38912652
has body: I want to deploy my mobile app, but before that I want to settle the csrf protection buisness. My app is a Cordiva app, and the server is a Django server. My app communicates with the server only with ajax. No static files are ever served. Right now, I simply make a GET request to the browser to get the csrf-string. Is that a normal way to do this? On StackOverflow, there's a post: CSRF Token in Phonegap using AJAX that shows how to set the cookie but it doesnt apply to me as my static pages arent served by the browser. They're on the mobile phone's memory. On wikipedia, there's an example using CORS: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing. They specifically say that the browser will send Origin: http://www.example-mysite.com to the server. But what will the mobile device send? It has no domain-name. So again, how can I use csrf_protection on the phone? Can I simply make a method on my server that will send a csrf-string to anyone that asks for it? I'm not sure that that's the way I should do it. Please, if you've been on this road before, let me know what are the typical solutions? Thanks in advance for your kind help and concern. Jenia.
accepted answer: http://stackoverflow.com/a/25022373
has title: csrf protection on mobile devices ( running in cordova)
answer count: 1
downvote count: 0

http://stackoverflow.com/a/72592730
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/128390386
has body: V8 developer here. The accepted answer is a great explanation, I just wanted to highlight one thing: the so-called "fast" and "slow" property modes are unfortunate misnomers, they each have their pros and cons. Here is a (slightly simplified) overview of the performance of various operations: struct-like properties dictionary properties adding a property to an object -- + deleting a property --- + reading/writing a property, first time - + reading/writing, cached, monomorphic +++ + reading/writing, cached, few shapes ++ + reading/writing, cached, many shapes -- + colloquial name "fast" "slow" So as you can see, dictionary properties are actually faster for most of the lines in this table, because they don't care what you do, they just handle everything with solid (though not record-breaking) performance. Struct-like properties are blazing fast for one particular situation (reading/writing the values of existing properties, where every individual place in the code only sees very few distinct object shapes), but the price they pay for that is that all other operations, in particular those that add or remove properties, become much slower. It just so happens that the special case where struct-like properties have their big advantage (+++) is particularly frequent and really important for many apps' performance, which is why they acquired the "fast" moniker. But it's important to realize that when you delete properties and V8 switches the affected objects to dictionary mode, then it isn't being dumb or trying to be annoying: rather it attempts to give you the best possible performance for what you're doing. We have landed patches in the past that have achieved significant performance improvements by making more objects go to dictionary ("slow") mode sooner when appropriate. Now, it can happen that your objects would generally benefit from struct-like properties, but something your code does causes V8 to transition them to dictionary properties, and you'd like to undo th…
downvote count: 0
answers question: http://stackoverflow.com/q/24987896
type: Answer
has comment: http://stackoverflow.com/comment/128383083

http://stackoverflow.com/comment/38912087
type: Comment
comment on: http://stackoverflow.com/a/25021877
type: AnswerComment
score: 0
has text: @Fustigador Honestly, I didn't find a way to make "/*" work, if you found one, please tell me too. You can define a variable for the fixed prefix, then add the variable as prefix, thus in case you need to change the prefix, you only need to change 1 variable. The same for the suffix approch, you add a variable for the suffix, then you can change it if need.

http://stackoverflow.com/comment/39061209
has text: I was thinking the same calculating the appropriate `martin-top` but I feel like it would be smarter for you to have it so that a `div` with `display:none` is on top and every time you hover on different menu... it shows with different text depending on the menu item... Anyways.. I will try my luck with calculating the `margin-top`
type: Comment
comment on: http://stackoverflow.com/a/25098828
score: 0
type: AnswerComment

http://stackoverflow.com/a/24999959
type: Answer
accepted answer of: http://stackoverflow.com/q/24999922
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24999922
has body: Use this: var thisPlaceX = $( this ).html();
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/comment/38885790
comment on: http://stackoverflow.com/q/24984237
has text: Thanks! I'll take a look at links you provided
type: Comment
type: QuestionComment
score: 0

http://stackoverflow.com/a/36702064
type: Answer
upvote count: 2
has comment: http://stackoverflow.com/comment/107853114
downvote count: 1
score: 1
has body: I know it's almost two years ago. This function is reusable. String.prototype isn't necessary to make it work.. But it's easy.. String.prototype.splitEvery = function ( splitter, every ){ var array = this.split( splitter), newString = '', thisSplitter; $.each( array, function( index, elem ){ thisSplitter = ( index &lt; array.length - 1 || index % every === 0 ) ? '' : splitter; newString += elem + thisSplitter; }); return newString; }; var dateString = '29 July, 2014, 30 July, 2014, 31 July, 2014'; The usage in this case is: dateString.splitEvery( ',', 2 ); First parameter is the split, second is how many is between each. Result are: 29 July 2014, 30 July 2014, 31 July 2014
answers question: http://stackoverflow.com/q/24930243

http://stackoverflow.com/comment/40094550
comment on: http://stackoverflow.com/q/25042599
score: 0
type: Comment
type: QuestionComment
has text: Although this doesn't help, I'm facing the same exact issue here. I even tried wrapping `loggedIn` in a property and using that in the view: `isChecked: false, checkedValue: function(){ return isChecked; }.property('isChecked'),` and this doesn't work OOTB. The value is indeed updated when calling this.set from the action, but the template is not updated

http://stackoverflow.com/a/24935102
upvote count: 1
type: AcceptedAnswer
downvote count: 0
score: 1
has body: Take a look at https://angularjs.org/ It uses a very similar syntax to what you provided Name: Hello {{yourName}}! And has some extra features regarding templating you might find useful.
type: Answer
accepted answer of: http://stackoverflow.com/q/24934989
answers question: http://stackoverflow.com/q/24934989

http://stackoverflow.com/a/24995196
score: 22
upvote count: 22
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38886839
accepted answer of: http://stackoverflow.com/q/24995072
answers question: http://stackoverflow.com/q/24995072
type: Answer
has comment: http://stackoverflow.com/comment/38887428
has body: I find it easier to use actual promises for mocked services as it removes a lot of nested functions and is a lot easier to read. Relevant snippets ($q needs to be injected in beforeEach): deferred = $q.defer(); spyOn(login, 'login').andReturn(deferred.promise); ... deferred.reject({ ... }); After resolving or rejecting the promise you need to call scope.$digest() so angular can process it.
has comment: http://stackoverflow.com/comment/43885728

http://stackoverflow.com/q/24956704
tagged with: jquery
has comment: http://stackoverflow.com/comment/38789194
has comment: http://stackoverflow.com/comment/38788598
has comment: http://stackoverflow.com/comment/38789048
has comment: http://stackoverflow.com/comment/38788892
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38789468
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38790743
has comment: http://stackoverflow.com/comment/38792043
has comment: http://stackoverflow.com/comment/38790119
has comment: http://stackoverflow.com/comment/38788717
type: Question
has answer: http://stackoverflow.com/a/24956794
has title: How do detect current page to add an active class to corresponding menu button
tagged with: javascript
score: 0
has body: I am trying to figure out how to detect what page I am on so I can add a selected class to my html with Jquery. I have tried a few bits of script but they have not worked. I am working on a local server and for now just need something that can somehow detect the page I am on and somehow link it to the li's. I'm not sure how to tackle it HTML: Access Fader Layout Patching Wild Controls Buses & Outputs Contribution I AM BACK BUTTON for contribti test test Oscillator Talkback Meters Automixer Audio Follow Video test-page Back to Main Menu IwhatN IwhatN Control Surface Back to Main Menu IwhatN IwhatN
linked to: http://stackoverflow.com/q/901115
answer count: 1

http://stackoverflow.com/q/25015316
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/32908504
type: Question
upvote count: 4
answer count: 2
favorite count: 0
tagged with: loopbackjs
has body: How do I prevent the creation of new users by unauthenticated users in LoopBack 2.0? I've just made a quick test on a brand new LoopBack install and it looks like any anonymous user can create new users by simply sending a POST request to /api/users. Data: {"email": "test@test.com", "password": "hello123"} Response Code: 200 Response Body: { "email": "test@test.com", "id": 2 } Apart from this issue, are there any other security issues similar to this that I should take care of?
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/27051128
downvote count: 1
has title: How do I prevent the creation of new users by unauthenticated users in LoopBack 2.0?

http://stackoverflow.com/comment/38842905
score: 0
has text: Isn't it because you didn't put the controller code inside your actual controller `MainCtrl` ? Or is it intended to have it in the directive ? If `deleteNote` works, but not `updateNote`, that's probably where it's coming from.
comment on: http://stackoverflow.com/q/24985077
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38952050
comment on: http://stackoverflow.com/q/25042958
score: 0
type: Comment
type: QuestionComment
has text: Must be some kind of configuration problem on your local machine. What does the error message say when you run it locally?

http://stackoverflow.com/q/25067173
has answer: http://stackoverflow.com/a/25067214
has title: Send two arrays or array with variable via ajax
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25067230
favorite count: 0
tagged with: ajax
has body: I have some code that work, but I need to add some variable to the data sent by ajax. I know, I can put this variable in the array sended, but it's no good for me. I want to add +'&amp;count='+'second' Maybe I can send second array, but how? var arr = new Array(1,2,3,4); $.ajax({ type: 'POST', url: baseUrl + "search/simple_filter", data: {arr: arr}+'&amp;count='+'second', success: function (data) { if (!data) console.log(data); } });
answer count: 4
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25067214
upvote count: 2
accepted answer: http://stackoverflow.com/a/25067265
type: Question
has answer: http://stackoverflow.com/a/25067265
has answer: http://stackoverflow.com/a/25067235

http://stackoverflow.com/q/25001114
has body: hey there i have the following code that sets and scales the background image in the body tag... html,body { margin:0; padding:0; height:100%; background-image:url(some image); background-size:100% 100%; -webkit-background-size:100% 100%; /* Safari */ -khtml-background-size:100% 100%; /* Konqueror */ -moz-background-size:100% 100%; /* Firefox */ background-repeat:no-repeat; background-attachment:fixed; overflow:hidden; } what i want to do is display an alert when the image in the body finishes loading or maybe when the whole page finishes loading.. however, i've found this fiddle and this stackoverflow question on the net but it doesn't seen to fit my situation. thanks.
tagged with: javascript
tagged with: jquery
score: 0
has answer: http://stackoverflow.com/a/25001436
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/5057990
has title: display an alert when body background image has finished loading
has answer: http://stackoverflow.com/a/25001247
has answer: http://stackoverflow.com/a/25001307
tagged with: css
answer count: 4
has comment: http://stackoverflow.com/comment/38872192
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6024843
has answer: http://stackoverflow.com/a/25001297
has comment: http://stackoverflow.com/comment/38872405
type: Question
accepted answer: http://stackoverflow.com/a/25001247
possible better answer: http://stackoverflow.com/a/25001297

http://stackoverflow.com/a/25361460
has body: You should clear you concept !!!! it does not matters if one or more than one argument. img.src = url try to add image url after imag.onload
score: 1
accepted answer of: http://stackoverflow.com/q/24962655
answers question: http://stackoverflow.com/q/24962655
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/comment/38882444
comment on: http://stackoverflow.com/q/25005999
has text: How would you know that it was malicious? lol
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/25001610
has answer: http://stackoverflow.com/a/25002171
tagged with: twitter-bootstrap
has title: Modal Form Submission without refresh
type: Question
type: AnsweredQuestion
score: 3
has answer: http://stackoverflow.com/a/25001703
accepted answer: http://stackoverflow.com/a/25001703
answer count: 3
possible better answer: http://stackoverflow.com/a/25002171
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I have a modal window that pops up when I want to add a new project to my dashboard. I have gotten it to work with jquery post however, I cannot prevent it from refreshing. What I want to do is after the project is added to the database, show a success message and close the modal window after few seconds and not refresh the page (parent page of modal). Here is my modal &lt;div class="modal fade" id="add-project-dialog" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;amp;times;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Add a new Project&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;h3&gt;New Project:&lt;/h3&gt; &lt;form class="form-horizontal" id="add-project-form" action="/projects/add" method="POST"&gt; &lt;fieldset&gt; &lt;!-- Text input--&gt; &lt;div class="form-group"&gt; &lt;label class="col-md-4 control-label" for="name"&gt;Project Name&lt;/label&gt; &lt;div class="col-md-4"&gt; &lt;input id="name" name="name" type="text" placeholder="" class="form-control input-md"&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Text input--&gt; &lt;div class="form-group"&gt; &lt;label class="col-md-4 control-label" for="description"&gt;Project Description&lt;/label&gt; &lt;div class="col-md-4"&gt; &lt;input id="description" name="description" type="text" placeholder="" class="form-control input-md"&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Text input--&gt; &lt;div class="form-group"&gt; &lt;label class="col-md-4 control-label" for="project_state"&gt;Project State&lt;/label&gt; &lt;div class="col-md-4"&gt; &lt;input id="project_state" name="project_state" type="text" placeholder="" class="form-control input-md"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/fieldset&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" da…
favorite count: 0
upvote count: 3
tagged with: google-app-engine
tagged with: python
linked to: http://stackoverflow.com/q/1357118
has answer: http://stackoverflow.com/a/38462127

http://stackoverflow.com/a/24962410
answers question: http://stackoverflow.com/q/24943149
type: AcceptedAnswer
has body: I figured out that you can grab the DOM element and set it to, in this case, Current or Previous and it is smart enough not to add another option to your select list. Turns out I didn't have to deal with Perl at all. Onkeydown in an text element I wanted it to default the select, my JS looks like function defaultCurrent(&lt;DOMelement.name&gt;) { if (&lt;DOMelement.name&gt; == "&lt;specific status as first&gt;") { var element = document.querySelector("#&lt;selectElementID&gt;"); if (element.value == "") element.value = "Current"; } else { &lt;some not-first logic&gt; var element = document.querySelector("#&lt;selectElementID&gt;"); if (element.value == "") element.value = "Previous"; } } where if there is no option selected ("Pick One" = null) then it defaults to the appropriate status. Moral of the story is, you could do this when you have a traditional &lt;select&gt; &lt;option&gt;&lt;/option&gt; &lt;option&gt;&lt;/option&gt; &lt;/select&gt; list too, if it were needed.
type: Answer
accepted answer of: http://stackoverflow.com/q/24943149
score: 0

http://stackoverflow.com/a/24913389
type: Answer
downvote count: 0
has body: This can be achieved without array, by using loop only ones. $(document).ready(function () { var counter; var result; for (counter = 0; counter &lt; 1001; counter++) { if (counter % 3 == 0 || counter % 5 == 0) { result+=counter; } console.log(result); }
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24913272

http://stackoverflow.com/a/24918301
has body: $index is simply going through the items in the loop. It is not aware of the reversal. You could have an "id" element in queries, such as: var queries = [ { title: "Query type A", body: "Response of query type A", id:1 }, { title: "Query type B", body: "Response of query type B", id:2 }, { title: "Query type C", body: "Response of query type C", id:3 } ]; and use Submission: {{query.id}} instead of Submission: {{$index}} .
score: 1
has comment: http://stackoverflow.com/comment/38717214
type: AcceptedAnswer
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38717084
answers question: http://stackoverflow.com/q/24918209
has comment: http://stackoverflow.com/comment/38717125
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24918209

http://stackoverflow.com/comment/38843685
type: AnswerComment
comment on: http://stackoverflow.com/a/24984898
has text: Yes, I`m sorry about this, but as far as I know, there is not really an answer :( but you are right, I should have comment it.
type: Comment
score: 0

http://stackoverflow.com/a/24978339
has comment: http://stackoverflow.com/comment/38850223
answers question: http://stackoverflow.com/q/24978218
has comment: http://stackoverflow.com/comment/38840715
has comment: http://stackoverflow.com/comment/38843549
has comment: http://stackoverflow.com/comment/38840952
has body: The file name you are using in the code is "accounts", not "accounts.txt". Also, I don't see a button being defined. After fixing the path name Now the Scanner complains (in line 54) that next() is called although there is no next token to be scanned. Normally, one calls `hasNext()? and proceeds only if this returns true. However, the idea of writing a file and reading from it before writing has been completed (i.e., close() has been called) is a no-no. I'm not sure what you want to achieve with your code, so I can't really suggest an improvement.
score: 0
type: Answer

http://stackoverflow.com/a/24978688
has body: From what I see reading through the code on his github, this function is not used or needed. It could have been an old function that was used and never removed from the code, or is there for testing / debugging to troubleshoot things if it's not working as intended.
has comment: http://stackoverflow.com/comment/38830278
downvote count: 1
answers question: http://stackoverflow.com/q/24978560
upvote count: 0
score: -1
accepted answer of: http://stackoverflow.com/q/24978560
has comment: http://stackoverflow.com/comment/38830163
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38830218
type: Answer

http://stackoverflow.com/comment/38987881
has text: i don't know about that but cross domain will not work with json you have to use jsonp
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25062135
score: 0

http://stackoverflow.com/comment/38722422
type: Comment
comment on: http://stackoverflow.com/a/24920566
has text: :D :D its what blagoh used so i was just catering to him :P i felt bad for confusing the fellow :P
type: AnswerComment
score: 0

http://stackoverflow.com/q/24944738
type: AnsweredQuestion
has title: Javascript variable names in loop
tagged with: javascript
has body: I have a function that creates 6 html input boxes to store my score values, 1 of the boxes being the total score. var hole1 = prompt("Enter Hole 1 score:"); var hole2 = prompt("Enter Hole 2 score:"); var hole3 = prompt("Enter Hole 3 score:"); var hole4 = prompt("Enter Hole 4 score:"); var hole5 = prompt("Enter Hole 5 score:"); The whole function of addScore(): function addScore() { var ni = document.getElementById('myDiv'); var numi = document.getElementById('theValue'); var num = (document.getElementById('theValue').value -1)+ 2; numi.value = num; var newdiv = document.createElement('div'); var divIdName = 'my'+num+'Div'; newdiv.setAttribute('id',divIdName); // Prompts user for their score var hole1 = prompt("Enter Hole 1 score:"); var hole2 = prompt("Enter Hole 2 score:"); var hole3 = prompt("Enter Hole 3 score:"); var hole4 = prompt("Enter Hole 4 score:"); var hole5 = prompt("Enter Hole 5 score:"); // Make the boxes for index.html to be displayed var makeScoreBoxes =' ' newdiv.innerHTML = makeScoreBoxes; ni.appendChild(newdiv); // Adds up all scores entered via hole totalScore = parseInt(parseFloat(hole1) + parseFloat(hole2) + parseFloat(hole3) + parseFloat(hole4) + parseFloat(hole5)); // Places output of each data value from totalScore into input boxes in index.html addTotal = document.getElementById('totalScore').value=totalScore; addhole1 = document.getElementById('hole1').value=hole1; // takes prompt number entered in all hole* variables addhole2 = document.getElementById('hole2').value=hole2; addhole3 = document.getElementById('hole3').value=hole3; addhole4 = document.getElementById('hole4').value=hole4; addhole5 = document.getElementById('hole5').value=hole5; } // Adds up all scores entered via hole totalScore = parseInt(parseFloat(hole1) + parseFloat(hole2) + parseFloat(hole3) + parseFloat(hole4) + parseFloat(hole5)); And it is called here in index.html: Add score How do I generate unique variable names for the hole prompt values ( hole1, hole2, hole3, hol…
has comment: http://stackoverflow.com/comment/38767074
has comment: http://stackoverflow.com/comment/38768750
type: Question
score: 0
has answer: http://stackoverflow.com/a/24944851
has comment: http://stackoverflow.com/comment/38768329
has comment: http://stackoverflow.com/comment/38766992
answer count: 1
tagged with: variables
accepted answer: http://stackoverflow.com/a/24944851
has comment: http://stackoverflow.com/comment/38772579
has comment: http://stackoverflow.com/comment/38766975
has comment: http://stackoverflow.com/comment/38767154

http://stackoverflow.com/comment/38827933
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24977499
has text: @JaredFarrish - If you look closely at the documentation, you would find that there is no mention of `class` anywhere. As I said in my comment, there are only a Number [object] wrapper and a Number primitive.
score: 0

http://stackoverflow.com/a/24936046
answers question: http://stackoverflow.com/q/24935997
has comment: http://stackoverflow.com/comment/38750264
has comment: http://stackoverflow.com/comment/38752747
has comment: http://stackoverflow.com/comment/38750555
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/38750322
accepted answer of: http://stackoverflow.com/q/24935997
upvote count: 3
has comment: http://stackoverflow.com/comment/38750001
has comment: http://stackoverflow.com/comment/38751765
has body: The reason extend doesn't override it is that it's not a prototype property. It's a property added to the instance by the constructor function, which shadows (hides) the prototype property. Here's the order of what occurs (note - I've fixed the syntax errors in the code in the question, and added an instantiation of the view model): // 1 - the `ViewModel` function is created, along with `ViewModel.prototype` var ViewModel = function () { // 4 - the instance gets its own `selectItem` property this.selectItem = function () { alert(1) }; }; // 2 - `selectItem` is added to `ViewModel.prototype` ko.utils.extend(ViewModel.prototype, { selectItem: function () { alert("from extend"); } }); // 3 - an instance is created; its underlying prototype is set from `ViewModel.prototype` var vm = new ViewModel();
has comment: http://stackoverflow.com/comment/38751703
has comment: http://stackoverflow.com/comment/38755232
has comment: http://stackoverflow.com/comment/38756362
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38750092

http://stackoverflow.com/comment/38982907
comment on: http://stackoverflow.com/q/25059685
score: 0
type: Comment
type: QuestionComment
has text: he have like a foreach with images that comes from the db and he want to put the image as a link to itself sorry for my english

http://stackoverflow.com/q/25028367
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/38924115
answer count: 1
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25028574
accepted answer: http://stackoverflow.com/a/25028574
has comment: http://stackoverflow.com/comment/38924250
tagged with: asp.net-mvc-4
has comment: http://stackoverflow.com/comment/38924125
type: AnsweredQuestion
has title: MVC 4 External Javascript not working
has comment: http://stackoverflow.com/comment/38924341
score: 1
has comment: http://stackoverflow.com/comment/38924190
type: Question
has body: I will made a sample code just to describe my problem, here is the code that I originally use on the view: @model MyProject.Web.UI.ViewModels.MyModel @{ ViewBag.Title = "Test"; } @section scripts{ &lt;script&gt; $(document).ready(function () { alert('Test'); }); ... more code here (removed for brevity) &lt;/script&gt; } This one is working well, but as a good practice, I need to move the javascript/jquery code to an external file so the above code turned into this: @model MyProject.Web.UI.ViewModels.MyModel @{ ViewBag.Title = "Test"; } @section scripts{ &lt;script src="/Js/external-js-file.js"&gt; &lt;/script&gt; } and in my external javascript/jquery file: $(document).ready(function () { alert('Test'); }); ... more code here (removed for brevity) and to my surprise, the alert wasn't even firing, all of the jquery and javascript code is suddenly not working, I've been googling a lot and I can't find any solution to this, am I missing something? Thanks in advance guys.
tagged with: javascript

http://stackoverflow.com/comment/38820618
score: 0
type: Comment
type: QuestionComment
has text: the cms generates a code which for some reason wraps the select with in table
comment on: http://stackoverflow.com/q/24973525

http://stackoverflow.com/comment/38763087
comment on: http://stackoverflow.com/q/24942624
has text: So linking to a Gist isn't acceptable?
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24945582
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38769287
has comment: http://stackoverflow.com/comment/38768658
score: 2
answer count: 1
tagged with: angularjs-ng-repeat
has answer: http://stackoverflow.com/a/24946320
favorite count: 0
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38768737
has body: I have a json defined in my scope like $scope.People = [ { "firstName":"John", "lastName":"Doe", "Choices":[ { "Name":"Dinner", "Options":[ { "Name":"Fish", "ID":1 }, { "Name":"Chicken", "ID":2 }, { "Name":"Beef", "ID":3 } ] }, { "Name":"Lunch", "Options":[ { "Name":"Macaroni", "ID":1 }, { "Name":"PB&J", "ID":2 }, { "Name":"Fish", "ID":3 } ] } ] }, { "firstName":"Jane", "lastName":"Doe" } ]; I have a search filter which search on the choices name and filter them. It is working fine. But I plan to display the number of results filtered (total results) outside all ng-repeat. Not sure how to get the scope of ng-repeat to its parent. Code Snippet: Not Working : I have {{results.length}} filtered results Working : I have {{results.length}} filtered results {{people.firstName}} {{ choice.Name }} {{choice.SelectedID}} Complete code @ http://plnkr.co/edit/ODW3lD?p=preview Appreciate your response.
type: AnsweredQuestion
has title: angularjs how to access ng-repeat filtered value outside its scope
upvote count: 3
accepted answer: http://stackoverflow.com/a/24946320
has comment: http://stackoverflow.com/comment/38769221
downvote count: 1

http://stackoverflow.com/comment/38996921
type: QuestionComment
has text: @Sammaye updated with more complete example.
comment on: http://stackoverflow.com/q/25040792
score: 0
type: Comment

http://stackoverflow.com/a/25053032
type: Answer
has body: $.ajax({ type: "GET", url: 'URL', jsonp: 'callback', dataType: 'jsonp', data: {}, success: loginSuccess, crossDomain: true, error: ajaxFailed, contentType: 'application/json', async: false }); function ajaxFailed(result) { alert("Failed: " + result.status + ' ' + result.statusText); } function loginSuccess(data) { alert('Result: ' + data.d); }
score: 3
downvote count: 0
answers question: http://stackoverflow.com/q/25052502
has comment: http://stackoverflow.com/comment/39008089
upvote count: 3

http://stackoverflow.com/a/25143767
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/25049462
upvote count: 2
has comment: http://stackoverflow.com/comment/39180429
has comment: http://stackoverflow.com/comment/43430418
type: Answer
has body: Are you looking for event.stopImmediatePropagation()?

http://stackoverflow.com/comment/38729564
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24924872
has text: @SpiderPig—there is no [*`__proto__`*](http://mdn.beonex.com/en/JavaScript/Reference/Global_Objects/Object/Proto.html).

http://stackoverflow.com/comment/38876450
comment on: http://stackoverflow.com/q/25003296
type: QuestionComment
type: Comment
has text: Why not just do an onload even on your send_from_email.php page to throw an alert/error on page load?
score: 0

http://stackoverflow.com/a/24982411
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38837370
score: 2
downvote count: 0
has body: You need to trigger input event programmatically using .trigger() $('.clearable').trigger('input'); DEMO
answers question: http://stackoverflow.com/q/24982316
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24982316

http://stackoverflow.com/q/25025210
tagged with: javascript
has body: I have an array that looks something like the following var initData = [ new Order({ orderId: "183175", name: "Columbus Africentric", production: [{ pType: "Art Time", by: "MJ" }, { pType: "Front Pocket", by: "WB" }] }), new Order({ orderId: "198675", name: "Stanford High", production: [{ pType: "Art Time", by: "MJ" }, { pType: "Full Back", by: "WB" }] }) ] I'm trying to do a with binding to show only extra information for on order when the item is clicked on. So I have a foreach for the orders that shows the orderId and the name in a table, and a button to click that then should show all production items for the chosen order. Something like the following Production Production Summary Type By <tbody I think I need to use a foreach to get to the production information. Can a foreach binding be used inside a with binding? Or do I even need one? If I have it bound using the "with" binding, is there a certain way to get to the multiple production items? I know this is super easy and it's probably staring me right in the face. also, when creating the Item Model I'm doing the following, which I think might be incorrect. function Order(data) { self.orderId = ko.observable(); self.name = ko.observable(); self.production = ko.observableArray([ [ self.pType = ko.observable(), self.by = ko.observable() ] ]); }
tagged with: knockout.js
has title: "with" databinding on a multi-dimensional array in Knockout Js
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25029344
accepted answer: http://stackoverflow.com/a/25029344
score: 0
answer count: 1
tagged with: arrays

http://stackoverflow.com/comment/38799678
type: Comment
type: QuestionComment
has text: I just edited my `link_to` with your suggestion. Still the same fade screen but no window display. A line forms on the screen though like it wants to generate a window. Here is the code I previously had for my `link`. `<%= link_to 'Add release', new_release_path, {:remote => true,'data-toggle'=> "modal", 'data-target' => '#modal-window'} %>`
comment on: http://stackoverflow.com/q/24958831
score: 0

http://stackoverflow.com/q/24998317
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25208198
type: Question
answer count: 2
tagged with: canvas
tagged with: iphone
has title: Drawing on canvas after megapix rendering is reversed
possible better answer: http://stackoverflow.com/a/25013860
tagged with: javascript
score: 0
tagged with: html5-canvas
has answer: http://stackoverflow.com/a/25013860
has body: I have a page which allows you to browse in an image, then draw on it and save both the original and the annotated version. I am leveraging megapix-image.js and exif.js to help in rendering images from multiple mobile devices properly. It works great, except in certain orientations. For example, a vertical photo taken on an iPhone4s is considered orientation 6 by exif and gets flipped accordingly by megapix-image so it's rendered nicely on the canvas. For some reason, when I draw on it afterward, it seems like the drawing is reversed. Mouse and touch both behave the same way. The coordinates look right to me (meaning they match a working horizontal pic and a non-working vertical pic), as does the canvas height and width when megapix-image.js flips it. This leads me to believe it has something to do with the context, but honestly, I am not really sure. I have a JS fiddle of the part of my work that shows the behavior. Just browse in a vertically taken pic from a mobile device or take a pic in vertical format on a mobile device and use it. I think all will show this same behavior. The final rendering is done like this: function RenderImage(file2) { if (typeof file2[0].files[0] != 'undefined') { EXIF.getData(file2[0].files[0], function () { orientation = EXIF.getTag(this, "Orientation"); var file = file2[0].files[0]; var mpImg = new MegaPixImage(file); var resCanvas1 = document.getElementById('annoCanvas'); mpImg.render(resCanvas1, { maxWidth: 700, maxHeight: 700, orientation: orientation }); }); } } But the full jsfiddle is here: http://jsfiddle.net/awebster28/Tq3qU/6/ Does anyone have any clues for me?
accepted answer: http://stackoverflow.com/a/25208198

http://stackoverflow.com/comment/133770058
comment on: http://stackoverflow.com/a/25068604
score: 1
type: AnswerComment
has text: This man Travis really came back 5 years later to get that upvote. That's due diligence right there.
type: Comment

http://stackoverflow.com/comment/38781836
comment on: http://stackoverflow.com/q/24950277
type: Comment
type: QuestionComment
has text: This is just testing Google's Analytics JavaScript (which Google will already do!). I don't understand how this achieves anything.
score: 0

http://stackoverflow.com/comment/38940064
has text: Thanks for that, I assumed one could pull that info from the developer tools. I guess I am showing off how novice I am to debugging. Hope my re-edit clears some things up.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25024058

http://stackoverflow.com/q/24985077
tagged with: ruby-on-rails
type: Question
type: AnsweredQuestion
has title: My ng-change is not firing on my Angular/Rails app
upvote count: 1
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38842905
has answer: http://stackoverflow.com/a/24985513
has body: I am building a notecard application and for some reason my ng-change is not firing at all. I cannot figure out what the issue is. I tried breakpoints in the JS to verify that it is not actually firing. I'm positive it's got to be a something small I missed. I just need a second pair of eyes on it. Here is the JS var app = angular.module('catalyst', ['faye']); app.factory('Faye', [ '$faye', function($faye) { return $faye("http://localhost:9292/faye"); } ]); app.directive('stickyNote', function(Faye) { var linker = function(scope, element, attrs) { element.draggable({ stop: function(event, ui) { Faye.publish('/ui/board', { id: scope.note.id, x: ui.position.left, y: ui.position.top }); } }); Faye.subscribe('/ui/board', function(data) { // Update if the same note if(data.id == scope.note.id) { element.animate({ left: data.x, top: data.y }); } }); // Some DOM initiation to make it nice element.css('left', '10px'); element.css('top', '50px'); element.hide().fadeIn(); }; var controller = function($scope) { // Incoming Faye.subscribe('/ui/board', function(data) { // Update if the same note if(data.id == $scope.note.id) { $scope.note.title = data.title; $scope.note.body = data.body; } }); // Outgoing $scope.updateNote = function(note) { Faye.publish('/ui/board', note); }; $scope.deleteNote = function(id) { $scope.ondelete({ id: id }); }; }; return { restrict: 'A', link: linker, controller: controller, scope: { note: '=', ondelete: '&amp;' } }; }); app.controller('MainCtrl', function($scope, Faye) { $scope.notes = []; // Incoming Faye.subscribe('/ui/board', function(data) { $scope.notes.push(data); }); Faye.subscribe('/ui/board', function(data) { $scope.handleDeletedNoted(data.id); }); // Outgoing $scope.createNote = function() { var note = { id: new Date().getTime(), title: 'New Note', body: 'Pending' }; $scope.notes.push(note); Faye.publish('/ui/board', note); }; $scope.deleteNote = function(id) { $scope.handleDeletedNoted(id); Faye.publish('/ui/board', {id: id}); }; $scop…
accepted answer: http://stackoverflow.com/a/24985513
tagged with: angularjs
downvote count: 0
score: 1

http://stackoverflow.com/comment/38795722
comment on: http://stackoverflow.com/q/24959291
score: 0
has text: You want to insert into the tag or into the editor?
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24996202
has title: On object(copy) parameter change original changes
has comment: http://stackoverflow.com/comment/53220698
type: Question
has body: This is not a question on "How to" but "Why" I have observed some wird object behaviour in JS on Chrome(36.0.1985.125). If i copy object to diffrent variable and change that copy data original object changes. How is that possible? Here is the code that matters: var argsForNewAjax = false; function news_ajax(args, id){ var ajaxStartTime = new Date().getTime(); var temp = argsForNewAjax; if(argsForNewAjax){ args = argsForNewAjax; } else{ args.action = "get_news"; args.numberposts = (isDefined(args.numberposts) ? args.numberposts : 4); } argsForNewAjax = jQuery.extend({}, args); //if i change this line to the one comented //argsForNewAjax = args argsForNewAjax.offset = argsForNewAjax.offset + args.numberposts; console.log(args); $.ajax({ //JQ ajax ... result with jquery.extend object is copied and updated and args stay un-changed widouth jquery object is copied but when it's value changes original(args) change So my question is how can a value change if it's copy changes in JS?
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38862945
upvote count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38888882
has comment: http://stackoverflow.com/comment/53213073
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38888835
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/q/24990758
tagged with: javascript
tagged with: jquery
has body: I had this code on index.html: Search: Sort: Alphabetical Date {{person.name}} {{person.born}} - {{person.died}} I decided to divide the UI into partials, and moved the search part to search.html: Kërko: Radhit sipas: Alfabetit Vitit Before doing this, the search form was working great. After I moved it to another template, it doesn't work. I have no idea because this is my first day working with Angular.js, and I'd need some help. Also, here's what on my controllers.js: var deshmoretControllers = angular.module('deshmoretControllers', []); deshmoretControllers.controller('PeopleListCtrl', ['$scope', 'Person', function($scope, Person) { $scope.people = Person.query(); $scope.orderProp = 'age'; }]); ... Plunker: http://plnkr.co/edit/J98O34dBFaUchhKdT6ck
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38853250
has answer: http://stackoverflow.com/a/24990818
has comment: http://stackoverflow.com/comment/38853166
type: AnsweredQuestion
has title: Angular.js Search Query if search form is out of current file
has comment: http://stackoverflow.com/comment/38853001
has answer: http://stackoverflow.com/a/24991867
accepted answer: http://stackoverflow.com/a/24991867
type: Question
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38854335
possible better answer: http://stackoverflow.com/a/24990818

http://stackoverflow.com/q/25053994
tagged with: jquery
has body: I'm creating a ticket select panel using bootstrap framework. Within the panel we have "ticket name", if you click anywhere within the panel the input/radio button becomes active. My problem is that I have a field within that serves as an "info" button, this expands information about the ticket using bootstraps accordion component. When clicking the info button from another ticket that ticket/input/radio button becomes active. Ideally I would like to se the info from another ticket without actually activating/selecting the ticket. So I need to exclude the button from making the ticket active. Link to my demo - https://7bfcde86fc7f3304fcc6b50556a41b7e2907d0fd.googledrive.com/host/0B8UWGEiox1HOV0pnVTdsQXJpemM/test.html (you may need to load unsafe scripts for demo to work fully - Google drive security) Ticket Name Lorem ipsum dolor sit amet, consec tetur adipiscing elit. £123 £123 Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: css
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/38972061
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/38972009
tagged with: javascript
type: UnansweredQuestion
has title: Expanding an accordion within an element that becomes active - bootstrap

http://stackoverflow.com/q/24943102
has answer: http://stackoverflow.com/a/24943250
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24943215
linked to: http://stackoverflow.com/q/24901198
has comment: http://stackoverflow.com/comment/38763963
type: Question
has comment: http://stackoverflow.com/comment/38763967
possible better answer: http://stackoverflow.com/a/24943249
has answer: http://stackoverflow.com/a/54054752
has answer: http://stackoverflow.com/a/24943249
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24943161
has title: What's the difference between .clone() and .html()?
favorite count: 0
answer count: 5
has body: What is the difference between Jquery's .clone() and .html() functions? Jquery documentation states: The .clone() method performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes. In an HTML document, .html() can be used to get the contents of any element. If the selector expression matches more than one element, only the first match will have its HTML content returned. To me these seem to interchangeable, so are there specific situation where one would be used of the other?
score: 16
has comment: http://stackoverflow.com/comment/38764052
upvote count: 16
has answer: http://stackoverflow.com/a/24943161

http://stackoverflow.com/comment/39048123
type: Comment
type: QuestionComment
score: 0
has text: I thought you didn't know the answer and wanted to make a fuss, but that was not your intention I see now :)
comment on: http://stackoverflow.com/q/25064009

http://stackoverflow.com/q/24911028
tagged with: asp.net
tagged with: css
has comment: http://stackoverflow.com/comment/38704255
type: AnsweredQuestion
has title: Virtual Keypad (Keith Wood) closes itself on every click when initialized on textboxes inside a JQuery Dialog
has comment: http://stackoverflow.com/comment/38704128
type: Question
tagged with: c#
has comment: http://stackoverflow.com/comment/38708117
has body: UPDATE -- jsfiddle: http://jsfiddle.net/bLURx/4/ On my main screen, I have one inline instance of the virtual keypad that works fine. There are links in a table on this screen that will open a JQuery Dialog that contains another table, where one of the columns is a textbox for each row. I initialize a keypad for every textbox that is generated, so that the user will have a popup keypad for each box to enter some numbers. It all works up to this point. I had to change the z-index of the popup keypads so that they appeared above the dialog, but now I can click on every box and the keypad will slide in as it should. The problem happens whenever I click any of the buttons on the keypads. Every keypad, upon clicking any button, will close itself and open up a keypad above the top row in the table. This top keypad will stay open upon being clicked, but it does not add text to any field. jQuery function for dialog / initializing popup keypads: $(function () { var createdPads = []; $('#dialog').dialog({ autoOpen: false, modal: true, width: '95%', height: 1000, open: function (event, ui) { $('#dialog :text').each(function () { $(this).keypad({ keypadOnly: false, keypadClass: 'miniPad' }); createdPads.push(this); }); }, close: function (event, ui) { for (i = 0; i &lt; createdPads.length; i++) { createdPads[i].remove();//removing created keypads because they were affecting the previous inline keypad } $('#&lt;%=enterNumberBox.ClientID%&gt;').blur();//removing focus from original field var tbl = $('#&lt;%=gvData.ClientID%&gt;'); if (tbl.is(":visible")) { //scrolling back down to results after dialog close $(window).scrollTop(tbl.position().top); } } }); }); CSS-Class for the popup keypads: .miniPad{ z-index: 9999 !important; } HTML: &lt;div id="dialog" style="display: none; text-align: center;"&gt; &lt;span class="ui-helper-hidden-accessible"&gt;&lt;input type="text"/&gt;&lt;/span&gt;&lt;!--to prevent autofocus--&gt; &lt;asp:GridView runat="server" ID="gvItemData"&gt;&lt;/asp:G…
has comment: http://stackoverflow.com/comment/38712613
has answer: http://stackoverflow.com/a/24916416
score: 0
has comment: http://stackoverflow.com/comment/38702780
answer count: 1
accepted answer: http://stackoverflow.com/a/24916416
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/q/24990485
has body: I have a problem with onmousemove. I've created a div element and added onmousemove="doSomething()" to it but it wouldn't work. Until now I have tried to do it with addEventListener(), object.onmousemove=doSomething() and I've copied the vital code from w3schools, where it works fine, to the end of my page. I've discovered that both codes fire an event, which works fine - all functions are executed as they should be when the mouse moves - when I rightclick on the element with onmousemove. The same happens if i try to use event listeners. Any ideas on how to solve this? EDIT: I have now discovered that the real problem is, that the page loads as an action in an other pages form. (creating a file at which onmousemove works and then trying to load it with the same form) The form is uploading files - images and I'm using xampp.
favorite count: 0
has title: onmousemove triggers only on rightclick
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24990566
tagged with: http://stackoverflow.com/tag/html
tagged with: php
has comment: http://stackoverflow.com/comment/38852346
has comment: http://stackoverflow.com/comment/38852796
downvote count: 2
upvote count: 1
has answer: http://stackoverflow.com/a/24990595
type: Question
tagged with: xampp
tagged with: javascript
score: -1
answer count: 2

http://stackoverflow.com/comment/38708484
type: QuestionComment
has text: Hmm then apparently it seems that version of opera does _not_ have the same object inheritance model for `Uint8Array` or something is going very wrong (or the constructor just doesn't link that property when making your new instance). In any case, since this is a constant, I'd say it's ok to just get it directly from `Uint8Array` and trust that value. Any reason why that wouldn't work? Also, try `alert(a instanceof Unit8Array)`.
comment on: http://stackoverflow.com/q/24913526
score: 0
type: Comment

http://stackoverflow.com/q/24995086
has comment: http://stackoverflow.com/comment/38860793
has answer: http://stackoverflow.com/a/24995308
has body: So I have a url, say I am using it with the Titanium Appcelerator, So I am wondering whether these jquery code will work with Titanium. url = 'abc.com/ab/a.aspx?b_no=0a1' The html for the url is [{"a":"1"},{"b":"2"},{"c":"3"},{"d":"4"}] So I want to fetch that SPAN value from the url.. Might be a noobish question/formation of the question.. But learning bits and tricks.. Please guide..
upvote count: 2
tagged with: titanium
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38860840
tagged with: javascript
has title: Fetch a ID values from a URL
type: Question
accepted answer: http://stackoverflow.com/a/24995308
has comment: http://stackoverflow.com/comment/38860847
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/24995776
favorite count: 0
possible better answer: http://stackoverflow.com/a/24995776
has comment: http://stackoverflow.com/comment/38860892
has comment: http://stackoverflow.com/comment/38860985
score: 2

http://stackoverflow.com/q/24964984
has comment: http://stackoverflow.com/comment/38805114
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/729577
has comment: http://stackoverflow.com/comment/38804615
tagged with: iframe
has comment: http://stackoverflow.com/comment/38806181
has answer: http://stackoverflow.com/a/24965844
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/14944699
has title: access the content of a about:blank iframe
score: 0
has body: From the Firebug JavaScript console is it possible to access the content of an &lt;iframe&gt; object whose src property is set to about:blank? I've tried with: var b=document.getElementById("iframe_ID"); console.log(b.innerHTML); but it returns (an empty string)
tagged with: firebug
tagged with: http://stackoverflow.com/tag/html
answer count: 1

http://stackoverflow.com/a/24945864
downvote count: 0
has body: Get a reference to the current select element using $(this). $('#select2_elem').on('select2-opening', function (evt) { $(this).append(' val1... '); });
accepted answer of: http://stackoverflow.com/q/24945722
score: 1
answers question: http://stackoverflow.com/q/24945722
upvote count: 1
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/q/24971160
has comment: http://stackoverflow.com/comment/38823363
answer count: 1
has answer: http://stackoverflow.com/a/24973763
has comment: http://stackoverflow.com/comment/38820100
tagged with: ember.js
tagged with: requirejs
linked to: http://stackoverflow.com/q/13615679
tagged with: qunit
tagged with: karma-runner
has comment: http://stackoverflow.com/comment/38820403
type: UnansweredQuestion
has body: I am testing emberjs with qunit and karma test runner. I also use requirejs for module loading. Index route beforeModel hook returns a promise that calls require to lazy load routes/index_deps. File: app/index_route.js beforeModel: function() { return new Ember.RSVP.Promise(function(resolve, reject) { require(['routes/index_deps'], function() { resolve(); }); // Ember.run.later(function() { // resolve(); // }, 5000); }); } My test for index route looks like this. File: test/first-test.js test('hello', function() { expect(1); visit('/').then(function() { equal(find('h1').text(), 'Setting Up'); }); }); This setup gives this error: Uncaught Error: Load timeout for modules: routes/index_deps If i comment out require part and uncomment the Ember.run.later part, it works perfect. Also there is nothing wrong with the app/index_route.js because it works as expected on the browser. This error occurs only when testing. Edit require callback never fires, and resolve never gets called. So wrapping it in Ember.run makes no difference if i wrap whole require however that doesn't make any difference. Below here logs but not here doesn't log. return new Ember.RSVP.Promise(function(resolve, reject) { Ember.run(function() { console.log('here'); require(['routes/index_deps'], function() { console.log('not here'); resolve; }); }); });
type: Question
has title: ember qunit requirejs nested require load timeout
tagged with: javascript
has comment: http://stackoverflow.com/comment/38823424
score: 0

http://stackoverflow.com/a/41832758
type: Answer
answers question: http://stackoverflow.com/q/24966900
score: 0
has body: The following code has worked for me on Ember 2.10 (on services and an components): const router = Ember.getOwner(this).lookup('router:main'), rootURL = router.get('rootURL'); I should add that this is generally a bad idea, but maybe it helps you.

knockout-2.0
tags question: http://stackoverflow.com/q/25002537
tag name: knockout-2.0
type: Tag

http://stackoverflow.com/q/24950182
tagged with: dependency-injection
has title: How to use an angular factory correctly?
has comment: http://stackoverflow.com/comment/38777227
has answer: http://stackoverflow.com/a/24950382
accepted answer: http://stackoverflow.com/a/24950382
tagged with: javascript
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/14324451
possible better answer: http://stackoverflow.com/a/24950442
tagged with: angularfire
has answer: http://stackoverflow.com/a/24951309
has answer: http://stackoverflow.com/a/24950442
tagged with: angularjs
has body: I've been doing quite a lot of reading about angular dependency injection and factories vs services etc like in this post here - angular.service vs angular.factory I'm struggling putting it into practise and wonder if you can give me suggestions on how you would do it. My current code looks like this var app = angular.module("martysCoolApp", ['firebase', 'ngRoute']) function mainController($scope, $firebase) { var db = new Firebase("https://**.firebaseio.com/"); $scope.messages = $firebase(db); $scope.addItem = function(error) { if (error.keyCode != 13) return; $scope.messages.$add({ name: $scope.name, price: $scope.price }); $scope.name = ""; $scope.price = ""; }; } I decided I wanted to use angular routes and split this basic function up into two different controllers that I would use for my test app. the MainController would just display everything in the firebase db and the AdminController would be able to add messages to it var app = angular.module("martysCoolApp", ['firebase', 'ngRoute']) .factory('fireBaseConnectionService', $firebase) //code in here to connect to firebase and add messages .controller('MainController', function(fireBaseConnectionService, $scope, $route, $routeParams, $location) { $scope.$route = $route; $scope.$location = $location; $scope.$routeParams = $routeParams; //code here to retrieve everything from firebase db }) .controller('AdminController', function(fireBaseConnectionService, $scope, $routeParams) { $scope.name = "AdminController"; $scope.params = $routeParams; //code here to add a row to the db }) .config(function($routeProvider, $locationProvider) { $routeProvider.when('/', { redirectTo: '/menu' }) .when('/menu', { path: '/menu', templateUrl: 'partials/menu.html', controller: 'MainController' }) .when('/admin', { templateUrl: 'partials/admin.html', controller: 'AdminController' }) .otherwise({ redirectTo: '/' }); $locationProvider.html5Mode(false); }); My problem is I don't want to have to connect to the firebase db in each cont…
tagged with: firebase
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38777159
has comment: http://stackoverflow.com/comment/38777263
type: Question

http://stackoverflow.com/q/24952322
has body: I'm developing a native app using Node webkit. As usually everything goes with JS. what i need is: i want to schedule a task using "schtask" command. so that i need to run it from JS code. Is there any way to run commands from JavaScript code?? or any other alternative to set schedule tasks in windows from Java Script? - Thanks in advance
tagged with: node.js
score: 0
has answer: http://stackoverflow.com/a/24952540
has title: Schedule Tasks in JavaScript (Node webkit project)
has comment: http://stackoverflow.com/comment/38780811
has answer: http://stackoverflow.com/a/24955848
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38781048
type: Question
answer count: 2

http://stackoverflow.com/comment/38831178
has text: @Dr.Molle, My question is the latter one, how can i send and fetch it as an array in php without using json
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24979054

web-services
type: Tag
tags question: http://stackoverflow.com/q/24972848
tags question: http://stackoverflow.com/q/25065352
tags question: http://stackoverflow.com/q/25062135
tags question: http://stackoverflow.com/q/25054012
tags question: http://stackoverflow.com/q/24994682
tags question: http://stackoverflow.com/q/24964676
tags question: http://stackoverflow.com/q/24920977
tags question: http://stackoverflow.com/q/24949661
tags question: http://stackoverflow.com/q/24999675
tag name: web-services
tags question: http://stackoverflow.com/q/25053050
tags question: http://stackoverflow.com/q/25066232
tags question: http://stackoverflow.com/q/25052368

http://stackoverflow.com/a/24986932
has body: Here you go : class X { y = { a:()=&gt; {}, b:()=&gt; {} } z() {} } var x = new X();
type: AcceptedAnswer
downvote count: 0
score: 8
upvote count: 8
accepted answer of: http://stackoverflow.com/q/24984861
type: Answer
answers question: http://stackoverflow.com/q/24984861

http://stackoverflow.com/q/24991072
downvote count: 0
has answer: http://stackoverflow.com/a/24991135
has comment: http://stackoverflow.com/comment/38853559
has answer: http://stackoverflow.com/a/29302714
favorite count: 0
has comment: http://stackoverflow.com/comment/38853537
has answer: http://stackoverflow.com/a/76708671
type: UnansweredQuestion
has body: How can I fade in an HTML5 dialog? And by dialog I mean HTML5 tag (http://demo.agektmr.com/dialog/). I tried the following (http://jsfiddle.net/v6tbW/) but for some reason the transition does not work. document.getElementById('myDialog').show(); // note that this is a method of , this is not a jQuery method. dialog { position: absolute; left: 0; right: 0; margin: auto; border: solid; padding: 1em; background: white; color: black; width: -moz-fit-content; width: -webkit-fit-content; width: fit-content; height: -moz-fit-content; height: -webkit-fit-content; height: fit-content; visibility: hidden; opacity: 0; transition: visibility 10s linear 10s, opacity 10s linear; } dialog[open] { visibility: visible; opacity: 1; transition-delay: 0s; } .backdrop { position: fixed; background: rgba(0, 0, 0, 0.1); top: 0; bottom: 0; left: 0; right: 0; } Test
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has answer: http://stackoverflow.com/a/24991272
has comment: http://stackoverflow.com/comment/135239012
has answer: http://stackoverflow.com/a/77468272
has comment: http://stackoverflow.com/comment/38853745
has answer: http://stackoverflow.com/a/69794684
score: 23
upvote count: 23
type: Question
answer count: 8
has comment: http://stackoverflow.com/comment/38933725
has title: How to fade in a HTML5 dialog?
has answer: http://stackoverflow.com/a/79016584
tagged with: javascript
tagged with: css-animations
has answer: http://stackoverflow.com/a/64708195

http://stackoverflow.com/q/25052758
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/35117591
downvote count: 0
score: 54
has answer: http://stackoverflow.com/a/32707067
has body: I was looking at a perf benchmark of Object.keys + forEach vs for-in with normal objects. This benchmark shows that Object.keys + forEach is 62% slower than the for-in approach. But what if you don't want to get the inherited properties? for-in includes all non-native inherited objects, so we'll have to use hasOwnProperty to check. I tried to make another benchmark here doing exactly that. But now the for-in approach is 41% slower than Object.keys + forEach. update The above test was done in Chrome. Tested it again but with Safari and I'm getting different results: Object.keys(..).forEach(..) 34% slower, odd. Note: The reason I'm benchmarking is to check how it is with Node.js. Questions: Are the jsperf result for Chrome considerable for Node.js? What happened, how come a single conditional made the for-in approach 41% slower than Object.keys + forEach in Chrome?
has answer: http://stackoverflow.com/a/25053027
possible better answer: http://stackoverflow.com/a/35117591
has comment: http://stackoverflow.com/comment/38970057
type: Question
upvote count: 54
tagged with: javascript
has answer: http://stackoverflow.com/a/35848185
tagged with: inheritance
has answer: http://stackoverflow.com/a/40798056
answer count: 7
has answer: http://stackoverflow.com/a/76544977
has title: for-in vs Object.keys forEach without inherited properties
favorite count: 0
has answer: http://stackoverflow.com/a/46721791
has comment: http://stackoverflow.com/comment/38970009
accepted answer: http://stackoverflow.com/a/25053027

http://stackoverflow.com/a/25068916
downvote count: 0
has comment: http://stackoverflow.com/comment/39023472
type: Answer
has comment: http://stackoverflow.com/comment/39021136
has comment: http://stackoverflow.com/comment/39022521
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/39024860
answers question: http://stackoverflow.com/q/25068739
has body: I think your question is similar to Convert String to XML Document in JavaScript The answer is that you can wrap it in a jQuery object. Then use jQuery's normal DOM manipulation methods on it. var myhtml = $($('#main-input').val()); myhtml.find('a').each(function () { alert($(this).text()); }); if it's a top level element you need to use filter instead of find.
has comment: http://stackoverflow.com/comment/39022320
accepted answer of: http://stackoverflow.com/q/25068739
type: AcceptedAnswer

http://stackoverflow.com/q/24940571
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
has title: Frame Busting in the ad industry
tagged with: framebusting
answer count: 0
type: UnansweredQuestion
tagged with: iframe
has comment: http://stackoverflow.com/comment/38760048
has body: I'm trying to find a way to stop malicious ad IFrames from stealing top.location as they sometimes do (cheap traffic). I used Atwood's HTTP 204 solution but in my tests seems like it breaks some basic functionality like manually changing the url via address bar and the refresh button busted as well. I thought I might be able to stop the bubbling of onbeforeunload event and use the busting code inside "middle" IFrame but I couldn't make it, the onbeforeunload event in the "middle" IFrame fires and bust any redirection try. I was wondering, is there any other way to keep the functionality as is and yet bust the redirection coming from a specific Iframe?
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38881288

http://stackoverflow.com/a/24971458
has body: The canvas is just a "canvas" where you draw the circles. What you need to accomplish what you want is to model a "world" where the circles are object with width and height dimensions and their current position, and where the bounds are well defined. Once you have the width and height of each circle and their position, you can calculate where they are in respect to the bounds you set and see if you need to change direction or keep going. Collisions stem from the same principle but are somewhat harder to model if you want them to be "realistic" (in the bounds problem you are only interested in the width and height of the circles because the bounding area is box shaped and the circle will always collide in the furthest point from its center, while when two circles collide you should take into account the radius of each circle instead of the "bounding box" around them. I don't have time right now to show you this concepts with examples, but hopefully I sent you in the right track :).
score: 1
answers question: http://stackoverflow.com/q/24971377
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/24965011
tagged with: mobile-safari
type: Question
downvote count: 0
tagged with: javascript
tagged with: window.location
score: 1
has title: Mobile Safari opens a new window when window.location.hash changes on web app
favorite count: 0
answer count: 0
type: UnansweredQuestion
upvote count: 1
has body: I have a single page web app that changes it state by changing the window.location.hash and I have an event listener to process the hash and display things according hash value, like this: $(window).on('hashchange', function() { processWindowHash(); }); The users can add the web app to their home screen and use it, but at their first action it opens a new window because of the window.location.hash change. I have the following meta on my page's head: I tried to follow every hash change (like window.location.hash = 'foo';) with a return false statement, without success. Is there any solution to this problem or I have to use another way to change the app state instead of window.location.href? I found other questions similar to this, but all other questions were about catching page link clicks (like foo). I found nothing about window.location.hash changes.

http://stackoverflow.com/comment/38743771
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24932653
has text: I don't think so, as without it, the word will be just a `textNode` which doesn't have the properties that you need to find the coordinates.
score: 0

http://stackoverflow.com/a/24968980
has body: You can make use of a closure: var rowLength = 3; var nItemsInRow = 1; $('body').on('click', '.children', function (e) { var clone = $(this).clone().removeClass('box-border'); if (rowLength === nItemsInRow) { /* insert line break */ /* ... */ /* insert clone */ /* ... */ // now update counters --rowLength; if (rowLength === 0) rowLength = 3; nItemsInRow = 1; } else { $(this).after(clone); ++nItemsInRow; } });
answers question: http://stackoverflow.com/q/24968864
score: 0
has comment: http://stackoverflow.com/comment/38818612
type: Answer

http://stackoverflow.com/comment/38909849
has text: Of course it IS zero. Is it so difficult to substitute it with appropriate data?
type: AnswerComment
comment on: http://stackoverflow.com/a/25020468
score: 0
type: Comment

http://stackoverflow.com/q/25031692
has answer: http://stackoverflow.com/a/36978022
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
upvote count: 1
has body: I have this js which will show a news ticker in my jsp page. How will I update it? I tried inserting an setTimeout, but every time it refreshes it creates a new news ticker.. My code.. $('document').ready(function init(){ var url = "http://localhost:8080/RestartSpringRestService/rest/getAllSiteLatestCriticalParams"; var i = 1; $.getJSON(url, function(data){ $.each(data, function(i, item) { alert("hiii::"+":::::::"+item.bufferCount+":::::::"+item.cpu+":::::::"+item.memory); $("#news ul").append("").append("").append("").append("").liScroll(); i++; }); // refresh ticker setTimeout(init,1000); }); });
favorite count: 0
has title: How to refresh jquery news ticker?
type: UnansweredQuestion
score: -3
downvote count: 4
has answer: http://stackoverflow.com/a/25032115

http://stackoverflow.com/comment/39008739
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25049162
has text: @user3893639 Are you sure you have refreshed your web browser cache? Try refreshing the site with Ctrl+F5. If it's not working on production environment, maybe minification of js files spoils something?
type: AnswerComment

http://stackoverflow.com/a/24955885
answers question: http://stackoverflow.com/q/24955467
score: 0
type: Answer
has body: If there will be so many parent elements of .box-wide-more then to get a specific parent element (i.e. .box-wide), you can use below code. $(".box-wide-more").click(function() { $(this).parents().find('.box-wide').animate({ height: '300px' }, 500); });

http://stackoverflow.com/q/25031613
answer count: 1
tagged with: facebook-graph-api
has comment: http://stackoverflow.com/comment/38929939
favorite count: 0
has answer: http://stackoverflow.com/a/25032952
accepted answer: http://stackoverflow.com/a/25032952
tagged with: facebook
has body: I am currently working on an app that removes the links that you posted on Facebook from the app after you want to delete some published stuff in the app. Yesterday everything worked. Today when i try to delete any links shared on Facebook i receive the following error: { "error": { "message": "An unknown error has occurred.", "type": "OAuthException", "code": 1 } } The user gave the permission to read_stream and publish_actions. I also tried the same thing in Graph Explorer Tool provided by Facebook and the same error occurs, while yesterday everything was fine. I do not know what happened. If can someone illuminate me i will be forever grateful. UPDATE with code: /** * @param {!function(string):boolean} filter * @param {Function} callback */ findRemoveFBposts = function(filter, callback) { var IDS = []; var removeLinks = function(index) { FB.api(IDS[index], "DELETE", function(response) { ++index &lt; IDS.length ? removeLinks(index) : (callback &amp;&amp; callback(IDS)); }); }; var fetchFB = function(query) { FB.api(query, function(response) { if (!response['error']) { for (var i = 0, n = response['data'].length; i &lt; n; i += 1) { filter(response['data'][i]['link']) &amp;&amp; IDS.push(response['data'][i]['id']); } response['paging'] &amp;&amp; response['paging']['next'] ? fetchFB(response['paging']['next']) : (IDS.length ? removeLinks(0) : (callback &amp;&amp; callback(IDS))); } else { IDS.length ? removeLinks(0) : (callback &amp;&amp; callback(IDS)); } }); }; fetchFB("/v2.0/me/links?fields=link"); }; findRemoveFBposts(function(link) { return link=='http://mywebsite.com/somepost'; }, function() { console.log('Everything is done') }); EDIT: This was a feature that was exploiting a Facebook security issue. The correct way to do it is in Patrick's answer.
type: AnsweredQuestion
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38929790
type: Question
has comment: http://stackoverflow.com/comment/38930770
tagged with: javascript
has comment: http://stackoverflow.com/comment/38930809
has comment: http://stackoverflow.com/comment/38930455
has title: Can't delete the links anymore from FB
has comment: http://stackoverflow.com/comment/38929720
has comment: http://stackoverflow.com/comment/38929980
upvote count: 1
has comment: http://stackoverflow.com/comment/38929950

http://stackoverflow.com/comment/38840218
has text: @JonathanCrowe no console error, I'm using 1.10.2
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24983939

http://stackoverflow.com/a/24971446
has body: How are your initial rules set up? I think you're running into a problem of specificity. If your 'standard' rules are the same or more specific than your rules in your media query, the media query will not override them. This seems to do what you expect: @media all and (max-width: 955px) { div.grid12-11 { display: none; } div.grid12-12 { display: block; } } .grid12-11 { display:block; } .grid12-12 { display:none; } Note that if your standard rules (non-media) are prefixed with "div", it will NOT function (depending on what order the rules are processed in, and which browser you are using).
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24971326

http://stackoverflow.com/a/26805451
has body: This is not a clean way of having an array-like object that has additional properties on it, however the above answer that you 'cannot add functions onto an array' is incorrect. While creating array-like objects is kind of messy and should be avoided where possible. If you feel it is absolutely necessary, I would handle it like this (this is similar to how jQuery does it. function ImagesList($http) { this.push.apply(this, [ "www.google.com", "www.facebook.com", "www.supercuber.com", "www.snappiesticker.com" ]); this._$http = $http; } ImagesList.prototype = { push: [].push, splice: [].splice, pop: [].pop, indexOf: [].indexOf, addStuff: function () { this._$http.get("http://jsbin.com/yehag/2").then(function(data){ var returnedList = angular.toJson(data.javascript); for (var i=0; i&lt;8; i++) { this.push(returnedList[i].name); } }.bind(this)); } }; angular .module('infinitescroll', []) .service('imageList', ImagesList); .directive('onScrolled', function () { return { scope: { onScrolled: '&amp;' }, link: function (scope, elm, attr) { var el = elm[0]; // Original implementation will end up causing memory leak because // the handler is never destroyed. Use as follows elm.on('scroll.iScroll', function () { if (el.scrollTop + el.offsetHeight &gt;= el.scrollHeight) { scope.$apply(attr.onScrolled); } }).on('$destroy', function () { elm.off('.iScroll'); }); } }; }).controller("scrollCtrl", function($scope, imageList){ $scope.data = imageList; $scope.loaddata = function(){ var length = $scope.data.length; for(var i = length; i &lt; length + 10; i++){ $scope.data.push(i); } }; $scope.loaddata(); })
score: 0
answers question: http://stackoverflow.com/q/24985623
type: Answer

http://stackoverflow.com/q/24942557
type: Question
has comment: http://stackoverflow.com/comment/38762800
tagged with: javascript
has title: Click event on input value
score: 0
answer count: 3
has answer: http://stackoverflow.com/a/24942645
has body: I am trying to alert '#water' when I click the text '#water'. Instead I am getting 'Object Object'. Am I completely missing the boat here? The idea is that if there are multiple values, say "#water", "#tea", "soda", that you can click each text individually rather than just triggering the event by clicking the text area. &lt;input type='text' id='input-tags' name='hashtags' value="#water"&gt; &lt;script&gt; $('#input-tags').click(function(){ alert($(this)) }) &lt;/script&gt;
type: UnansweredQuestion
tagged with: input
has answer: http://stackoverflow.com/a/24942601
has comment: http://stackoverflow.com/comment/38762910
has answer: http://stackoverflow.com/a/24942597

http://stackoverflow.com/comment/38872281
type: QuestionComment
comment on: http://stackoverflow.com/q/25001158
has text: It may just use the cache. Put a random string at the end of the URL.
score: 0
type: Comment

http://stackoverflow.com/q/24937964
tagged with: http://stackoverflow.com/tag/html
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/24938038
score: -3
upvote count: 1
tagged with: php
type: AnsweredQuestion
has body: I have a variable in PHP which contains different HTML code. Sometimes i find in this HTML code parts of javascript code or jquery code. This extra code may or may not have the &lt;script&gt; tag. So for example i might find jquery functions surrounded in a &lt;p&gt; tag. Is there a way to detect this javascript/jquery code in the string and delete?
type: Question
has title: PHP: Detect if string contains JavaScript/jQuery code inside and delete that part of code
accepted answer: http://stackoverflow.com/a/24938038
has comment: http://stackoverflow.com/comment/38753746
tagged with: javascript
downvote count: 4

http://stackoverflow.com/a/24926878
downvote count: 0
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24926796
upvote count: 2
has body: You can use JQuery for a parse JSON. ... success: function(data){ ... var site_url = "&lt;?php echo site_url('form_controller/callform'); ?&gt;"; var mydata=window.JSON.stringify(data.trim()); var jobj=jQuery.parseJSON(data.responseText); //&lt;---JSON to object site_url = site_url +"/" + jobj.id ; //&lt;--- jobj.id - your id ....

header
type: Tag
tags question: http://stackoverflow.com/q/24924867
tags question: http://stackoverflow.com/q/24984935
tag name: header

http://stackoverflow.com/comment/38759336
comment on: http://stackoverflow.com/a/24940862
type: AnswerComment
score: 0
type: Comment
has text: maybe utilize !important

http://stackoverflow.com/comment/47029793
has text: that's the way i'm doing it now... my SO search was hoping to reveal a more 'elegant' method. I guess this is just how it's done =/
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24925660
type: Comment

http://stackoverflow.com/comment/38983225
type: QuestionComment
has text: http://jsfiddle.net/W6tnu/
score: 0
comment on: http://stackoverflow.com/q/25059837
type: Comment

http://stackoverflow.com/a/25069722
answers question: http://stackoverflow.com/q/25008083
score: 0
type: AcceptedAnswer
has body: CHK1LAST(); var $tabs = $('.tabbable li'); $('.btnPrevious').on('click', function () { $tabs.filter('.active').prev('li').find('a[data-toggle="tab"]').tab('show'); CHK1LAST(); }); $('.btnNext').on('click', function () { if ($tabs.filter('.active').find('ul').length &gt; 0) { var $bb = $tabs.filter('.active').find('ul'); if ($bb.find('li.active').length &gt; 0) { if ($bb.find('li.active').index() == (parseInt($bb.find('li').length) - 1)) { if ($bb.parent('li').next('li').find('li').length &gt; 0) $bb.parent('li').next('li').find('li').eq(0).find('a[data-toggle="tab"]').tab('show'); else $bb.parent('li').next('li').find('a[data-toggle="tab"]').tab('show'); } else $bb.find('li.active').next('li').find('a[data-toggle="tab"]').tab('show'); } else $bb.find('li').eq(0).find('a[data-toggle="tab"]').tab('show'); } else $tabs.filter('.active').next('li').eq(0).find('a[data-toggle="tab"]').tab('show'); CHK1LAST(); });
type: Answer
accepted answer of: http://stackoverflow.com/q/25008083

http://stackoverflow.com/comment/38921964
score: 1
comment on: http://stackoverflow.com/a/25027183
has text: @Startec This loops over `propertyObj` instead of `obj`
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/39018335
type: Comment
comment on: http://stackoverflow.com/a/25076152
type: AnswerComment
has text: To re-iterate: what is the value of document.referrer? The suggested replacement likely **never** redirects, which would indicate the document.referrer **never** contains "site1"
score: 0

http://stackoverflow.com/q/24969119
has comment: http://stackoverflow.com/comment/38812196
tagged with: popup
type: UnansweredQuestion
score: 0
has title: Validation in Partial view inside popup
tagged with: asp.net-mvc
type: Question
answer count: 1
has body: I'm working in MVC and i have one scenario as follows: I have a view called ManageResource where i il show the available resource's in grid and a button to add new resource. if i click on the add new resource button a popup il open with the partialview inside it, i have to display the validation result in popup itself when i click save with out entering any values and when i enter the required fields the values should be populated in the grid and the popup should be closed.` "iam not getting validation result in popup, but can able to save data's" following is my code: Model-tblUser public partial class tblUser { public int UID { get; set; } [Required] public int EmpID { get; set; } [Required] public string FirstName { get; set; } [Required] public string LastName { get; set; } [Required] public decimal Salary { get; set; } } View-ManageResource function Create() { BootstrapDialog.show({ title: "Add Resource", message: $(' ').load('@Url.Action("Create", "Resource")') }); return false; } partial view- Create function SaveResource() { var obj = []; var EmpID = $('#EmpID').val(); var FirstName = $('#FirstName').val(); var LastName = $('#LastName').val(); var Salary = $('#Salary').val(); if ($("#IsActive").attr('checked', true)) { var IsActive = 1; } else { var IsActive = 0 } var newrecord = { "EmpID": EmpID, "FirstName": FirstName, "LastName": LastName, "Salary": Salary, }; var senddata = JSON.stringify(newrecord); jQuery.ajax({ type: "POST", url: '@Url.Action("Create", "Resource")', data: JSON.stringify({ "data": senddata }), datatype: 'json', contentType: "application/json; charset=utf-8", success: function (result) { if (result == true) { window.location.href = '@Url.Action("ManageResource", "Resource")'; } else { $("#CreatePopup").html(result); } } }); } @using (Html.BeginForm()) { @Html.AntiForgeryToken() @Html.ValidationSummary(false) @Html.LabelFor(model => model.EmpID, "Employee ID", new { @class = "control-label col-md-1 col-md-3" }) @Html.EditorFor(model => m…
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24969196

http://stackoverflow.com/comment/39846032
has text: You can also try to [Install pybossa on a VM on your local machine using vagrant and virtualbox](http://pybossa.readthedocs.org/en/latest/vagrant_pybossa.html). This is only for getting a Developer environment to test/debug your code locally.
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25035717

http://stackoverflow.com/q/25047834
has title: javascript background horizontal/vertical scroll to element site:beyond 911
has answer: http://stackoverflow.com/a/25048090
type: Question
accepted answer: http://stackoverflow.com/a/25048090
tagged with: javascript
has body: Can someone break down CONCEPTUALLY how this was achieved? http://content.time.com/time/beyond911/ I know it loads "grid.html" which is tiled and depending how you click, becomes "infinite" (try clicking a corner image over and over again). Just not sure how it centers on the element that is clicked, or the use of arrows to select adjacent elements. thanks
has comment: http://stackoverflow.com/comment/38961420
score: 0
answer count: 1
tagged with: jquery
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion

http://stackoverflow.com/q/25062215
tagged with: javascript
score: 0
linked to: http://stackoverflow.com/q/28250680
has comment: http://stackoverflow.com/comment/44861198
tagged with: flatmap
has title: How to memorize value to use it after flatMap?
type: AnsweredQuestion
has body: Bacon.fromArray(list) .flatMap(function(user){ return Bacon.fromCallback(user, 'getClients'); }) .onValue(function(clients){ // need `user` object some how }) ; Need user object in onValue callback
tagged with: bacon.js
has answer: http://stackoverflow.com/a/25094039
accepted answer: http://stackoverflow.com/a/25094039
has comment: http://stackoverflow.com/comment/38988985
type: Question
answer count: 1

http://stackoverflow.com/comment/38791097
type: AnswerComment
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24957997
has text: Point for you, but its hard to give someone slack when its an insanely easy question to Google.

http://stackoverflow.com/a/25115920
score: 0
answers question: http://stackoverflow.com/q/25053082
type: Answer
has body: yes, I am having a similar issue. For me, getCurrentTime() returns 0, but not always - when I play a youtube video, it works fine, but when I play a brightcove video following the youtube video, then go back to the youtube, it returns 0. Other people have issues that resemble this, there was a discussion here: https://productforums.google.com/forum/#!topic/youtube/F5CEukwhitA the issue seems to be related to conflicts with other libraries, which I also believe is the case with my application. Try to remove other third-party libraries and turn off browser extensions and see if the problem is still there. btw did you try to run the code outside of jsfiddle, i.e. in an app? in my case, the reason why getCurrentTime() was returning 0 was that it was attached to nodes inside detached DOM trees. This is a known case when AngularJS and jQuery are used together, and references to non-existings (deleted) DOM elements remain in jQuery cache. basically, check what node your player is attached to and also if you don't have any replicas. it was the nested o object in the player object that put me on track. PlayerState was 3 all the time, there were no bytes downloaded, etc.

http://stackoverflow.com/comment/38997911
has text: `$('#text')` should be `$('.game-title')`.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25067558

http://stackoverflow.com/a/25021007
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25020279
has body: Why not just use .nextUntil()? jsFiddle It can take a selector to stop at, so just pass in that you want it to go through the siblings until they do :not() have the class .item. The whole thing then shrinks down to - var start_index = 1; $("#theTable&gt;tbody&gt;tr").eq(start_index - 1).nextUntil(":not(.item)").remove(); Though, your information would be semantically better if it was structured as nested elements if the .item is truly a collection related to the preceding row. [edit - although if you only want the index to relate to the non-.items then use the following] var start_index = 1; $("#theTable&gt;tbody&gt;tr:not(.item)").eq(start_index - 1).nextUntil(":not(.item)").remove();
type: Answer
answers question: http://stackoverflow.com/q/25020279
score: 1
upvote count: 1

http://stackoverflow.com/a/59780898
upvote count: 1
answers question: http://stackoverflow.com/q/25059256
downvote count: 0
type: Answer
has body: Fiddler supports modifying the response of http requests. We can use this feature to load userscript in any browser, include IE8. This is an example: static function OnBeforeResponse(oSession: Session) { if (m_Hide304s &amp;&amp; oSession.responseCode == 304) { oSession["ui-hide"] = "true"; } // match url if (oSession.fullUrl == "http://apply.ccopyright.com.cn/goadatadic/getR11List.do") { oSession.utilDecodeResponse(); var script = System.IO.File.ReadAllText("C:\\GitHub\\@selpic\\P660_printer\\Printer\\scripts\\form-save-load.js") oSession.utilReplaceOnceInResponse("&lt;/body&gt;", "&lt;script&gt;"+script+"&lt;/script&gt;&lt;/body&gt;", true); } } doc: Modifying a Request or Response
score: 1

http://stackoverflow.com/a/24962912
has comment: http://stackoverflow.com/comment/38805017
type: AcceptedAnswer
downvote count: 0
has body: One general jQuery solution might be detecting mousedown on the chart-container to disable gridster-dragging, and detecting mouseup in general to enable gridster-dragging. For example using the following code (JSFiddle example): $('#container').mousedown(function() { gridster.disable(); }); $(document).mouseup(function(){ gridster.enable(); }); This would require you to have some area that is not part of the chart-container, but is in the grid (otherwise you would have nowhere to grab the gridster-grid). Or you could be more specific with what elements that should disable the gridster-dragging, when clicked. Seing how .highcharts-navigator doesn't work very well as a selector (and neither does any amount of selectors in that region), I found that this might be one of the easier ways to only disable gridster for the navigator (JSFiddle example): $('#container').mousedown(function(event) { var chart = $('#container').highcharts(); var navTop = $('.highcharts-navigator').offset().top; var navHeight = chart.options.navigator.height + chart.options.scrollbar.height; if(event.pageY &gt; navTop &amp;&amp; event.pageY &lt; navTop + navHeight) { gridster.disable(); } }); $(document).mouseup(function(){ gridster.enable(); });
answers question: http://stackoverflow.com/q/24960994
type: Answer
has comment: http://stackoverflow.com/comment/38801200
score: 1
has comment: http://stackoverflow.com/comment/38804681
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24960994

http://stackoverflow.com/q/25012185
has answer: http://stackoverflow.com/a/57208466
tagged with: javascript
has answer: http://stackoverflow.com/a/25012463
score: 9
answer count: 3
downvote count: 0
favorite count: 0
type: UnansweredQuestion
has title: node.js http server how to get connections count
tagged with: node.js
has body: I'm using node as a http server with the following code: http.createServer(function(req, res) {}).listen(8181); I'm looking for a simple way to monitor a node js http server from within the same process. For me it would be enough to have a own function which just outputs the current resource usage and connection count as json. For now I don't need deep measuring or real time performance monitoring. What are the key performance indicators for a node http server and is it possible to get them from node? If yes how? What you think of the folling kpi's: Connection Count CPU Usage Ram Usage Just need to know which variables/functions I need to get the data? Thx I really appreciate your help
has comment: http://stackoverflow.com/comment/38893481
has answer: http://stackoverflow.com/a/35445766
type: Question
upvote count: 9

http://stackoverflow.com/q/24982708
has body: I've read through every online post I could find about about sorting with the Kendo Grid. Basically I'm trying to find a way to sort by descending first and then ascending after. I know how to set a default sort as descending when the grid loads, but I need this to happen any time a field is sorted. If there is no sort, it should sort by descending first. sortable: { allowUnsort: false SortByDescendingFirst: true &lt;== Something like this },
upvote count: 1
type: Question
has answer: http://stackoverflow.com/a/24985872
type: AnsweredQuestion
score: 1
possible better answer: http://stackoverflow.com/a/68667846
accepted answer: http://stackoverflow.com/a/24985872
has answer: http://stackoverflow.com/a/68667846
has title: Kendo UI Grid - Sort by Descending Before Ascending
answer count: 2
tagged with: kendo-grid
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: kendo-ui
tagged with: angularjs

http://stackoverflow.com/comment/38699075
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24909235
score: 0
has text: It is possible that you are not getting valid json out of that url. what is the current output post that too in the question post above.

http://stackoverflow.com/comment/38772878
type: Comment
comment on: http://stackoverflow.com/a/24946707
type: AnswerComment
has text: You can not put outside because bootstrap dropdown element have this structure. Maybe if you explain more what you wanto to do.
score: 0

socket.io
tags question: http://stackoverflow.com/q/24972729
type: Tag
tags question: http://stackoverflow.com/q/24986608
tags question: http://stackoverflow.com/q/25010563
tags question: http://stackoverflow.com/q/24994916
tag name: socket.io
tags question: http://stackoverflow.com/q/25006750
tags question: http://stackoverflow.com/q/25042009
tags question: http://stackoverflow.com/q/25023118
tags question: http://stackoverflow.com/q/25013735
tags question: http://stackoverflow.com/q/25020364
tags question: http://stackoverflow.com/q/25038195
tags question: http://stackoverflow.com/q/25001514
tags question: http://stackoverflow.com/q/25027166
tags question: http://stackoverflow.com/q/24988020
tags question: http://stackoverflow.com/q/24966476
tags question: http://stackoverflow.com/q/25000275
tags question: http://stackoverflow.com/q/25003695
tags question: http://stackoverflow.com/q/24970087
tags question: http://stackoverflow.com/q/24910456

http://stackoverflow.com/comment/38977634
comment on: http://stackoverflow.com/a/25055281
type: Comment
has text: So you described one way of accessing `Obj.bar` in `Obj.foo.myFunc()`. Can you elaborate on how my answer is wrong?
score: 0
type: AnswerComment

http://stackoverflow.com/q/24957437
tagged with: google-chrome-devtools
tagged with: javascript
score: 6
accepted answer: http://stackoverflow.com/a/24957566
answer count: 1
downvote count: 0
favorite count: 0
upvote count: 6
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24957566
has title: How can I identify where JavaScript files are being called from in Chrome DevTools?
has body: In Chrome Developers Tools, the Sources/Network tabs indicate a site has over 100 external scripts loading. I'm trying to reduce this, however it's very hard to trace where and how each one is being loaded. Only a handful of them are coming from traditional &lt;script&gt; tags in the main src. Others may be dynamically inserted, in iframes etc. Is there any method or tool that would allow me to easily track where each script is loaded?
tagged with: google-chrome
type: Question

http://stackoverflow.com/a/25066474
answers question: http://stackoverflow.com/q/25066397
score: 0
has body: The path is relative to where the page is loaded from, not where the Javascript is loaded from. If the page is in the same folder as the json folder, then the path is: var jsonFile = 'json/baseCosts.json'; The getJSON method only returns the XHR object used to send the request, use the callback function that you can specify in the call to handle the response: function calculate(typeVal, levelVal, jsonFile) { $.getJSON(jsonFile, function(data){ console.log(data); }); }
type: Answer

http://stackoverflow.com/a/25003510
downvote count: 1
has comment: http://stackoverflow.com/comment/38877396
accepted answer of: http://stackoverflow.com/q/25003471
answers question: http://stackoverflow.com/q/25003471
has comment: http://stackoverflow.com/comment/38877417
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38877678
has comment: http://stackoverflow.com/comment/38877054
has body: It does. It's called setTimeout(). The common JavaScript environments (the browser and node.js) are single threaded and event driven. They need to keep servicing their main event loop. Just flat out stopping the thread will stop the background processes as well, since it depends on the event loop firing. This is common in just about all user-facing environments; Windows, Mac OS, Java swing, Android etc. all require you to keep the main UI thread running; you can't just sleep() on it.
type: Answer
has comment: http://stackoverflow.com/comment/38878236
score: 2
has comment: http://stackoverflow.com/comment/38878343
upvote count: 3

http://stackoverflow.com/comment/38909085
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25020468
has text: All that HTML is redundant. Not to mention `n` will always be 0, so this is not an `nth` selector.

http://stackoverflow.com/comment/38704667
score: 0
type: AnswerComment
has text: Note: This doesn't fire the `.get` to `/otherfile.css` until the first `.get` is complete. This makes this somewhat inefficient in this case and completely unmanageable if you had to fire many more `.get` requests.
comment on: http://stackoverflow.com/a/24910738
type: Comment

http://stackoverflow.com/a/24915845
has comment: http://stackoverflow.com/comment/38712896
type: Answer
has comment: http://stackoverflow.com/comment/38714147
score: 2
has body: You can define the saveUser and addUser functions within the context signIn so that they have access to its parameters and local variables: function signIn (req, res){ var email = req.body.email, name = req.body.name, secondName = req.body.secondName, pass = req.body.pass, bday = req.body.bday; var user = new userModel.user(); user.Email = email; user.Name = name; user.SecondName = secondName; user.Pass.Hash = pass; user.BirthDate = bday; db.model('user').find({Email : email},addUser); function saveUser(err, users){ if(err){ console.log(err); res.send("Not inserted"); }else{ console.log(user); console.log('registered!'); res.send("OKish"); } } function addUser(err,foundUsers){ if(!err &amp;&amp; foundUsers.length === 0){ user.save(saveUser); }else{ console.log(err); console.log(foundUsers); res.send("Not inserted"); } } };
answers question: http://stackoverflow.com/q/24915618
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24915618
has comment: http://stackoverflow.com/comment/38712432
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38713503
has comment: http://stackoverflow.com/comment/38714375

jqplot-highlighter
tag name: jqplot-highlighter
tags question: http://stackoverflow.com/q/24926400
type: Tag

http://stackoverflow.com/comment/38977254
type: QuestionComment
has text: Normally means there is a syntax error somewhere in your javascript (not necessarily in the function itself, but somewhere that is stopping the javascript from parsing correctly). Check the development tools in your browser using F12 (I recommend FireBug for FireFox)
comment on: http://stackoverflow.com/q/25056856
score: 0
type: Comment

http://stackoverflow.com/q/24997792
tagged with: youtube-javascript-api
upvote count: 1
tagged with: youtube-api
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25025820
has body: I want to retrieve a list of videos from a specific channel via JS. I created a project in the Developer Console and added the youtube API v3 as well as a API key. But I can't find a rest call to get a list of videos for a channel. This documentation is driving me crazy. How can I achieve this in the client?
score: 1
has comment: http://stackoverflow.com/comment/38866059
downvote count: 0
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38866317
has comment: http://stackoverflow.com/comment/38866090
accepted answer: http://stackoverflow.com/a/25025820
favorite count: 0
has title: Get a list of videos from a specific channel via JavaScript

http://stackoverflow.com/q/25064153
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38993101
linked to: http://stackoverflow.com/q/16063394
upvote count: 1
has body: What is the preferred idiom for defining a class in JavaScript? I could define a constructor function for complex numbers as follows: function Complex(real, imag) { this.real = real; this.imag = imag || 0.0; this.add = function(other) { this.real += other.real; this.imag += other.imag; return this; } } or I could do the following: function Complex(real, imag) { this.real = real; this.imag = imag || 0.0; } Complex.prototype = { add : function(other) { this.real += other.real; this.imag += other.imag; return this; } } Since neither textbook JavaScript : The Good Parts nor JavaScript The Definitive Guide define classes the first way I suspect these are not equivalent -- I suspect I need use prototype if I plan on using inheritance. This seems a little murky to me -- can anyone clarify this? I know I could use the Object.create() method suggested in the aforementioned texts and do things the prototypical way, but I don't see folks doing this in practice much.
downvote count: 1
has comment: http://stackoverflow.com/comment/38991556
has comment: http://stackoverflow.com/comment/38993441
has title: Preferred JavaScript Idiom for class definition
has answer: http://stackoverflow.com/a/25066352
tagged with: prototype
type: Question
has comment: http://stackoverflow.com/comment/38991313
answer count: 1
tagged with: javascript
favorite count: 0
tagged with: class
score: 0
has comment: http://stackoverflow.com/comment/38991422
has comment: http://stackoverflow.com/comment/38991203

http://stackoverflow.com/comment/39150490
type: AnswerComment
has text: I really think you're missing some basic concepts of Web Programming, like server-side (PHP) VS client-side (HTML/JS/CSS) languages. JsFiddle, as a client-side host, doesn't understand PHP ; and the way you put PHP inside javascript doesn't have any sense. PHP's only role, as a server-side language, is to **generate** a HTML/JS/CSS page. Once the page is on your screen, there is no more PHP - your browser doesn't understand PHP at all.
comment on: http://stackoverflow.com/a/24980784
type: Comment
score: 0

http://stackoverflow.com/comment/38880162
has text: Looks like you might need to do `event.preventDefault()` as well
type: Comment
score: 0
comment on: http://stackoverflow.com/q/25005044
type: QuestionComment

http://stackoverflow.com/q/25065182
tagged with: javascript
score: 0
tagged with: ng-options
answer count: 1
tagged with: angularjs
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38993489
type: AnsweredQuestion
tagged with: angularjs-ng-options
has answer: http://stackoverflow.com/a/25065319
has body: I have ngOptions in one of my select elements connected to an array I made in the controller, and it's just not showing any values. I must be doing something stupid. I know for sure that Angular is working, and the controller must be working because I use an expression related to an ngModel in the same div (using the same controller) and it works fine. This is the relevant snippet of my html: Categorize This is my js file: var tagQuestionnaireApp = angular.module('tagQuestionnaireApp', []); tagQuestionnaireApp.controller('taggingController', ['$scope', function($scope) { $scope.categories = [ {text:'Humanities', topics:[{name:"Arts and Design",color:"#ff3d00"}, {name:"History",color:"#ffc107"}, {name:"Linguistics",color:"#ffab00"}, {name:"Literature",color:"#ff7043"}, {name:"Philosophy",color:"#dd2c00"}, {name:"Theology",color:"#ff6f00"}, {name:"Other Humanities",color:"#ff5722"}]}, {text:'Social Sciences', topics:[{name:"Anthropology",color:"#"}, {name:"Archaeology",color:"#"}, {name:"Cultural/Ethnic/Area Studies",color:"#"}, {name:"Economics",color:"#"}, {name:"Gender/Sexuality Studies",color:"#"}, {name:"Geography",color:"#"}, {name:"Political Science",color:"#"}, {name:"Psychology",color:"#"}, {name:"Sociology",color:"#"}, {name:"Other Social Sciences",color:"#"}]}, {text:'Natural Sciences', topics:[{name:"Space sciences",color:"#00695c"}, {name:"Earth sciences",color:"#8bc34a"}, {name:"Biology",color:"#64dd17"}, {name:"Chemistry",color:"#00bfa5"}, {name:"Physics",color:"#009688"}, {name:"Material Sciences",color:"#0a7e07"}, {name:"Other Natural Sciences",color:"#259b24"}]}, {text:'Engineering', topics:[{name:"Mechanical",color:"#"}, {name:"Chemical",color:"#"}, {name:"Civil",color:"#"}, {name:"Electrical",color:"#"}, {name:"Other Engineering",color:"#"}]}, {text:'Formal Sciences', topics:[{name:"Applied Math",color:"#738ffe"}, {name:"Computer Science",color:"#7986cb"}, {name:"Logic",color:"#5c6bc0"}, {name:"Pure Math",color:"#4e6cef"}, {name:"Statistics",color:…
type: Question
has comment: http://stackoverflow.com/comment/38993246
has title: ngOptions isn't showing any options in my select element
accepted answer: http://stackoverflow.com/a/25065319

http://stackoverflow.com/q/24951137
accepted answer: http://stackoverflow.com/a/24951168
favorite count: 0
has answer: http://stackoverflow.com/a/24951289
possible better answer: http://stackoverflow.com/a/24951289
upvote count: 3
has answer: http://stackoverflow.com/a/29705663
has answer: http://stackoverflow.com/a/24951168
answer count: 4
has title: Javascript string replacement (a more elegant way)
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24951300
type: Question
type: AnsweredQuestion
score: 3
has body: I have a string: var myString = 'Some text {{more text}} next text'; And I am trying to replace {{ and }} with &lt;span&gt; and &lt;/span&gt;. I have done this by doing: var myString = 'Some text {{more text}} next text'; myString = myString.replace(/\{\{/, '&lt;span&gt;'); myString = myString.replace(/\}\}/, '&lt;/span&gt;'); console.log(myString); However this seems messy, is there an approach that is more elegant?

http://stackoverflow.com/comment/39238461
score: 0
has text: @user3381910 Yes, you can
comment on: http://stackoverflow.com/a/24989366
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24997331
type: Answer
answers question: http://stackoverflow.com/q/24997186
has body: I think you need to get the literal html out of it instead of text: for example if you are using jquery something like this: $('.example').html();
score: 0

http://stackoverflow.com/a/25004474
answers question: http://stackoverflow.com/q/25004467
score: 2
has body: Try function getWords() { var verb = document.getElementById("verb").value; var noun = document.getElementById("noun").value; document.getElementById("output").innerHTML = "You chose " +verb+ " as your verb, and " +noun+ " as your noun"; } value holds the text in an input whereas innerHTML represents the HTML in an element. Therefore you need to read the values of the inputs and store them in the HTML of the paragraph element.
has comment: http://stackoverflow.com/comment/38878884
upvote count: 3
has comment: http://stackoverflow.com/comment/38878853
type: AcceptedAnswer
downvote count: 1
has comment: http://stackoverflow.com/comment/38878935
accepted answer of: http://stackoverflow.com/q/25004467
type: Answer

http://stackoverflow.com/q/24958422
tagged with: javascript
tagged with: variables
tagged with: jquery
has body: I have a simple thing like this: function init() { var $something = 'something'; } jQuery(document).ready(function($) { init(); alert($something); } I thought this would work, but it doesn't, console says that $something is not defined. What's the issue? Many thanks!
score: 0
answer count: 3
has title: Accessing variables from within jQuery Document Ready
favorite count: 0
has comment: http://stackoverflow.com/comment/38791898
has answer: http://stackoverflow.com/a/24958473
upvote count: 1
has comment: http://stackoverflow.com/comment/38791900
type: AnsweredQuestion
tagged with: global-variables
downvote count: 1
has answer: http://stackoverflow.com/a/24958561
has comment: http://stackoverflow.com/comment/38791877
type: Question
possible better answer: http://stackoverflow.com/a/24958473
has answer: http://stackoverflow.com/a/24958486
accepted answer: http://stackoverflow.com/a/24958486

http://stackoverflow.com/q/24916902
has comment: http://stackoverflow.com/comment/38714330
tagged with: javascript
has comment: http://stackoverflow.com/comment/38715461
has comment: http://stackoverflow.com/comment/38716086
score: 0
has comment: http://stackoverflow.com/comment/38715325
has answer: http://stackoverflow.com/a/24917019
answer count: 1
has comment: http://stackoverflow.com/comment/38714436
has title: How to access nested object info for nested functions
tagged with: angularjs
type: UnansweredQuestion
has body: I'm writing an app in Angular and have something like this: $scope.items = [ {'name':'someName', 'title': 'someTitle', 'filter': function(item){ Filters.setTableTitle(this.title); //cannot get title ... } }, {'name':'someName', 'title': 'someTitle', 'filter': function(item){ Filters.setTableTitle(this.title); ... } } ]; An array of objects. Part of each object is a function, and inside the function I would like to call a function that grabs the title of that object itself in order to pass it into a greater scope for the rest of the app. However, I can't grab the title for each object. How would I access the title in order to use it here? Thanks. Update Here is my HTML that uses (something very similar to) the code above. I'm using the code to create buttons. &lt;p ng-repeat="link in items"&gt; &lt;block class="button" href="{{link.URL}}" title="{{link.title}}"&gt; &lt;a class="hrefLink" href="{{link.URL}}" ng-click="Filters.setFilter(link.filter, link.title)"&gt; {{link.name}} &lt;/a&gt; &lt;/block&gt; &lt;/p&gt; The function held within the filter part of each object returns information that is then passed into Filters.setFilter() which updates the DOM. Filters.setFilter() service.setFilter = function(filter, title){ service.searchTerm = ''; $spMenu.hide(); //close nav if open service.selectedFilter = filter; service.setTableTitle(title); //this does the job }; I've rearranged the ways these functions work, and now simply pass in the title to the different functions. This gets the job done for what I want, but still could never solve the initial question at hand--how would I access part of an object from inside the object?
tagged with: object
type: Question
has comment: http://stackoverflow.com/comment/38714342

http://stackoverflow.com/a/25018797
type: Answer
has body: Because your elements are inline-block elements they will be vertically aligned to the baseline by default. As one of your elements is a different size from the others this is causing a box to appear lower. By setting them to vertical-align:top it solves this issue See this post for more information about inline-block alignment By adding display:block to the image it will remove the extra space added after the image and thus will make all your .thumb-container elements the same height again See this post about the space after the image
accepted answer of: http://stackoverflow.com/q/25018609
has comment: http://stackoverflow.com/comment/38910209
upvote count: 3
answers question: http://stackoverflow.com/q/25018609
type: AcceptedAnswer
downvote count: 0
score: 3

http://stackoverflow.com/q/25037570
tagged with: javascript
tagged with: jquery
has title: DragDealer slider javascript widget - which files to embed in page?
accepted answer: http://stackoverflow.com/a/25037987
has body: I want to use DragDealer slider library in my project. According to the developer, it's only 12KB, and indeed the dragdealer.min.js file is ~13KB. However, in the [lib] folder there are other 5 files that seems to be needed as well (jasmine.js, jasmine-html.js, hasmine-jquery.js, jquery.simulate.js and jasmine.css). When I try to run the code with only the .JS plugin file, the slider doesn't work. Can you please help me understand which files I need to embed in my project in order for it to work with the lowest file size as described by the developer. quote: "The basic way to install Dragdealer is to include the minified script into your web page." The project page The GitHub repository
tagged with: dragdealer-js
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25037987
type: Question
score: 0
answer count: 1

http://stackoverflow.com/comment/38868559
comment on: http://stackoverflow.com/a/24999129
type: Comment
has text: Thank you for answer @Serlite . Your example of code is working perfectly. Thanks a lot.
score: 0
type: AnswerComment

http://stackoverflow.com/a/25036268
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25036227
has body: When i is accessed by either next or hasNext, they don't find an i in their own closure, so they look up one closure and find an i in the closure of values (the closure in which var i happens) This means changes to and reads from i in those two functions both share the same i
type: Answer

http://stackoverflow.com/comment/39002242
comment on: http://stackoverflow.com/q/25068984
has text: @bergi here is the full code http://pastebin.com/Xc5CY7Lx
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38909186
type: AnswerComment
comment on: http://stackoverflow.com/a/24985037
type: Comment
has text: Yeah, `open` is the only way probably =( but then I need a sure way to detect whether the click would open the link in a new tab. A normal left click shouldn't do the `open`.
score: 0

http://stackoverflow.com/a/49184478
has body: $index works fine when the ng-repeat is not filtered. If you use a filter, it might be better to use indexOf(). Example: {{costomers.indexOf(cust) + 1}}
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24981322
upvote count: 2
score: 2

http://stackoverflow.com/a/25063055
has comment: http://stackoverflow.com/comment/39085470
type: Answer
downvote count: 2
has comment: http://stackoverflow.com/comment/39100808
has body: Blocking refers to the fact that while that recognizer is running, no other UI or Javascript code can run. Well-behaved applications try to avoid getting into slow loops in Javascript, because they make the page non-responsive. This is why most things that involves delays or waiting for something (such as the response to an AJAX request) use asynchronous callbacks rather than synchronous return values. It sounds like the code of these recognizers is not written in an asynchronous manner. This may be necessary because the gestures would mistakenly be recognized as dragging if the recognizers allowed other code to run at the same time.
score: 0
answers question: http://stackoverflow.com/q/25062659
upvote count: 2

http://stackoverflow.com/q/24959248
has comment: http://stackoverflow.com/comment/38793377
has answer: http://stackoverflow.com/a/24960155
tagged with: javascript
has title: jquery select several elements with a short code
accepted answer: http://stackoverflow.com/a/24960155
score: 2
has comment: http://stackoverflow.com/comment/38793335
type: AnsweredQuestion
tagged with: jquery-selectors
downvote count: 0
has comment: http://stackoverflow.com/comment/38793453
tagged with: jquery
has comment: http://stackoverflow.com/comment/38794051
favorite count: 0
type: Question
possible better answer: http://stackoverflow.com/a/24959330
answer count: 2
has answer: http://stackoverflow.com/a/24959330
has comment: http://stackoverflow.com/comment/38794555
upvote count: 2
has body: i want to select several elements with jquery like this: $('p:nth-child(1),p:nth-child(4),p:nth-child(7),p:nth-child(10)') //nth-child is : 1,4,7,10,13,16,19,22 and etc I have to select 1 item every 3 items. How can do this with dynamic code?

http://stackoverflow.com/q/25035281
favorite count: 0
has comment: http://stackoverflow.com/comment/38937646
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25035399
downvote count: 1
has comment: http://stackoverflow.com/comment/38938049
score: -1
has body: So this is what I'm trying to achieve: 1) When the mobile nav button is clicked - open the main nav and add a class of 'active' to the main nav, and a class of 'dark-header' to the header. 2) Check if the main nav has a class of 'active', if it does then loop through each of the list items in the main nav and fade them in one by one. (Preferably from the top left but I haven't figured out how to do that yet) The code I have works at the minute to a certain extent but the nav items do not fade in so there is something not quite right. It does this instead: when the mobile nav button is clicked the menu opens, a class of 'active' is added to the main nav and also a class of dark header is added to the header but I just can't seem to get the main nav items to fade in from top left on after the other, instead they just appear onClick. Here is the HTML code I have so far: Home About Services Portfolio Pricing Contact Here is the jQuery code I have so far (Sorry if it's a mess, I just started learning jQuery): $('#mobnav-btn').click(function(){ $('.main-nav').toggleClass("active"); $(this).parents('.site-header').toggleClass('dark-header'); if ( $('.main-nav').hasClass(".active") ) { $('.main-nav li').each(function(index, element) { $(element).delay(index*50).fadeIn(400); }); }; }); Any ideas on where I'm going wrong on this one or any help at all is greatly appreciated.
type: Question
upvote count: 0
has title: onClick fade in list items
tagged with: javascript
has answer: http://stackoverflow.com/a/25036404
tagged with: jquery
has answer: http://stackoverflow.com/a/25035416
has comment: http://stackoverflow.com/comment/38937453
answer count: 3
tagged with: http://stackoverflow.com/tag/html
tagged with: css

http://stackoverflow.com/comment/39017411
score: 0
type: Comment
has text: Maybe use IE instead?
comment on: http://stackoverflow.com/a/24984468
type: AnswerComment

http://stackoverflow.com/a/25042198
has comment: http://stackoverflow.com/comment/38970741
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25041465
type: Answer
accepted answer of: http://stackoverflow.com/q/25041465
has body: I had success by modifying your code a bit. Main changes: I changed the .twitter class reference to .twitter-count to match your HTML I removed your getTwitterLink function and just performed the each() directly. I replaced $target.function(twitterCount($target)) with twitterCount($target) This was the big syntax error. Other changes in code comments below. function twitterCount($target) { /* I simplified "parent().parent()" to "closest()" */ articleHREF = $target.closest('ul').attr('data-href'); APIURL = 'https://cdn.api.twitter.com/1/urls/count.json'; $.getJSON(APIURL + "?callback=?&amp;url=" + articleHREF, function (data) { /* I changed ".twitter" to ".twitter-count" to match the class in your HTML */ $target.find('.twitter-count').html(data.count); }).fail( function(d, textStatus, error) { /* I added this fail handler, just in case */ console.error("getJSON failed, status: " + textStatus + ", error: "+error) }); } $twitterLink = $('a.twitter'); /* I removed the function here as it didn't seem necessary */ $twitterLink.each(function () { $target = $(this); /* Your function call here threw a syntax error. Replaced `$target.function(twitterCount($target))` with `twitterCount($target)` */ twitterCount($target); }); Working Example

http://stackoverflow.com/comment/38705311
comment on: http://stackoverflow.com/a/24912272
type: AnswerComment
score: 0
type: Comment
has text: i want support it to IE8 also. That's why i am trying to do with Jquery and Tweenmax.

http://stackoverflow.com/q/24932345
linked to: http://stackoverflow.com/q/4374822
downvote count: 0
linked to: http://stackoverflow.com/q/1144783
tagged with: string
favorite count: 0
answer count: 5
has answer: http://stackoverflow.com/a/24932641
accepted answer: http://stackoverflow.com/a/24932426
possible better answer: http://stackoverflow.com/a/24932500
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24932549
has answer: http://stackoverflow.com/a/24932500
has title: Removing all instances of a character from a string
type: Question
upvote count: 4
has body: I'm attempting to remove all instances of a given set of characters £$€,. from a string in jQuery/Javascript. I'm using the replace function, however this only appears to remove a single instance of the character and not all of them. For example consider the string: 1,500,00.00.$djdjd£10€10 I get back: 1500,0000.djdjd1010 As you can see, it only removes a single instance of each character. £, $ and € are fine as there is only one of each in the string. Here is what I have so far: function validatePriceRange(value, min, max) { var replacements = ["£", "$", "€", ",", "."]; $.each(replacements, function (index, item) { value = value.replace(item, ""); }); var value = parseInt(value, 10); return value &gt;= min &amp;&amp; value &lt;= max; } jsFiddle Can anyone spot what I've done wrong?
tagged with: javascript
tagged with: jquery
score: 4
has answer: http://stackoverflow.com/a/24932412
tagged with: replace
has answer: http://stackoverflow.com/a/24932426

http://stackoverflow.com/a/24932440
has body: It looks like your CSS is not loaded properly. Browser hang may be of many reasons. May be a long wait for the data from back-end(if sync call is sent). Recursion of a loop with no valid data. Dependency of the grid on the other grid/data-source which's not available when rendering.
answers question: http://stackoverflow.com/q/24932075
type: Answer
has comment: http://stackoverflow.com/comment/38745916
score: 0
has comment: http://stackoverflow.com/comment/38743317

http://stackoverflow.com/a/24953674
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24953582
score: 1
type: Answer
has body: [].forEach.call(document.querySelectorAll("input"), function(input) { input.addEventListener("change", fnName, false); input.addEventListener("blur", fnName, false); });
has comment: http://stackoverflow.com/comment/120188568

git
tags question: http://stackoverflow.com/q/25043479
tags question: http://stackoverflow.com/q/25030145
tags question: http://stackoverflow.com/q/24976950
tag name: git
type: Tag

http://stackoverflow.com/a/25002975
has body: We can first build up a nested array that represent the hierarchy. Then print out the list tags recursively: $rows = array( array('UserName' =&gt; 'Jimmy', 'Placement' =&gt; '', 'Position' =&gt; 'left'), array('UserName' =&gt; 'JLO', 'Placement' =&gt; 'Jimmy', 'Position' =&gt; 'left'), array('UserName' =&gt; 'Shinobi', 'Placement' =&gt; 'JLO', 'Position' =&gt; 'left'), array('UserName' =&gt; 'trialuser4', 'Placement' =&gt; 'JLO', 'Position' =&gt; 'right'), array('UserName' =&gt; 'donald_duck', 'Placement' =&gt; 'trialuser4', 'Position' =&gt; 'left'), array('UserName' =&gt; 'minnie_mouse', 'Placement' =&gt; 'donald_duck', 'Position' =&gt; 'left'), array('UserName' =&gt; 'mickeymouse', 'Placement' =&gt; 'donald_duck', 'Position' =&gt; 'right'), array('UserName' =&gt; 'dr_octopus', 'Placement' =&gt; 'mickeymouse', 'Position' =&gt; 'left'), array('UserName' =&gt; 'dr_cucumber', 'Placement' =&gt; 'dr_octopus', 'Position' =&gt; 'left'), array('UserName' =&gt; 'mr_brown111', 'Placement' =&gt; 'dr_octopus', 'Position' =&gt; 'right'), ); $nested_lists = array(); $user_lists = array(); foreach ($rows as $row) { $placement = $row['Placement']; $user = $row['UserName']; if ($placement == '') { $nested_lists[$user] = array(); $user_lists[$user] = &amp;$nested_lists[$user]; } else { $pointer = &amp;$user_lists[$placement]; $pointer[$user] = array(); $user_lists[$user] = &amp;$pointer[$user]; } } function build_list($arr) { if (count($arr) == 0) { return ''; } $html = "&lt;ul&gt;"; foreach ($arr as $k =&gt; $v) { $html .= "&lt;li&gt;$k" . build_list($v) . "&lt;/li&gt;"; } $html .= "&lt;/ul&gt;"; return $html; } echo build_list($nested_lists['Jimmy']); prints JLO Shinobi trialuser4 donald_duck minnie_mouse mickeymouse dr_octopus dr_cucumber mr_brown111
type: Answer
answers question: http://stackoverflow.com/q/24999308
score: 0

http://stackoverflow.com/a/24959346
upvote count: 1
has body: The length of an Array object is simply its highest numeric index plus one. The second object has no numeric indices, so its length is 0. If it were [ A: Object, B: Object, C: Object, 15: Object ], then its length would be 16. The value of length is not tied to the number of actual properties (4 in this case).
downvote count: 0
answers question: http://stackoverflow.com/q/24958960
type: Answer
score: 1

http://stackoverflow.com/a/24935555
type: Answer
has body: This works if you group the items first, but can/t work out how to ungroup afterward var doc = app.activeDocument; var item = doc.pageItems[0]; //doc.hasSelectedArtwork = true; item.resize( 50.0, // x 60.0, // y true, // changePositions true, // changeFillPatterns true, // changeFillGradients true, // changeStrokePattern );
answers question: http://stackoverflow.com/q/24933576
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/38896938
comment on: http://stackoverflow.com/q/25014060
type: Comment
score: 1
type: QuestionComment
has text: ditch the variable assignment and echo, simply have `<?php require "Panels/Project/Main/main.php" ?>` thats all

http://stackoverflow.com/a/25056936
answers question: http://stackoverflow.com/q/25056856
type: Answer
has comment: http://stackoverflow.com/comment/38978098
score: 0
has body: As per my comment, there is a javascript error here... if (fname == String. &amp;&amp; lname == '' &amp;&amp; email == '' &amp;&amp; pwd == '' &amp;&amp; cpwd == '' &amp;&amp; emailExp == '') { Instead of fname == String., replace it with fname == '' That should give you... if (fname == '' &amp;&amp; lname == '' &amp;&amp; email == '' &amp;&amp; pwd == '' &amp;&amp; cpwd == '' &amp;&amp; emailExp == '') { You also probably want to replace all the other if statements as well, as they are all checking for a single space, when I think you want to check for an empty string. So replace (for example)... if (fname == ' ') { With... if (fname == '') {
has comment: http://stackoverflow.com/comment/38978115

http://stackoverflow.com/a/24918074
has comment: http://stackoverflow.com/comment/38716701
has comment: http://stackoverflow.com/comment/38717101
has body: Embrace the power of this. onClick="rem(this)" This will pass a reference to the clicked element. From there you can then traverse the DOM, using parents and children, to locate other elements, without having to deal with messy IDs.
type: Answer
answers question: http://stackoverflow.com/q/24917800
has comment: http://stackoverflow.com/comment/38717199
score: 0

http://stackoverflow.com/q/25035409
downvote count: 0
has answer: http://stackoverflow.com/a/25035494
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38936935
has answer: http://stackoverflow.com/a/25035505
accepted answer: http://stackoverflow.com/a/25035505
tagged with: javascript
answer count: 3
upvote count: 1
has comment: http://stackoverflow.com/comment/38936796
tagged with: jquery
has body: I want to replace text from selected to another using "ondblclick" event and jQuery library. Here my simple html code: 1 2 3 And jQuery code: function PutValue(){ var _val = $(this).text(); $("#text_inp").val(_val); } And console error: Uncaught TypeError: Cannot call method 'toLowerCase' of undefined
has title: Replace text from to
favorite count: 0
possible better answer: http://stackoverflow.com/a/25035452
has answer: http://stackoverflow.com/a/25035452
type: AnsweredQuestion

http://stackoverflow.com/comment/117813215
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/49420913
has text: The underscore _ is a reference to Lodash. https://lodash.com/

http://stackoverflow.com/a/25023124
answers question: http://stackoverflow.com/q/25022999
has comment: http://stackoverflow.com/comment/38917147
has body: If you're talking about passing in the global DOM context then you shouldn't have to pass anything. context will default to undefined and passed into the jQuery selector (which is the same value it would have if you just called $("#my_id"))
has comment: http://stackoverflow.com/comment/38917571
has comment: http://stackoverflow.com/comment/38915015
score: 0
type: Answer

http://stackoverflow.com/comment/40505149
comment on: http://stackoverflow.com/a/25630300
type: Comment
has text: hernan, i already got this i need to a set primary image among the images from server to set as album thumbnail..
score: 1
type: AnswerComment

http://stackoverflow.com/comment/137032005
comment on: http://stackoverflow.com/a/24915667
score: 0
type: AnswerComment
has text: This one works with BS 5, the others don't work
type: Comment

http://stackoverflow.com/a/24997768
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24997724
has comment: http://stackoverflow.com/comment/38868466
score: 1
has body: Why not check for it with good old typeof commonObjectName != 'undefined'? It will do the check first and only if it succeeds in finding commonObjectName it will then try to match it by type, then repeat same for objectB on formB. var commonObjInstanceOfFormA = typeof commonObjectName != 'undefined' &amp;&amp; commonObjectName instanceof FormAJavascript; var commonObjInstanceOfFormB = typeof commonObjectName != 'undefined' &amp;&amp; commonObjectName instanceof FormBJavascript; if(commonObjInstanceOffFormA) { //do something } else { //do something else }
downvote count: 0

facebook-login
tags question: http://stackoverflow.com/q/24967293
tags question: http://stackoverflow.com/q/25017588
tags question: http://stackoverflow.com/q/25068844
type: Tag
tag name: facebook-login

http://stackoverflow.com/q/24928895
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24929238
has body: Hi I have problem to be solved.I read data from database setting data to text value in javascript .But the value data does not seen in page correctly.For example if the value is equal to value="hello friends " only "hello" is seen . How can I solve this problem. Here is code :- show data:- only Lütfen is seen.. BlockCode:- StringBuilder sb = new StringBuilder(); List<LoginVO> loginVO = new List<LoginVO>(); loginVO = formBUS.Login(GrpID); login = loginVO[0].Value; sb.AppendLine(" "); sb.AppendLine(" " + Type + ": "); //SaveData(icerik); sb.AppendLine(" "); //sb.AppendLine(" " + dr["DrpBanner2"].ToString() + " "); // icerik = dr["DrpBanner2"].ToString(); sb.AppendLine(" "); //icerik = dr["DrpBanner2"].ToString(); //SaveData(icerik); sb.AppendLine(" "); LitformSon.Text += sb.ToString();
accepted answer: http://stackoverflow.com/a/24929238
type: Question
tagged with: asp.net-mvc
tagged with: default-value
tagged with: javascript
score: 0
has title: Reading data from database and setting data to value in input type in html
answer count: 1
has comment: http://stackoverflow.com/comment/38736431
tagged with: text

http://stackoverflow.com/q/25035590
has body: I got a strange problem. I am working at my JS-only-lightbox to support multiple images ( https://github.com/felixhagspiel/jsOnlyLightbox for those who are interested ). So I am not using jQuery. Now I want to add the possibility to add animations via CSS3-transitions. What I do is to add the class jslghtbx-animating-next to the image inside the lightbox, once the next-arrow has been clicked. The image has an transition: all .6s ease-in-out; property, and the class jslghtbx-animating-next contains nothing but margin-left: -100%;. But the image isnt animated, it just pops to the new position. On the other hand, when I use opacity instead, it works. When I apply the margin-left-property via firebug, the animation also works. I thought maybe it is because the image has margin-left: auto; per default, but removing that didn`t do the trick. Testingserver: http://testing.felixhagspiel.de/index.html Zip-File: http://testing.felixhagspiel.de/jsOnlyLightbox.rar You have to click on one of the images below the headline "Use groups to show multiple images" and then click on the right arrow (only next-function is in there so far). I also added a delay of 5sec for easier debugging. Any help would be great!
has comment: http://stackoverflow.com/comment/38937817
upvote count: 1
type: AnsweredQuestion
score: 1
tagged with: css-transitions
has comment: http://stackoverflow.com/comment/38940288
type: Question
has title: CSS3 transition not working when adding classes via javascript
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25037781
favorite count: 0
accepted answer: http://stackoverflow.com/a/25037781
has comment: http://stackoverflow.com/comment/38940671
has comment: http://stackoverflow.com/comment/38937138
tagged with: css

http://stackoverflow.com/q/24938087
has comment: http://stackoverflow.com/comment/38754242
answer count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/38754744
has comment: http://stackoverflow.com/comment/38754177
tagged with: jquery
has comment: http://stackoverflow.com/comment/38753962
favorite count: 0
has comment: http://stackoverflow.com/comment/38754684
has comment: http://stackoverflow.com/comment/38754284
has comment: http://stackoverflow.com/comment/38754566
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38754217
accepted answer: http://stackoverflow.com/a/24938442
has comment: http://stackoverflow.com/comment/38754315
upvote count: 4
tagged with: css
has title: Change CSS at a certain scroll level via jQuery doesn't work
has comment: http://stackoverflow.com/comment/38754049
has comment: http://stackoverflow.com/comment/38754179
has comment: http://stackoverflow.com/comment/38754792
type: AnsweredQuestion
has body: The following jQuery code: Click here HTML: &lt;header class="header"&gt; &lt;div class="navbar"&gt; Hello &lt;/div&gt; &lt;/header&gt; CSS: .header { background-color: black; height: 1000px; width: 300px; color: white; text-align: center; padding: 30px; } .fixed .navbar{ border: 10px solid red; position: fixed; background-color: white; } .navbar { background-color: blue; height: 50px; width: 300px; color: white; } JS: $(window).scroll( function(){ if($(window).scrollTop() &gt; 200) $("header").addClass("fixed"); else $("header").removeClass("fixed"); }); does work. But when I add it to my homepage, I have to refresh the page for the "fixed" class to be added. But I want the class to be added live, while scrolling down, without the page having to be refreshed. This works in jsfiddle, why doesnt it work on my page? My page: Click here
has answer: http://stackoverflow.com/a/24938442
tagged with: scroll
possible better answer: http://stackoverflow.com/a/24938254
has answer: http://stackoverflow.com/a/24938254
has comment: http://stackoverflow.com/comment/38754366
has comment: http://stackoverflow.com/comment/38754226
type: Question
score: 3
has comment: http://stackoverflow.com/comment/38754346
has comment: http://stackoverflow.com/comment/38754314
tagged with: javascript
has comment: http://stackoverflow.com/comment/38754016
has comment: http://stackoverflow.com/comment/38754389

http://stackoverflow.com/a/24973867
has comment: http://stackoverflow.com/comment/38821506
type: Answer
has comment: http://stackoverflow.com/comment/38821331
has body: Since you're using jQuery, you may as well use jQuery's event binding, like so: $(document).ready(function(){ var clearedOnce = false; $(this).on('focus', '#telid01', function () { if (!clearedOnce) { $(this).val(''); clearedOnce = true; } }); }); Edit: If you attach the event to 'document' then pass the id as a selector to on() it should work, and should be able to attach the event even without the field existing on the page yet. See: http://api.jquery.com/on/
score: 1
answers question: http://stackoverflow.com/q/24973813
has comment: http://stackoverflow.com/comment/38822920
upvote count: 1
has comment: http://stackoverflow.com/comment/38821262
has comment: http://stackoverflow.com/comment/38821456
downvote count: 0

http://stackoverflow.com/comment/38738861
score: 0
comment on: http://stackoverflow.com/a/24929933
type: Comment
type: AnswerComment
has text: I cant use '#checkbox1' Its dynamically populated. Unless the id can be returned on ANY checkbox's ontick event

http://stackoverflow.com/q/25001702
upvote count: 1
has comment: http://stackoverflow.com/comment/39069478
has body: HTML: &lt;div id="obj"&gt;&lt;/div&gt; in jQuery: var obj = $('#obj'); obj instanceof jQuery; 'true' So, I assumed that angular.module('app', []) instanceof angular.module() to be true.. Instead I get: Error: [$injector:nomod] http://errors.angularjs.org/1.3.0-beta.17/$injector/nomod?p0=undefined ... ok so try: app instanceof angular.module false app.isPrototypeOf(angular.module) false app.isPrototypeOf(angular) false What am I missing here? How do I check that an object is an instance of angular? Other confusing things: typeof angular "object" typeof app "object" app instanceof angular TypeError: Expecting a function in instanceof check, but got # ^^ if angular is an object and app is an object, why is it expecting a function? Object.keys(app); //returns _configBlocks: Array[0] _invokeQueue: Array[0] _runBlocks: Array[0] animation: function (){f[e|| config: function (){f[e|| constant: function (){f[e|| controller: function (){f[e|| directive: function (){f[e|| factory: function (){f[e|| filter: function (){f[e|| name: "app" provider: function (){f[e|| requires: Array[0] run: function (a){n.push(a);return this} service: function (){f[e|| value: function (){f[e|| __proto__: Object ^^ where is the .prototype? How can I determine that an object is an instance of an angular object?
has comment: http://stackoverflow.com/comment/39033807
type: Question
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/39033703
has comment: http://stackoverflow.com/comment/38874204
tagged with: angularjs-module
has comment: http://stackoverflow.com/comment/39034737
has title: Check that an object is instanceof angular
tagged with: angularjs
answer count: 0
type: UnansweredQuestion

http://stackoverflow.com/a/25046806
has comment: http://stackoverflow.com/comment/38959220
type: Answer
score: 2
downvote count: 0
upvote count: 2
has body: While null is equivalent to +0 when used in arithmetic expressions, it doesn't actuall have the value +0. null is null, and if you compare it to something that is not null then it will be false.
has comment: http://stackoverflow.com/comment/38958980
answers question: http://stackoverflow.com/q/25046756
has comment: http://stackoverflow.com/comment/38959242

http://stackoverflow.com/q/24965295
possible better answer: http://stackoverflow.com/a/24965437
tagged with: javascript
has answer: http://stackoverflow.com/a/24965382
accepted answer: http://stackoverflow.com/a/24965382
answer count: 2
upvote count: 1
tagged with: jquery
favorite count: 0
has body: So I have a DOM element that looks like this: text some more text even more text here maybe some text here My question is how do I swap text for candy so it looks like this: text some more text even more *candy* here maybe some text here I've tried a .replace with regex already but it swaps all the text occurrences. Also I do not know where the text without tags will be. It could be in the middle at the beginning or at the end, (basically anywhere) I can't remove the child nodes either, because I don't know their positions and also if there is a child it would probably rerun when I add it again at the end of all the text manipulation. Can anyone point me in the right direction?
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
downvote count: 0
score: 1
has answer: http://stackoverflow.com/a/24965437
type: Question
has title: Swapping text in a DOM element with children JavaScript/jQuery

http://stackoverflow.com/q/25037262
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has title: How can I re-format dates coming out of FullCalendar?
favorite count: 0
has comment: http://stackoverflow.com/comment/38940493
has comment: http://stackoverflow.com/comment/38940025
has answer: http://stackoverflow.com/a/25038572
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38940775
upvote count: 1
type: Question
score: 1
tagged with: fullcalendar
has comment: http://stackoverflow.com/comment/38940763
has body: I am using the below code to show a tooltip on each event: eventAfterRender: function (event, element) { element.popover({ animation: false, container: '#calendar', content: 'The selected booking starts at ' + event.start + ' and ends at ' + event.end, placement: 'auto', title: event.title }); }, but the message ends up as The selected booking starts at 1404345600000 and ends at 1404345600000. How can I make the format in this message DD-MM-YY? Edit: There is a function parseDate available. What is the correct way to wrap it around event.start?

http://stackoverflow.com/comment/38930906
comment on: http://stackoverflow.com/a/25015342
score: 0
type: Comment
has text: hi sorry i was not here i will see and get back to you
type: AnswerComment

http://stackoverflow.com/a/24977434
type: Answer
accepted answer of: http://stackoverflow.com/q/24973965
score: -5
downvote count: 5
upvote count: 0
type: AcceptedAnswer
has body: you can remove "SMTP" options.
answers question: http://stackoverflow.com/q/24973965

http://stackoverflow.com/q/24946635
has comment: http://stackoverflow.com/comment/38770661
score: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38774984
tagged with: google-maps-api-3
type: Question
tagged with: google-maps-engine
has comment: http://stackoverflow.com/comment/38786566
answer count: 1
downvote count: 0
favorite count: 0
has answer: http://stackoverflow.com/a/25539572
tagged with: shapefile
has comment: http://stackoverflow.com/comment/38775333
has body: I created a map via Google map Engine, (not the lite/pro). And then added an uploaded shapefile given to me as a data source. I've successfully published the map and access links are now available, either for embedding, kml, or the Asset ID. So I've rendered the map inside my application that looks like this : So it's really great, each polygon has a set of attributes, like OBJECTID_1, and so on. What I would like to ask is that, can I have some sort of text area wherein I could type in an value for an attribute (atleast the OBJECTID_1-which is sort of the ID of the polygon/area) and then submit to trigger a click event on that polygon found to show its attributes (like the one shown in the pic), or zoom in to that area. I'm not so familiar with the technology, but given API access, would it be possible via web service/something? Basically how to find a polygon from the numerous polygons defined, given it's OBJECTID_1. Thanks!
tagged with: attributes
has comment: http://stackoverflow.com/comment/38777999
type: UnansweredQuestion
upvote count: 1
has title: Find a polygon by attribute Google map engine

http://stackoverflow.com/q/24977653
type: Question
accepted answer: http://stackoverflow.com/a/24978777
score: 0
answer count: 1
has body: I'm building a simple social network app for iOS with parse and I'm currently working on the relationships, such as follower and following. I have follower and following column in my data browser saved as an array so I can save all the usernames. So this is what I'm having trouble with: Say the current user is viewing a user's profile and clicks follow I need to have the current user's name save in the follower array of the user he/she is viewing. Now as far as I know I can't o this on the client side, and it isn't a good idea anyway for security reasons to do ether. So I want to try to use the Master Key and cloud code to add each of the user's names to their appropriate array. I have never used cloud code before and I want to make sure that this is the best way to do this. I set up the Cloud Code I just don't know where to begin. Any suggestions would be appreciated!
tagged with: ios
tagged with: javascript
has answer: http://stackoverflow.com/a/24978777
type: AnsweredQuestion
has title: Parse master key cloud code following users
tagged with: parse-platform

http://stackoverflow.com/comment/57202464
comment on: http://stackoverflow.com/a/24987513
type: Comment
has text: Just a note that beginning with the 1.0 release we've required a `uib-` prefix for all our directives and have physically removed support for the old directive names due to namespace clashes and native browser elements.
score: 2
type: AnswerComment

http://stackoverflow.com/a/24916876
type: Answer
answers question: http://stackoverflow.com/q/24916788
upvote count: 2
score: 2
downvote count: 0
has body: It is because you are using jQuery's $.ajax and Angular is not notified. You could use $scope.$apply() but that would be hackish. Instead inject the $http service. It will make you life easier. Better yet move all that logic to a factory or a service. It will help you be more DRY.

http://stackoverflow.com/comment/38889778
score: 0
type: QuestionComment
has text: Which line is the error happening on?
type: Comment
comment on: http://stackoverflow.com/q/25010306

http://stackoverflow.com/a/24963009
has comment: http://stackoverflow.com/comment/69835481
type: Answer
upvote count: 4
has body: You need to step back and think about what you're trying to achieve. What's the point of having a state when all it's doing is redirecting to a child state? Regarding your first question, parent states are always activated when you arrive at a child state, this behaviour is extremely useful in sharing data among states, and without it nested routing would be impossible (or rather wouldn't make sense). As for the 2nd question, I've worked on a few big angular apps and so far I haven't found myself needing to do that. OK, believe it or not, as much I'd hate to say it, right now I came across a scenario where I needed to do this. I have a profile/userName route (technically this should be profile/userName/details) and a profile/userName/products route, I wanted to have a master view for both states but at the same time I wanted the profile/userName route have a clean url, like: profile/mike62, NOT profile/mike62/details. So I ended up doing this: .state('publicProfile', { url: '/profile/{username}'})//this is the base/shell state .state('publicProfile.details',{url:null})//I want this to be my de-facto state, with a clean URL, hence the null url .state('publicProfile.products', {url:'/products/{exceptProductId:/?.*}'}) Ended up achieving it like this, there are many ways though: in my publicProfile state controller (this is the base state): $scope.state = $state; $scope.$watch('state.current', function(v) { if(v.name=='publicProfile') {//want to navigate to the 'preferred' state if not going to publicProfile.products $state.go('publicProfile.details'); }; }, true); Yes, it does feel hacky but now I know that there are some edge cases where we want to do this, althopugh we could rethink our state design altogether. Another, dirtier way would be to check the current state in a $timeout with a small delay inside the base state, if we are not on the publicProfile.products state, we navigate to our preferred/de-facto state of publicProfile.details.
has comment: http://stackoverflow.com/comment/38806959
downvote count: 0
score: 4
answers question: http://stackoverflow.com/q/24960288

http://stackoverflow.com/comment/38832703
has text: slice returns a copy of the array, it doesn't change the var it's called on
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24980075
score: 1

jquery-svg
tag name: jquery-svg
type: Tag
tags question: http://stackoverflow.com/q/24968825
tags question: http://stackoverflow.com/q/24951484

http://stackoverflow.com/a/24978315
score: 1
has comment: http://stackoverflow.com/comment/38829756
accepted answer of: http://stackoverflow.com/q/24978101
has comment: http://stackoverflow.com/comment/38841628
has comment: http://stackoverflow.com/comment/38829787
has comment: http://stackoverflow.com/comment/38829818
has comment: http://stackoverflow.com/comment/38829724
type: Answer
has comment: http://stackoverflow.com/comment/38829462
has comment: http://stackoverflow.com/comment/38829882
has comment: http://stackoverflow.com/comment/38829716
answers question: http://stackoverflow.com/q/24978101
has comment: http://stackoverflow.com/comment/38829445
upvote count: 3
downvote count: 2
has comment: http://stackoverflow.com/comment/38829865
has comment: http://stackoverflow.com/comment/38829797
has comment: http://stackoverflow.com/comment/38829906
has comment: http://stackoverflow.com/comment/38829775
has body: angular-ui-bootstrap is port of bootstrap re-written in angular... you can checkout this plunker on how to create modal popup to learn how to create other bootstrap components in angularjs checkout ui-bootstrap var modalInstance = $modal.open({ templateUrl: 'myModalContent.html', controller: ModalInstanceCtrl, size: size, resolve: { items: function () { return $scope.items; } } }); modalInstance.result.then(function (selectedItem) { $scope.selected = selectedItem; }, function () { $log.info('Modal dismissed at: ' + new Date()); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38843852

http://stackoverflow.com/comment/38863194
comment on: http://stackoverflow.com/a/24994641
type: AnswerComment
has text: Perfect. That is an Awesome solution. :)
type: Comment
score: 1

http://stackoverflow.com/q/25002072
has comment: http://stackoverflow.com/comment/38874123
type: Question
has body: I am trying to fix table heading on top during Scroll. It is a Bootstrap theme and i don't want to use any plugin. I have tried with the below code. table heading fix is working with Scroll. But it is leaving CSS when scrolling. No custom CSS used from my side. only Bootstrap Stuff used. HTML ........ ........ ........ ..... .... .... JavaScript function UpdateTableHeaders() { var el = $('.persist-area'); offset = el.offset(); scrollTop = $(window).scrollTop(); floatingHeader = $(".floatingHeader"); if ((scrollTop > offset.top) && (scrollTop < offset.top + el.height())) { floatingHeader.css({ "visibility": "visible" }); } else { floatingHeader.css({ "visibility": "hidden" }); }; } $(function() { var clonedHeaderRow; clonedHeaderRow = $(".persist-header"); clonedHeaderRow .before(clonedHeaderRow.clone()) .css({"width" : clonedHeaderRow.width()}) .addClass("floatingHeader"); if($(".persist-header").hasClass('floatingHeader')){ $(".persist-header th").each(function() { clonedHeaderRowTh = $(this); }); } $(window).scroll(UpdateTableHeaders).trigger("scroll"); });
has title: Fix table heading on top during scroll
linked to: http://stackoverflow.com/q/4709390
score: 0
has comment: http://stackoverflow.com/comment/62108008
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38874264
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38874124
answer count: 0
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/comment/38813059
score: 0
has text: Show us your ChangeSelectedMenuCss method, preferably all of it in a jsfiddle or jsbin.
comment on: http://stackoverflow.com/q/24969616
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24934593
downvote count: 0
answers question: http://stackoverflow.com/q/24934283
score: 1
has body: You should start by breaking this gigantic function down. Simple tip: Principle of single responsibility. Nesting loops squares the number of operations done. I suggest simplifying your data so that it can be done in one loop or a series of loops, and not nested loops. This would mean unnesting the data or structuring it in a way that you can simply do one pass. A caveat is that the data will multiply in size, so it's a tradeoff between payload size and processing performance. Here's an example, where a case of locating the "geo" book would take several searches on the first data structure, but would only be a simple filter on the second data structure. // So you loop through the properties of books, then another loop through math // then another loop through science, then you get your "geo". Loops: 3 { books : { math : ['algebra','trigo','solids'], science : ['bio','geo','psycho'] } } // Here, var geoBook = array.filter(function(book){return book.topic === 'geo'})[0]; // Loops: 1 (filter is essentially a loop) [ { type : 'book', subject : 'math', topic : 'algebra' },{ type : 'book', subject : 'math', topic : 'trigo' },{ type : 'book', subject : 'math', topic : 'solids' },{ type : 'book', subject : 'science', topic : 'bio' },{ type : 'book', subject : 'science', topic : 'geo' },{ type : 'book', subject : 'science', topic : 'psycho' }, ] To avoid freezing the browser, you need to "defer" operations using timers. You can use setInterval with a counter instead of loops. Here's a simple example: function each(array,iterator){ var i = 0, length = array.length; var timer = setInterval(function(){ iterator.call(array,array[i]); if(++i &gt;= length) clearInterval(timer); },1000); } each([1,2,3,...10000],function(n){ console.log(n); })
upvote count: 1
type: Answer

http://stackoverflow.com/comment/38982962
comment on: http://stackoverflow.com/a/25053489
has text: @s.alem: If you read the question carefully you will see why :) The question is about migrating a programmatic form submission from jQuery to Angular.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38805724
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24965332
has text: Or if your scripts are in the head, they might be trying to access stuff that hasn't loaded. You could try moving your scripts to just before , or wrap them in a $().ready
score: 0

http://stackoverflow.com/q/25024913
tagged with: javascript
tagged with: dart
answer count: 1
downvote count: 0
tagged with: web
has body: I'm using the HttpRequest.getString method to load some content dynamically, which works well until I generate some js from the dart code. Running the generated javascript causes these error "access denied" at this point: // An uncaught error in the root context terminates all isolates. if (identical(this, _globalState.rootContext)) { rethrow; } this is the dart code: void loadPage(String src) { HttpRequest.getString(src).then((response) { querySelector("#content").innerHtml=response; }); } Where is the problem, and why is the dart code working but not the javascript code?
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25029238
upvote count: 1
has title: dart HttpRequest.getString not working with
has comment: http://stackoverflow.com/comment/39023044
score: 1
linked to: http://stackoverflow.com/q/18649338
type: Question
has comment: http://stackoverflow.com/comment/38922400

http://stackoverflow.com/comment/38782792
type: AnswerComment
comment on: http://stackoverflow.com/a/24953490
type: Comment
score: 0
has text: @user3220812 well for a start you missed "£" in your equation

http://stackoverflow.com/comment/38811358
score: 0
type: Comment
has text: Alright good luck man. Thought i could be of help. Check your browser's console for JS errors and make sure PHP is in debug mode.
type: AnswerComment
comment on: http://stackoverflow.com/a/24968232

http://stackoverflow.com/q/25013735
has title: Socket.io + NodeJS doesn't work on Heroku
has body: I am doing an API and it's on Heroku. But I am having some problems with the socket.io only on the heroku side, when I test it in local everything goes fine. The API is completely independent of the frontend, so they are in a different domains (and a different hosts). The problem is that on production, I don't get succeed in connect the sockets... I have some questions, all of that are about the socket.io configuration on heroku. I know that there are some posts with some information about that, but the posts I found it was with old versions of sockets.io or old versions of heroku (heroku seems to has changed the websockets stuff the past July): I don't know if I need to activate something before run socket.io on heroku. I read some posts about that, but all seems to be old... I tried to activate Websockets with: $ heroku labs:enable websockets but the response that I got it was: ! No such feature: websockets. Do I have to specify a port, or Heroku has an automatic port for that? Do I need two connections? One to listen the POST/GET/PUT/DELETE and another to the sockets? app.js var express = require('express'); var app = module.exports = express(); var port = process.env.PORT || 5000; var port_s = 3000; var server = require('http').createServer(express); ... app.listen(port); server.listen(port_s); require('./config/socket-io')(app, server, secret); app.post('/user', routes.users.register); ... socket-io.js module.exports = function(app, server, secret) { var clients = {}; console.log("initiating sockets..."); var sio = require('socket.io').listen(server); sio.sockets.on('connection', function (socket) { clients[socket.id] = socket; console.log("...new connection: "+socket.client.id); socket.emit('identification', { data : socket.client.id }); socket.on('newShoutOut', function(data) { var receptor = data.idTo; var emiter = socket.client.id; //console.log("...new shout out from " +emiter+ " to "+receptor); var elem = findElement(sio.sockets['sockets'], 'id', receptor…
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
has comment: http://stackoverflow.com/comment/38904271
has answer: http://stackoverflow.com/a/25018071
accepted answer: http://stackoverflow.com/a/25018071
tagged with: socket.io
type: Question
score: 14
tagged with: heroku
tagged with: javascript
linked to: http://stackoverflow.com/q/62885098
tagged with: express
upvote count: 14
answer count: 1
favorite count: 0

http://stackoverflow.com/a/24914687
upvote count: 1
type: Answer
has body: Use the google maps embed api to embed within an iframe. You are on the right track, you just need a slightly different URL structure for your src. https://www.google.com/maps/embed/v1/MODE?key=API_KEY&amp;parameters Where: {MODE} is one of place, directions, search, or view, as described in the Modes section of this document. {API_KEY} is your free API key. Parameters include optional parameters, as well as mode-specific parameters. Source: https://developers.google.com/maps/documentation/embed/guide
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38747078
answers question: http://stackoverflow.com/q/24914513

http://stackoverflow.com/comment/38789251
type: AnswerComment
has text: Well yes, it does not matter where the functionality resides but if it is written in way that it is portable. What backend are you using?
type: Comment
comment on: http://stackoverflow.com/a/24956794
score: 0

http://stackoverflow.com/q/25068844
score: 1
tagged with: facebook-login
tagged with: dom
tagged with: ionic-framework
type: Question
answer count: 2
downvote count: 0
has answer: http://stackoverflow.com/a/42947441
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25074289
has answer: http://stackoverflow.com/a/25074289
favorite count: 0
has body: I am building a Ionic based mobile application and I am using the phonegap-facebook-plugin to login with facebook. I have managed to install the plugin on both android and ios and it works. However, while trying to use it for the webapp, I am having dificulties making it work. I will outline my setup then outline the error: login.html Login with Facebook app.js angular.module('app', ['ionic', 'app.controllers', 'app.services']) .config(function($stateProvider, $urlRouterProvider) { $stateProvider //First page .state('login', { url: '/login', templateUrl: 'templates/login.html', controller: 'LoginCtrl' }); controllers.js angular.module('app.controllers', []) .controller('LoginCtrl', function($scope){ $scope.login = function () { if (!window.cordova) { var appId = prompt("Enter FB Application ID", ""); facebookConnectPlugin.browserInit(appId); } facebookConnectPlugin.login( ["email"], function (res) { //if successfull if (JSON.stringify(response['authResponse']['accessToken']) != null){ alert("True"); $location.path('/home').replace(); } else{ //redirect back } }, function (res) { //if error alert(JSON.stringify(response)) } ); } }); In the facebookConnectPlugin.js, I have a line of code which gets the error "Uncaught TypeError: Cannot read property 'appendChild' of null", specifically Line 174: document.getElementById('fb-root').appendChild(e); I know this must be due to the DOM, but can't seem to get past it. Any help would be great, thanks :)
tagged with: cordova
has title: phonegap-facebook-plugin on WebApp, JS error
possible better answer: http://stackoverflow.com/a/42947441
upvote count: 1
type: AnsweredQuestion

http://stackoverflow.com/comment/38802985
has text: Be sure to take the width/height measurements after setting `display: block`. Updated the example to reflect that.
comment on: http://stackoverflow.com/a/24963853
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/comment/38888930
type: AnswerComment
type: Comment
has text: @MinNaingOo it's working see it properly, it doesn't have left margin.
comment on: http://stackoverflow.com/a/25009787
score: 0

http://stackoverflow.com/comment/38895531
type: QuestionComment
has text: if username property is a direct property of attendings object then only hasOwnProperty will work.
comment on: http://stackoverflow.com/q/25013317
score: 0
type: Comment

http://stackoverflow.com/q/24988270
linked to: http://stackoverflow.com/q/4672960
has answer: http://stackoverflow.com/a/24988357
tagged with: css
has comment: http://stackoverflow.com/comment/38848529
has answer: http://stackoverflow.com/a/24988350
possible better answer: http://stackoverflow.com/a/24988347
has answer: http://stackoverflow.com/a/24988499
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24988316
has answer: http://stackoverflow.com/a/24988347
has answer: http://stackoverflow.com/a/24988370
type: Question
has body: I'm trying to create a dropdown that will show google fonts for a customization website. I'm trying to apply a class to each option based on the option value. I can't just hard code it because I am working with a hosted vendor so I only have jquery/javascript abilities (otherwise I'd just add the class tag manually). Here's my HTML: Lobster Shadows Into Light Pacifico CSS: .1167 { font-size: 25px; font-family: 'Lobster'; } .1168 { font-size: 25px; font-family: 'Shadows Into Light'; } .1169 { font-size: 25px; font-family: 'Shadows Into Light'; } For my jquery/javascript, I have: var fontname = element.options.val(); if(fontname == 1167) { fontname.addclass(fontname.val); } What I'm trying to accomplish: Lobster Shadows Into Light Pacifico fiddle: http://jsfiddle.net/sNkDW/276/ Any help would be much appreciated. Thanks in advance UPDATE: oops, can't have class names that start with numbers. so lets make them .f1167 .f1168 and so on. can we have the jquery add an "f" in front of the option value to make it the class name?
tagged with: javascript
tagged with: jquery
has title: add class to select dropdown based on value
has answer: http://stackoverflow.com/a/24988343
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 7
accepted answer: http://stackoverflow.com/a/24988499

http://stackoverflow.com/comment/38820503
comment on: http://stackoverflow.com/q/24973308
score: 0
type: Comment
has text: @Fanckush You might be right, but tdwells90 solution worked for now.
type: QuestionComment

http://stackoverflow.com/comment/100267280
has text: is there a `+=` operator (or similar), such as `canvas.onclick += { (e: dom.MouseEvent) => ... }`
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/24939516
type: Comment

http://stackoverflow.com/q/24990283
tagged with: http://stackoverflow.com/tag/html
tagged with: ruby
type: AnsweredQuestion
score: 0
linked to: http://stackoverflow.com/q/5042300
possible better answer: http://stackoverflow.com/a/24990496
tagged with: ruby-on-rails
has answer: http://stackoverflow.com/a/24990496
type: Question
has title: Rails fill table with Model dynamically
has body: I have a problem with Ruby on Rails. I have a "Host Model" with a method, which takes longer to run. class Host &lt; ActiveRecord::Base def take-a-while #do some stuff end end Now I try to access a page in which this method is executed on all hosts and is automatically displayed each time you perform in a new table row with the result. My problem is that the HTML document is first completely rendered and the table is displayed only after the complete loading (several minutes). Is there a way to solve this problem? Thanks in advance Greetings!
has answer: http://stackoverflow.com/a/24990601
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24990601
tagged with: ajax

http://stackoverflow.com/comment/38910205
score: 3
has text: Your edit is the problem. The scripts are in the right place on the page, they just aren't found on the server (what a great tutorial). If you look in the console, you'll see 404 errors. Apparently, there is no version 0.8.0 of **AngularFire**. If you look on their Github page, you'll see versions 0.7.1, 0.7.0, 0.6.0, 0.5.0 and so on. If you replace the 0.8.0 in the script URL with one of those versions, it should work.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25021003

http://stackoverflow.com/comment/38750240
has text: I see. Well my situation is that I can't only get the src attribute because I also need the complete HTML elements to be output at a later stage
comment on: http://stackoverflow.com/a/24936194
type: Comment
score: 0
type: AnswerComment

ecmascript-harmony
tag name: ecmascript-harmony
type: Tag
tags question: http://stackoverflow.com/q/24925628

http://stackoverflow.com/q/25050636
linked to: http://stackoverflow.com/q/14550396
has answer: http://stackoverflow.com/a/25050703
tagged with: css
has body: I'm developing a web app, using Jquery Mobile, I have to make an Ajax/Json to a PHP to retrieve MySQL data, when I get the JSON Callback, and create the "list" from the array, the path of the jquery mobile css file get lost, and my is not well formed. This is my code : $.ajax({ url: "busca_reservas.php", data: "fecha=" + fecha + "", dataType: 'json', type: "POST", cache: false, success: function(data){ var output = '&lt;ul data-role="listview" data-inset="true" id="reservas" class="listareservas"&gt;'; var logsData = data; for (var i in logsData.logs){ regis = logsData.logs[i].recid; nombre = logsData.logs[i].nombre; ape = logsData.logs[i].apellido; output+= '&lt;li&gt;&lt;a href="#"&gt;' + regis + " " + nombre + " " + ape + '&lt;/a&gt;&lt;/li&gt;'; } output+='&lt;/ul&gt;'; $('.listareservas').listview('refresh'); $("#result").append(output).fadeIn(500); console.log(output) } }); The content in my looks like plain text, instead of Jquery Mobile "List View". Any help wil be welcome ? Thanks in advanced
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38965982
has answer: http://stackoverflow.com/a/25050716
has comment: http://stackoverflow.com/comment/38966007
has title: ajax json php callback lost css jquery mobile
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38965921
tagged with: jquery-mobile
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38983532
type: Question

http://stackoverflow.com/a/24970421
has body: As it is clearly stated in the docs, your fields must be labeled label and value. Array: An array can be used for local data. There are two supported formats: An array of strings: [ "Choice1", "Choice2" ] An array of objects with label and value properties: [ { label: "Choice1", value: "value1" }, ... ] EDIT : And as it has been pointed out, the input's id is autocomplete, not specialties.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24970352
score: 6
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/38814516
answers question: http://stackoverflow.com/q/24970352
has comment: http://stackoverflow.com/comment/38814564

http://stackoverflow.com/a/25055910
answers question: http://stackoverflow.com/q/25055682
upvote count: 1
has body: It's a bit hacky but it works. Add invisible block above .dropdown-menu block .dropdown-menu:before { content: " "; display: block; position: absolute; height: 25px; top: -25px; left: 0; right: 0; } Here is demo
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/38748957
has text: I don't understand how I can print the information of a socket or an other, but anyway, what if i have 30 computers ? I want something to allow me to swap over the IPs list.
type: Comment
comment on: http://stackoverflow.com/q/24934986
type: QuestionComment
score: 0

http://stackoverflow.com/a/24972521
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38819016
has comment: http://stackoverflow.com/comment/38818832
has body: I think you need to put the full URL (or relative to the page or site) in the the image_array. When you use a relative url for a background image (url('../foo.png')) in a CSS file the ../ is relative to the CSS file. However, when you set with javascript it is relative to the current page URL.
has comment: http://stackoverflow.com/comment/38818811
upvote count: 1
has comment: http://stackoverflow.com/comment/38819314
type: Answer
answers question: http://stackoverflow.com/q/24972470
has comment: http://stackoverflow.com/comment/38818951

http://stackoverflow.com/a/24989469
has comment: http://stackoverflow.com/comment/38851110
score: 4
has comment: http://stackoverflow.com/comment/84974426
has comment: http://stackoverflow.com/comment/84984606
type: Answer
upvote count: 4
answers question: http://stackoverflow.com/q/24989065
downvote count: 0
has body: TL;DR Minitech's comments and TheQ's comments are correct -- this is not a great task for regular expressions. A non-regex solution is given below. Just for kicks, so is a monstrous regex. Edit: I decided to spend a few minutes at lunch cleaning this up and adding the "right" way to do this (no regex) as well as a jsFiddle. The Real Answer The right way to do this for readability, maintainability, and sanity is to avoid using regex here. Writing a regex to do this is extremely difficult and the result is extremely hard to read. Instead, just parse the date into its component parts, then validate them like so: /** * Check whether a given year is a leap year * @param integer y The integer * @return boolean True for yes, false for no */ function isLeapYear(y) { return (0 == y % 4 &amp;&amp; (0 == y % 400 || 0 != y % 100)); } /** * Validate a date in YYYY/MM/DD format (allows YYYY/M/D and periods instead of slashes) without regex. * @param string str The date to test. * @return boolean True for valid, false for invalid. */ function validateDateWithoutRegex(str) { // check the format first if(!/^\d{4}[\/.]\d{1,2}[\/.]\d{1,2}$/.test(str)) { return false; } var parts = str.split(/\D/) // split on non-digits .map(function(val) { return parseInt(val); }); // convert strings to ints if(parts[0] &lt; 1000 || parts[0] &gt; 2999) { // invalid year return false; } if(parts[1] &gt; 12 || parts[1] === 0) { // invalid month return false; } if(parts[2] &gt; 31 || parts[2] === 0) { // invalid day return false; } switch(parts[1]) { case 4: case 6: case 9: case 11: if(parts[2] &gt; 30) { // invalid day return false; } break; case 2: // February... return (parts[2] &lt; 29 || parts[2] == 29 &amp;&amp; isLeapYear(parts[0])); break; } return true; } // Usage: validateDateWithoutRegex('2014/07/28'); // returns true The Utterly Insane Regex Answer But, just because I felt like doing some regex tonight... you could use this monster: /^(?=(?!\d+\D0?2\D29)|(?:\d{2}(?:04|08|[13579][26]|[2468][04…

http://stackoverflow.com/comment/38996289
comment on: http://stackoverflow.com/q/25066717
score: 0
type: Comment
has text: well, yea, I just needed a temp solution, until I can write an algorithm to stop the link rot.
type: QuestionComment

http://stackoverflow.com/q/24937733
upvote count: 1
tagged with: xmlhttprequest
accepted answer: http://stackoverflow.com/a/24937843
possible better answer: http://stackoverflow.com/a/24937834
has answer: http://stackoverflow.com/a/24937834
downvote count: 0
tagged with: javascript
has body: I'm trying to get a handle on how the XMLHttpRequest() object works. If I remove xhr.send(), "hi" will display. But nothing displays when it is present. I really want to write the xhr.status to the screen, but first I need to know why the script doesn't finish executing, even though the remainder does not depend on the response after xhr.send(). Playground
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38753264
score: 1
has title: Why does my script stop running after calling XMLHttpRequest.send()?
favorite count: 0
has comment: http://stackoverflow.com/comment/38755829
type: Question
has answer: http://stackoverflow.com/a/24937843
answer count: 2

http://stackoverflow.com/comment/38781412
type: Comment
type: QuestionComment
has text: I thought there is a way to use the paper-button elements. They are already styled with css.
comment on: http://stackoverflow.com/q/24952217
score: 0

http://stackoverflow.com/comment/38812182
type: Comment
has text: Thanks for that. Given the non-web side of the application, what be the effort to implement such a jmx-service-interfaces-mechanism to the existing code? Let's say there might be a jmx-pyhton lib around for that. - Anyway I searched the internet and rarely found something, some tutorial or the like, on that...
type: AnswerComment
comment on: http://stackoverflow.com/a/24964284
score: 0

http://stackoverflow.com/comment/38891754
has text: I made that work using a combination of `parent` and `next`. I'm curious to know whether there is a reason why your solution (or mine) could be preferred?
type: AnswerComment
comment on: http://stackoverflow.com/a/25011344
score: 0
type: Comment

http://stackoverflow.com/comment/38828354
has text: You can't change how javascript stores a number internally. If you want to determine how much precision you have, then you need to just develop your own code to process whatever form of valid number you get.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24977681
score: 3

http://stackoverflow.com/q/24947565
tagged with: multithreading
has comment: http://stackoverflow.com/comment/38772455
tagged with: v8
has body: I plan to embed Google V8 in my C++ application, which is a multi-threading process. I need to run multiple Javascripts concurrently. Can I create multiple V8 contexts and run different Javascripts in different contexts simultaneously in different threads? Each context has no need to communicate with others. I just want no lock or wait for script concurrent executing. Thanks!
tagged with: embedded-v8
type: Question
tagged with: javascript
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/35580934
has title: Can Google V8 engine run different Javascripts in different contexts in different threads simultaneously?
tagged with: c++
type: UnansweredQuestion

http://stackoverflow.com/comment/38788433
comment on: http://stackoverflow.com/a/24956598
score: 0
type: Comment
has text: It's an exercise of imagination
type: AnswerComment

http://stackoverflow.com/comment/38812948
type: Comment
score: 0
type: AnswerComment
has text: success: function (result) { if (result == true) { window.location.href = '@Url.Action("ManageResource", "Resource")'; } else { $("#CreatePopup").html(result); } } }); Even if its true the entire view is getting loaded in CreatePopup div..
comment on: http://stackoverflow.com/a/24969196

http://stackoverflow.com/comment/38811220
has text: My question is: Really? You really have to support IE7? IE7's global market share is somewhere between [0.17%](http://gs.statcounter.com/#browser_version_partially_combined-ww-monthly-201306-201406) and [0.71%](http://marketshare.hitslink.com/browser-market-share.aspx?qprid=2&qpcustomd=0) depending on who you ask. Of course, the only stats that really matter are the stats for **your** site/app, but... You might want to push back on whoever is telling you to support that *seriously*-outdated browser, get them to back up that requirement with data.
score: 2
comment on: http://stackoverflow.com/q/24968481
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/74567963
type: AnswerComment
has text: `setAttribute` can set numeric values, but it also updates the dynamic page source so it's probably slower.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/43762992

http://stackoverflow.com/q/25055333
has title: How to apply filter for 2 dimensional json object with ng-repeat?
has answer: http://stackoverflow.com/a/25055663
favorite count: 0
has answer: http://stackoverflow.com/a/25055861
tagged with: angularjs-filter
tagged with: angularjs-ng-repeat
tagged with: angularjs
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
answer count: 2
has body: This is my json: [{"node": {'name': 'Nexus S', 'snippet': 'Fast just got faster with Nexus S.', 'age': 1}}, {"node":{'name': 'Motorola XOOM™ with Wi-Fi', 'snippet': 'The Next, Next Generation tablet.', 'age': 2}}, {"node":{'name': 'MOTOROLA XOOM™', 'snippet': 'The Next, Next Generation tablet.', 'age': 3}} ]; This is my code: Search-title: {{fin.name}} {{fin.snippet}} How can I apply filter for this json object?
downvote count: 0
tagged with: javascript

http://stackoverflow.com/q/25024889
accepted answer: http://stackoverflow.com/a/25024956
answer count: 1
tagged with: closures
tagged with: javascript
tagged with: scope
duplicate of: http://stackoverflow.com/q/20279484
linked to: http://stackoverflow.com/q/3127429
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25024956
has title: Accessing an Object Prototype's variable from within another Object created by the first
type: Question
has body: I have an Object that creates an Async XMLHttpRequest. It is working nicely, except that I want to access the variable address in the callback function for the request. If I use this.address it doesn't work because this doesn't refer to the Async object anymore but to the XMLHttpRequest object created by my Async object. How can I step out of the XMLHttpRequest object to access Async's variables? function Async(address) { this.req = new XMLHttpRequest(); this.address = address } Async.prototype = { create: function() { this.req.open('GET', this.address, true); this.req.onreadystatechange = function(e) { if (this.readyState == 4) { if (this.status == 200) { dump(this.responseText); //HERE IS WHERE THE ISSUE IS console.log("loaded"+this.address) } else { dump("COULD NOT LOAD \n"); } } } this.req.send(null); } }
tagged with: oop
has comment: http://stackoverflow.com/comment/38917932
linked to: http://stackoverflow.com/q/20279484
score: 0

http://stackoverflow.com/comment/38722398
has text: Ah twitter doing the redirect is probably it, the only way to prevent that is using observer service huh? And all kind of yuck?
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24919721

http://stackoverflow.com/a/25028457
has comment: http://stackoverflow.com/comment/39628516
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25028188
has body: I had the same problem when I upgraded to react-router 0.5 and I was even using react 0.11. I changed to {this.props.activeRouteHandler()} and it started working. I marked this as a "todo" to look into though. No matter what you do, don't give up. It works great! We were using backbone router before and this react router is such a blessing compared to our old setup! Also with your directory setup you can change your requires to just "require('react')" and use browserify to build your app and required dependencies into a single js asset. Everything else looks good.
has comment: http://stackoverflow.com/comment/38961907
has comment: http://stackoverflow.com/comment/38958233
type: AcceptedAnswer
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/38959273
has comment: http://stackoverflow.com/comment/38925361
answers question: http://stackoverflow.com/q/25028188
has comment: http://stackoverflow.com/comment/38964928

http://stackoverflow.com/q/24955130
tagged with: css
answer count: 0
score: 1
upvote count: 1
type: Question
tagged with: javascript
has body: I have the following script which shows a menu. At first the menu is small with only a little image in it. (below the coloured buttons) When clicked on that image there is a bigger menu shown with the items to be selected (gpx-files) If an item is selected this items will be shown on a map (with the leaflet script) and the menu will be small again with the small image in it again. Using: Wandelroutes When the big menu has many items and therefore scroll-bars at the rightside and you select an item at the bottom, the menu still becomes small again but not the wanted image is shown. Instead of the image there is some text of one of the items. On the index page it works as supposed, selecting an item shows the route on a map and on the left is a small button with a pedestrian image in it. On the bicyle's page it's not working as supposed - selecting the small pedestrian shows the full menu but when I select an item at the bottom (after scrolling down) there is no small pedestrian at the left but some text of an item from the menu. Selecting an item at the top of the list however is working fine. How do I force my menu to show the image instead of the text? On my testing page you can see what I mean. http://westera0.home.xs4all.nl/ My css file looks like this The part .route_lijst is the part when the menu is fully shown body { font: 12px/1.5 Arial, Helvetica, sans-serif; margin: 0px; padding: 0px; } .map { position: absolute; top: 0px; left: 0px; right: 0px; bottom: 0px; } .soort_route { position: absolute; top: 10px; left: 55px; width: 550px; height: 44px; overflow: hidden; box-shadow: 0 1px 7px #999; background: #ceeca8; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; padding: 8px; z-index: 100; } .route_lijst { position: absolute; top: 85px; left: 55px; width: 22px; height: 22px; overflow: hidden; box-shadow: 0 1px 7px #999; background: #f8f8f9; -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; padding: 8px; z-index:10…
downvote count: 0
has title: Image not shown after selecting from a menu with many items
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/24918030
has comment: http://stackoverflow.com/comment/38716515
tagged with: php
type: Question
has title: Ajax request does not fire on click
has body: I am trying to use Ajax to post some data to a php script. I want the ajax request to be triggered when the delete button is clicked, and then delete the div where the click button was clicked. Here is the code: Management Panel First Name Last Name Email Care Home Last Login Number of Log-ins Last Data Upload Delete @foreach($employees as $employee) email}}"> {{$employee->username}} {{$employee->username}} {{$employee->email}} {{$employee->carehome_name}} {{$employee->last_login}} {{$employee->n_sessions}} {{$employee->last_upload}} email}}"> Delete @endforeach And here is the Javascript: I've tried a number of things and nothing works, the click event is not event logged to the the console. Thank you all for your suggestions!
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38716955
has answer: http://stackoverflow.com/a/24918282
tagged with: ajax
score: 0
type: UnansweredQuestion

http://stackoverflow.com/q/24956525
has comment: http://stackoverflow.com/comment/38792037
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38788271
has title: How to convert an element to a string that can be stored and restored from localStorage
has comment: http://stackoverflow.com/comment/38788379
tagged with: local-storage
type: AnsweredQuestion
has body: My plan is to store my elements in localStorage once they've been read once (for an online app – I figure that if I can get it to work it will speed up my app significantly). So I came up with the following, but the contents seem to either be stored or come back as null. Now I thought that an element was fundamentally a string so I wouldn't have to do anything with it to store it in localStorage, but apparently not. Does anyone know if it's possible to achieve what I want? If you want to take it for a spin then you'll need a small file holding html to pass to it. The contents aren't important. The first time it runs if (content) will evaluate to false. The next time true and I added the .clear() to make it alternate. The third time the showSource function will populate the id=localor element (which will need to be separate from the id=content element or whatever other element you choose to populate) showing the null after "from File ". function showSource(source) { //Function and related element only here for testing $("#localor").html("&lt;p&gt;"+source+"&lt;/p&gt;"); } //local is the name of the localStorage element //id is the id of the element in the main form //source is where the content for the element originates. function loadElement(local, id, source) { //This is the generic script for attempts to load an element. content = localStorage.getItem(local); //Try to load from local storage if (content) {//If found $(id).html(content); showSource("from Local " + content); //Added only for testing localStorage.clear(); //Added only for testing //load into the #content element } else {//Not found $(id).load(source); showSource("from File " + content); //Added only for testing //so load it from the server.. localStorage.setItem(local,$(id).html()); //then save it to the local storage, so we don't have to do this again any time soon. } } $(document).ready(function() { loadElement("login.1001", "#content", "login.html"); }); Please help. Thanks.
has answer: http://stackoverflow.com/a/24956575
accepted answer: http://stackoverflow.com/a/24956575
has comment: http://stackoverflow.com/comment/38788472
tagged with: dom
type: Question
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38788400
tagged with: jquery

http://stackoverflow.com/a/24920057
upvote count: 5
type: Answer
accepted answer of: http://stackoverflow.com/q/24920003
answers question: http://stackoverflow.com/q/24920003
downvote count: 0
has body: Yes use z-index in your style. z-index:-1 JSFiddle http://jsfiddle.net/D24uC/
score: 5
type: AcceptedAnswer

amazon-elastic-beanstalk
tag name: amazon-elastic-beanstalk
type: Tag
tags question: http://stackoverflow.com/q/24969991

http://stackoverflow.com/comment/38919941
score: 0
type: Comment
has text: Sorry about the confusion and thanks for reminding the OSM use policy. I actually have my own tile server, serving more than 1000 layers (5 layers each for > 200 countries), and the OSM above is just for demo purposes.
type: QuestionComment
comment on: http://stackoverflow.com/q/25024466

http://stackoverflow.com/q/24930991
has body: What I am trying to do is to apply some validation on an input text field based on a checkbox and whether it is checked or not. Case 1: when check box is selected, user can only enter numbers from 0 to 100 (decimal included. So 34.35 is allowed) Case 2: Normal numeric validation However the behavior of my code in Case 1 is it only allow user to enter 1 nu,beric digit between 1 to 9. Here is my code. HTML markup elements.stakeInput = $('&lt;input placeholder="0.00" type="text" style="float:right" /&gt;'); elements.promoMoneyCheckbox = $('&lt;input type="checkbox" /&gt;'); JS elements.promoMoneyCheckbox.click(function() { SingleDiv.prototype.validatePromoInputField(self); }); validatePromoInputField : function(singleDiv) { var self = this, elements = singleDiv.getElements(), promoMoneyCheckbox = elements.promoMoneyCheckbox; if (promoMoneyCheckbox.is(':checked')) { elements.stakeInput.attr("placeholder", "10.00"); elements.stakeInput.keypress(function(event) { var num = parseInt(self.value, 10), min = 0, max = 100; if (isNaN(num)) { this.value = ""; return; } this.value = Math.max(num, min); this.value = Math.min(num, max); }) } else { elements.stakeInput.attr("placeholder", "00.00"); validateInputs(event, 'decimal') } } function validateInputs(event, typeOfInput) { event = event || window.event; if (event.ctrlKey || event.altKey || event.metaKey) return; var regex; switch (typeOfInput) { case 'decimal': regex = /^[.0-9]$/; break; case 'minAndMax': regex = // May be I could add a regex over here instead of the validating in validatePromoInputField fucntion break; default: regex = /^.$/; break; } var char = getKeypressChar(event); if (char == null || regex.test(char)) return; event.preventDefault ? event.preventDefault() : (event.returnValue = false); } Is there any simple way to achieve this? I am not looking for HTML5 validation i.e (input type="number" min and max value).
score: 0
tagged with: validation
answer count: 1
has answer: http://stackoverflow.com/a/24932701
tagged with: javascript
tagged with: jquery
has title: validating input text field (max and min) based on checkbox condition
type: UnansweredQuestion
type: Question

http://stackoverflow.com/a/25078645
has body: What was happening here was as @Justin-iurman pointed out, when the function returns true the server side function will also be called after the client. In my case though when I tested a false result I was still going straight to the server side function. Turns out by pressing F12 in chrome and inspecting the console, I had an undefined error in my JS code. Moving the function in question out of the function used specifically for this page and into global context sorted the issue for me.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25015555
accepted answer of: http://stackoverflow.com/q/25015555
type: AcceptedAnswer

http://stackoverflow.com/comment/38898640
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25015088
has text: So what have you tried to overcome the problem? You to have some sort of handler that registers that your mouse is down.

http://stackoverflow.com/comment/38971150
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25052402
has text: You could try `JSON.parse(value.replace(/'/g, '"'))`, but this is also risky if the string contains unescaped quotes.

http://stackoverflow.com/comment/38895194
score: 0
type: Comment
type: QuestionComment
has text: @AlexP Error is the Question's title.
comment on: http://stackoverflow.com/q/25013135

http://stackoverflow.com/comment/38833837
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24980598
has text: Questions without code aren't future-proof. How someone else will profit from this question in the future if the links break? **Please put your *relevant* code directly in the question.**
score: 0

http://stackoverflow.com/a/49084576
has body: If you use jQuery find method, it will traverse the DOM tree trying to find the correct element taking into account the value of one of its attributes, and looking at your comment, I think that you are concerned about performance. Your first idea about iterate over all the options and check the value property is better (speaking about performance) than traversing the DOM tree looking for an element with a particular value in one of their attributes (look at this comparison). You need to be aware that shorter code is not the same as faster code. A faster solution is to generate an array of strings at the beginning and search the correct value inside it in the validation process: //---At the beginning of your application let list = Array.prototype.map.call(document.getElementById("colours").options, (option) =&gt; option.value); //---Later in your validation process if (list.indexOf(value) &lt; 0) { //Invalid } Another faster solution is to generate an object at the beginning and use it as a hash map, checking for the correct value inside it in the validation process: //---At the beginning of your application let hashmap = Array.prototype.reduce.call(document.getElementById("colours").options, (obj, option) =&gt; { if (!obj[option.value]) { obj[option.value] = true; } return obj; }, {}); //---Later in your validation process if (!hashmap[value]) { //Invalid } Here you have the four methods compared in measurethat: 1 - Your first idea (iterate over all the Datalist options) 2 - Use the jQuery find method (@nsthethunderbolt solution) 3 - Create an array of strings at the beginning and search the value in the Array in the validation process 4 - Create a hash map at the beginning and check if the value is true in the validation process https://www.measurethat.net/Benchmarks/Show/4430/0/search-an-option-inside-a-datalist
downvote count: 0
score: 3
upvote count: 3
answers question: http://stackoverflow.com/q/24934669
type: Answer

http://stackoverflow.com/comment/38758178
type: QuestionComment
comment on: http://stackoverflow.com/q/24940088
score: 0
has text: I will show the meaning of res and name tag.
type: Comment

http://stackoverflow.com/comment/38925186
comment on: http://stackoverflow.com/q/25028597
score: 0
type: QuestionComment
type: Comment
has text: I don't actually know how I can set it up on plunkr to replicate, I am using angular-fullstack and which includes express and mongo I can't get the auth to work with out the rest of the app. So I can't make a fair example that will throw the error.

http://stackoverflow.com/q/24949071
favorite count: 0
has body: I am using CodeIgniter and my js code is in my "view" and I want to pass the value in my controller. var storage =[]; function something() { storage.push('the value'); } Now I want a better way to pass the storage array into my PHP. Thanks in advance. This code is not working because it is in the separate folder. $.ajax({ url: 'yourPHPFile.php', type: 'POST', data: {data:storage.toString()}, success: function(result) { // handle your success }, error: function() { // alert("error"); } });
duplicate of: http://stackoverflow.com/q/13840429
has answer: http://stackoverflow.com/a/24949123
has comment: http://stackoverflow.com/comment/38775080
has answer: http://stackoverflow.com/a/24949147
has comment: http://stackoverflow.com/comment/38846460
tagged with: php
has comment: http://stackoverflow.com/comment/38775102
has comment: http://stackoverflow.com/comment/39010026
has comment: http://stackoverflow.com/comment/38781632
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38781105
has comment: http://stackoverflow.com/comment/38779127
upvote count: 5
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/38779039
downvote count: 3
linked to: http://stackoverflow.com/q/13840429
has comment: http://stackoverflow.com/comment/38775103
type: Question
possible better answer: http://stackoverflow.com/a/24949123
tagged with: javascript
has title: Pass a javascript array to php in Code Igniter
has comment: http://stackoverflow.com/comment/38775139
has comment: http://stackoverflow.com/comment/38781007
has answer: http://stackoverflow.com/a/24949174
accepted answer: http://stackoverflow.com/a/24949174
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38775150

function
tags question: http://stackoverflow.com/q/24927642
tags question: http://stackoverflow.com/q/24917752
tags question: http://stackoverflow.com/q/24928269
tag name: function
tags question: http://stackoverflow.com/q/24919275
tags question: http://stackoverflow.com/q/25020011
tags question: http://stackoverflow.com/q/24992450
tags question: http://stackoverflow.com/q/24967941
tags question: http://stackoverflow.com/q/24930271
tags question: http://stackoverflow.com/q/25046645
tags question: http://stackoverflow.com/q/24919110
tags question: http://stackoverflow.com/q/25013265
tags question: http://stackoverflow.com/q/25039029
tags question: http://stackoverflow.com/q/24944753
tags question: http://stackoverflow.com/q/24933118
tags question: http://stackoverflow.com/q/24975899
tags question: http://stackoverflow.com/q/24917644
tags question: http://stackoverflow.com/q/24945249
tags question: http://stackoverflow.com/q/25049038
tags question: http://stackoverflow.com/q/25000004
tags question: http://stackoverflow.com/q/25015153
tags question: http://stackoverflow.com/q/24998848
tags question: http://stackoverflow.com/q/24925907
tags question: http://stackoverflow.com/q/25040450
tags question: http://stackoverflow.com/q/24939072
type: Tag
tags question: http://stackoverflow.com/q/25009824
tags question: http://stackoverflow.com/q/24913857
tags question: http://stackoverflow.com/q/25016118
tags question: http://stackoverflow.com/q/25028853
tags question: http://stackoverflow.com/q/24962655
tags question: http://stackoverflow.com/q/24967130
tags question: http://stackoverflow.com/q/24913707
tags question: http://stackoverflow.com/q/24914328
tags question: http://stackoverflow.com/q/24910584
tags question: http://stackoverflow.com/q/24950787
tags question: http://stackoverflow.com/q/24958011
tags question: http://stackoverflow.com/q/25001284
tags question: http://stackoverflow.com/q/24946711
tags question: http://stackoverflow.com/q/24938160
tags question: http://stackoverflow.com/q/25060635
tags question: http://stackoverflow.com/q/24945195
tags question: http://stackoverflow.com/q/24963889
tags question: http://stackoverflow.com/q/25042211
tags question: http://stackoverflow.com/q/24967314
tags question: http://stackoverflow.com/q/24992217
tags question: http://stackoverflow.com/q/24965363
tags question: http://stackoverflow.com/q/24978338
tags question: http://stackoverflow.com/q/24919791
tags question: http://stackoverflow.com/q/24986492
tags question: http://stackoverflow.com/q/25069192
tags question: http://stackoverflow.com/q/25066160
tags question: http://stackoverflow.com/q/24914251
tags question: http://stackoverflow.com/q/25022107
tags question: http://stackoverflow.com/q/24995655

http://stackoverflow.com/a/24985141
has comment: http://stackoverflow.com/comment/38842479
has comment: http://stackoverflow.com/comment/38842609
type: Answer
has comment: http://stackoverflow.com/comment/38842426
answers question: http://stackoverflow.com/q/24985101
has body: That's equivalent to: function x(t) { //code in here } x(jQuery); Therefore t is a local reference in the function to jQuery. And, t(window) is equivalent to jQuery(window) ... and by extension $(window).
score: 0
has comment: http://stackoverflow.com/comment/38842375

http://stackoverflow.com/comment/38862945
type: QuestionComment
comment on: http://stackoverflow.com/q/24996202
has text: It is basic concept ... here value is pass by reference and not by value
type: Comment
score: 1

http://stackoverflow.com/comment/38715195
type: AnswerComment
type: Comment
has text: Thanks this worked, but I tried adding hover functions to other points, which I will need, but it seems a bit shaky with more than one. Please see the updates I made to the same jsfiddle here http://jsfiddle.net/MtmxN/72/
comment on: http://stackoverflow.com/a/24916992
score: 0

http://stackoverflow.com/comment/38719371
comment on: http://stackoverflow.com/q/24919470
score: 0
type: QuestionComment
has text: @tymeJV I wasn't sure if that was the real answer.
type: Comment

http://stackoverflow.com/a/25005900
has comment: http://stackoverflow.com/comment/38881505
score: 0
has comment: http://stackoverflow.com/comment/38881467
type: Answer
answers question: http://stackoverflow.com/q/25005126
has body: Popups can only be displayed when a user clicks on the browserAction. There is no way for you to open it from code. Instead you should use notifications. Example var notificationId; var options = { type: "basic", title: "Primary Title", message: "Primary message to display", iconUrl: "url_to_small_icon" } var callback = function(wasUpdated) {}; chrome.notifications.create(notificationId, options, callback);

http://stackoverflow.com/comment/38885135
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25007679
has text: You want the calculate button to open the popup if it is closed?
type: AnswerComment

http://stackoverflow.com/a/24940635
answers question: http://stackoverflow.com/q/24940556
has body: window.location = linkLocation will refresh the page. That's why your transition doesn't work. If your .page-rotateSlideOut style has a duration on it, you could do something like: setTimeout(function() { window.location = linkLocation; }, duration);
upvote count: 1
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/25068795
type: Question
tagged with: prestashop
tagged with: javascript
has comment: http://stackoverflow.com/comment/39107244
has title: Fancybox not working on product page in prestashop
has body: I have on-line store on prestashop 1.5.6. There is a fancybox for images on product page, but it's not working. When click on image, will open new page with only image. Firebug doesn't show any errors, and I can't find where is the problem. 5 weeks ago everything was ok. This is link to product page - http://maxafashion.com/ru/dress/7-ecouteurs-a-isolation-sonore-shure-se210-blanc.html Can anybody help me with a smart mind?
upvote count: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/39001266
tagged with: fancybox
tagged with: prestashop-1.5
answer count: 0
downvote count: 0
score: 1

http://stackoverflow.com/comment/38876123
comment on: http://stackoverflow.com/a/25003087
type: Comment
has text: It would appear that `filter` works on a jQuery-wrapped array of arbitrary objects, even though the `.foo()` methods of jQuery are meant to be called on jQuery object lists of DOM elements. I suppose it isn't that surprising, but I'm not sure how much one should rely on that behavior given the *intended* use case. Ex: `arr=[{a:1},{a:2},{b:'foo'}]; $(arr).filter(function(){return this.a;});`
score: 1
type: AnswerComment

http://stackoverflow.com/a/24970847
type: Answer
score: 3
downvote count: 0
has body: if you want to update that hidden field value instead of appending new hidden field, then you can do it this way: $('form').submit(function(e) { $(this).find("input[name='x']").val("222"); })
upvote count: 3
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24970823
answers question: http://stackoverflow.com/q/24970823

http://stackoverflow.com/q/24984425
tagged with: css
tagged with: append
favorite count: 0
has comment: http://stackoverflow.com/comment/38841164
has comment: http://stackoverflow.com/comment/38841033
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38841210
has answer: http://stackoverflow.com/a/24984446
has title: When I add new style with jQuery will it overwrite css?
has comment: http://stackoverflow.com/comment/38841088
has body: Lets say I have this jQuery code $('head').append(' '); Will this overwrite the current css (note the !important) I've tested it in my browser and it is working as expected and overwriting the current css. What I basically want is to add some css without a .css file.
has comment: http://stackoverflow.com/comment/38841021
type: Question
upvote count: 0
score: -2
has comment: http://stackoverflow.com/comment/38841234
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38841199
answer count: 1
has comment: http://stackoverflow.com/comment/38841153

http://stackoverflow.com/comment/38877329
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25003721
has text: why not just use an " " instead of re-inventing the clear button on a text input?
score: 0

http://stackoverflow.com/q/24941109
tagged with: google-visualization
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24941305
favorite count: 0
has comment: http://stackoverflow.com/comment/38760058
has title: Getting Type of Google Chart
score: 1
upvote count: 1
has answer: http://stackoverflow.com/a/24941305
has body: I was looking through the API and couldn't find anything about getting the type of chart. I have this code: &lt;script type="text/javascript"&gt; var chart; function drawTest( dataTable ) { google.load("visualization", "1", {packages:["corechart"]}); var options = { title: 'test chart', hAxis: {title: 'Day', titleTextStyle: {color: 'black'}, animation: { duration: 1000, easing: 'out', }} }; var data = new google.visualization.DataTable(); data.addColumn('string', 'String'); data.addColumn('number', 'Number1'); data.addColumn('number', 'Number2'); dataTable.forEach( function(row) { data.addRow( row ); } ); chart = new google.visualization.ColumnChart( document.getElementById( 'chart' ) ); chart.draw( data, options ); } What I want to do is instead of setting chart to a new chart in the bottom I want to check if it's already set. I'm not sure if this is in the API. if( chart.getType() == "ColumnChart" ){ chart.draw( data, options ); } However, I have multiple charts so I can't just check if chart is initialized. Any help about completing this task is appreciated.
type: Question
has comment: http://stackoverflow.com/comment/38759856
has comment: http://stackoverflow.com/comment/38759820
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38759980

http://stackoverflow.com/a/24962259
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
has body: Maybe spell password the same in both places? :P if(!values.password || values.pasword != values.confirmation) { ^oops
type: Answer
accepted answer of: http://stackoverflow.com/q/24962042
answers question: http://stackoverflow.com/q/24962042

http://stackoverflow.com/comment/38940665
score: 0
type: Comment
type: QuestionComment
has text: Yes. But spclChars.indexOf() should work.
comment on: http://stackoverflow.com/q/25037608

http://stackoverflow.com/comment/48383606
type: Comment
type: AnswerComment
has text: Hi, I also need to disable text selection. My final target is to prevent copy. of text. I tried all the commands mentioned in your answer but only function stop(e) { e.stop() } ["mousedown", "dblclick", "tripleclick", "quadclick", "click", "mousemove"].forEach(function(name) { editor.on(name, stop) }) worked for me. On occurrence of some other event, I want to re-enable text selection and copy. I have very less experience with java script. could you tell me how can i enable the things i disabled. Also I am curious why editor.setOption("dragEnabled", false) didn't work
score: 0
comment on: http://stackoverflow.com/a/24975867

http://stackoverflow.com/q/24998909
has body: Can you please help me convert this SQL query to MongoDB? SELECT CHAR_LENGTH(field), count(distinct field2), count(*) FROM table GROUP BY CHAR_LENGTH(field) Thanks in advance!
has answer: http://stackoverflow.com/a/73931964
upvote count: 1
has answer: http://stackoverflow.com/a/25007807
type: Question
has answer: http://stackoverflow.com/a/24999032
score: 1
tagged with: javascript
tagged with: mapreduce
tagged with: mongodb
downvote count: 0
favorite count: 0
answer count: 3
has title: mongodb group by length of string
type: UnansweredQuestion
tagged with: mongodb-query

http://stackoverflow.com/a/24981802
accepted answer of: http://stackoverflow.com/q/24981779
score: 3
answers question: http://stackoverflow.com/q/24981779
has body: This code: $("#generateZip[data-readyzip='start']").click(function... finds all of the relevant elements as of when it was run (and hooks up a click handler to them). It doesn't recheck them again later when you change things. Two options: If you like, you can use event delegation instead: $(document).on("click", "#generateZip[data-readyzip='start']", function... That hooks the click event on document, and then checks to see if it passed through any elements matching the selector while bubbling up to document from the element on which the event originated. document is, of course, a very deep level to be handling this. You might want to hook the event on a container closer to the element. Since there's just one button, you can hook click on the button but only act on the click if it has the relevant attribute: $("#generateZip").click(function(e) { if ($(this).attr("data-readyzip") !== "start") { // Don't do it; prevent default or cancel bubbling if you like return; } // ...
type: AcceptedAnswer
upvote count: 3
type: Answer
has comment: http://stackoverflow.com/comment/38835879
downvote count: 0

http://stackoverflow.com/a/24991464
score: 2
upvote count: 2
answers question: http://stackoverflow.com/q/24991108
has body: http://jsfiddle.net/PJN6r/ &lt;div class="animate-on-load"&gt; This is animated &lt;/div&gt; $('.animate-on-load').addClass('module'); As per your request. I would not suggest triggering a click on page load. Just add the class on load.
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24991108
type: Answer

http://stackoverflow.com/comment/38930455
type: QuestionComment
comment on: http://stackoverflow.com/q/25031613
has text: @PatrickEvans I have updated with a piece of code for you to better understand.
score: 0
type: Comment

http://stackoverflow.com/q/24935213
tagged with: javascript
tagged with: jquery
has body: I have a AJAX call that adds nested divs (with the class .song_block) to a div (#song_list) on the page. I have a button that I want to hide once the count of nested divs reaches a certain number. Here is my script &lt;script type="text/javascript"&gt; $(document).ready(function() { if($("#song_list").find('.song_block').length == 100){ $('#loadmore').hide(); } }); &lt;/script&gt; Here is the AJAX call &lt;script type="text/javascript"&gt; $(document).ready(function() { $('#loadmore').on('click', function() { $('#loadmore').hide(); $('#loadmore-gif').show(); $.ajax({ type: "GET", url: "/loadmore/", data: { 'slug': $('.dj_slug').text().trim(), 'song_rank': $("#song_list").find('.song_block').length }, }).done(function (response) { $('#song_list').append(response); $('#loadmore').show(); $('#loadmore-gif').hide(); }); }); }); &lt;/script&gt; Now this doesn't work since $(document).ready() doesn't work for AJAX loaded content. How can I handle such a situation using javascript?
favorite count: 0
tagged with: ajax
linked to: http://stackoverflow.com/q/8912411
has comment: http://stackoverflow.com/comment/38748623
has title: document.ready() equivalent for AJAX loaded content
has comment: http://stackoverflow.com/comment/38748523
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38748592
upvote count: 3
possible better answer: http://stackoverflow.com/a/40259981
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/40259981
has answer: http://stackoverflow.com/a/24935482
accepted answer: http://stackoverflow.com/a/24935482
has comment: http://stackoverflow.com/comment/38748386
answer count: 2
has comment: http://stackoverflow.com/comment/38748346
has comment: http://stackoverflow.com/comment/38748661

http://stackoverflow.com/comment/38937648
comment on: http://stackoverflow.com/a/24995279
type: AnswerComment
type: Comment
score: 0
has text: I tried the snippet told by you sir.it worked fine.But what happened is when i check one checkbox,it calls ajax function.after that refreshes and again checkbox count is getting refreshed.if i check any other checkbox from newly checked checkbox it refreshes,what i want thats correct.but the first checkbox which i checked that is remaining unchecked.like firstly i checked first check box.ajax call refreshes the page properly,but the checkbox is not shown as checked.its shown as unchecked but functionality is completed.what to do for that sir

http://stackoverflow.com/q/24917991
has comment: http://stackoverflow.com/comment/38717186
has answer: http://stackoverflow.com/a/24918021
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38716778
accepted answer: http://stackoverflow.com/a/24918021
score: 0
has body: I'm new to javascript/jQuery. I am doing a simple fade slider to use on a page, and I'm trying to put as much as I can inside the object, so it works out of the box whenever I create a new instance of the object. While setting up the navigation, I first did the following: testimonial = new slider($('.testimonials'), $('.testimonials-nav')); testimonial.nav.on('click', function (e) { testimonial.setCurrent($(this).data('dir')); // changes the current slider testimonial.transition(); // what happens when the 'current' changes testimonial.setHeight(); //because everything is 'position: absolute', I set the parent div height with js e.preventDefault(); }); But that way I'd need to repeat all this code everytime I create a new instance of the slider, so I tried a different approach, I created two methods: slider.prototype.init = function () { this.numberEls(); this.setHeight(); this.activateNav(); }; so when I create a new instance I can do the following testimonial = new slider($('.testimonials'), $('.testimonials-nav')); testimonial.init(); and created this method slider.prototype.activateNav = function () { this.nav.on('click', function (e) { this.setCurrent($(this).data('dir')); e.preventDefault(); }); }; but it doesn't work obviously because of the scope of the "this" keyword inside the event handler, how do I make the "this.setCurrent" work in this context? Another question, overall, is it a good approach for what I'm trying to accomplish? remember that it might be used in other parts of the site, not only in testimonials. And if it's not too much to ask, how could I make it loops automatically? I know it involves setTimeOut() or something, but I don't know exactly how (I need to be honest and say it's a lazy question, I actually didn't even try to do it before asking how, but since I am here =P) Heres the fiddle PS. I'm sorry if I didn't make myself clear, english is not my first language and I struggle with it sometimes =P
answer count: 1
has title: Passing 'this' keyword to event on Object Oriented Javascript
has comment: http://stackoverflow.com/comment/38717485
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/20279484
type: Question
duplicate of: http://stackoverflow.com/q/20279484

http://stackoverflow.com/a/25006979
type: Answer
has comment: http://stackoverflow.com/comment/38916025
has body: It seems like events bound in the directive angular-bootstrap-select.extra on the li list items does not get executed when ng-model is attached to this. Reason being:- In the directive angular-bootstrap-select when a model value changes it calls element.selectpicker('refresh'); which eventually in the refresh methods removes and recreates the list items, so the click events bound in the directive angular-bootstrap-select.extra on the li's are lost. You can probably place a quick fix by using event delegation on the parent. Try: element.next().on('click', 'li', function () { target.toggleClass('open') }); Instead of :- element.next().find('li').bind('click', function () { target.toggleClass('open') }) Plnkr
score: 1
has comment: http://stackoverflow.com/comment/38917042
upvote count: 1
answers question: http://stackoverflow.com/q/25004697
has comment: http://stackoverflow.com/comment/38915938
has comment: http://stackoverflow.com/comment/38913667
has comment: http://stackoverflow.com/comment/38916431
downvote count: 0
has comment: http://stackoverflow.com/comment/38917217

http://stackoverflow.com/comment/38813569
score: 0
comment on: http://stackoverflow.com/q/24969866
type: QuestionComment
has text: This should work `var subtot = document.getElementsByClassName("lblcart");` what errors do you get client side?
type: Comment

http://stackoverflow.com/a/24988047
type: Answer
has comment: http://stackoverflow.com/comment/38860981
upvote count: 1
score: 1
has body: My final answer: var aspectRatio = imageWidth / imageHeight; var viewportRatio = viewportWidth / viewportHeight; var adaptedHeight = imageHeight; var adaptedWidth = imageWidth; if (viewportRatio &gt; aspectRatio) // scale by width or height? { adaptedHeight *= viewportWidth / imageWidth; adaptedWidth *= viewportWidth / imageWidth; } else { adaptedHeight *= viewportHeight / imageHeight; adaptedWidth *= viewportHeight / imageHeight; }
answers question: http://stackoverflow.com/q/24987759
downvote count: 0

http://stackoverflow.com/a/66862457
has body: There is a Google Lab to use the Google Places API: Google Maps Web Services Proxy for Mobile Applications It seems that this is the repo: https://github.com/googlecodelabs/google-maps-web-services-proxy
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24954973

http://stackoverflow.com/q/24945323
favorite count: 0
has comment: http://stackoverflow.com/comment/38769604
tagged with: route-provider
tagged with: angularjs
has body: setup: jade, angular, express, node. In my routeProvider of angular, I am having some issues. I am requesting a url with a parameter which it is not catching. var app = angular.module('myApp', ['ngRoute']); app.config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { $routeProvider //... omitted some url/pages here //start of SPA .when('/dashboard/', { templateUrl: 'partials/index', controller: 'dashIndexCtrl' }) .when('/dashboard/class/:id',{ templateUrl: 'partials/class', controller: 'classCtrl' }) .otherwise({ redirectTo: '/' }); $locationProvider.html5Mode(true); }]); When I call localhost/dashboard/class/TEST I get redirected to root. I declare my routes on the server side as follows: app.get('/dashboard', routes.dashboard); app.get('/dashboard/partials/:name', routes.partials); app.get('/api/class/:id', api.classGet); My controller name matches up with the routeProvider. In which case the controller code goes as follows: app.controller('classCtrl', function($scope, $http, $routeParams){ $http.get('/api/class/' + $routeParams.id) .success(function(dataJson){ console.log(dataJson); }); }); Why is routeProvider missing this url? I have set breakpoints within my controller so I am certain it is not being called. Also my partials/class.jade is not being called. Let me know if you need anymore code or directory information. Thanks in advance. After further investigation: If I go: localhost/dashboard/partials/class it will load that jade file. So it is definitely the controller. Directory structure, I believe this is my issue now.... +---\ | +---\views | +---index.jade | +---dashboard.jade | +---\partials | +---index.jade | +---class.jade
tagged with: node.js
type: AnsweredQuestion
has title: $routeProvider.when(..) not catching all URLs
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38768473
has answer: http://stackoverflow.com/a/24946364
type: Question
accepted answer: http://stackoverflow.com/a/24946364
tagged with: javascript
upvote count: 1
answer count: 1

http://stackoverflow.com/q/24990081
tagged with: javascript
has comment: http://stackoverflow.com/comment/38908273
has comment: http://stackoverflow.com/comment/38909222
upvote count: 1
answer count: 1
favorite count: 0
tagged with: backbone.js
has answer: http://stackoverflow.com/a/25020644
accepted answer: http://stackoverflow.com/a/25020644
has body: I have one backbone model that includes validation object with list of validation parameters. var SignUpModel = Backbone.Model.extend({ validation: { firstname: { required: true, pattern: 'name' }, lastname: { required: true, pattern: 'name' } }, addToValidation: function(){ // HOW TO DO THIS??? this.validation.PUSH{ country: { required: true }, phone: { required: true, pattern: 'phone' } } } }); How to add to this object another object? I didn't find it in JS, but maybe this function exists in Backbone or Underscore? Also maybe backbone has special thing for data keeping?
has title: Backbone Validation Add inputs to validation
type: AnsweredQuestion
downvote count: 0
score: 1
type: Question

http://stackoverflow.com/q/25062920
answer count: 0
has comment: http://stackoverflow.com/comment/38990174
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/3059044
duplicate of: http://stackoverflow.com/q/3059044
has title: Google Maps, how to open & close multiple infoboxes
tagged with: google-maps-api-3
type: Question
score: 0
has comment: http://stackoverflow.com/comment/38989387
tagged with: google-maps
tagged with: google-maps-markers
tagged with: javascript
has comment: http://stackoverflow.com/comment/38989649
has body: the following code which is mainly lifted from the Google tutorial and changed infowindows to infoboxes works like this. Loads & Opens all infoboxes correctly. Closes infoboxes when clicked on close icon. Will not Open any infobox when clicking marker, except the last marker added to the map (which is the last in the array if that helps). I've tried several options but am having no luck getting the infobox to open again, except for the last added marker, please help me. function load() { var map = new google.maps.Map(document.getElementById('map'), { mapTypeId: 'roadmap', scrollwheel: false }); google.maps.event.addListener(map, "click", function() { ib.close() }); var ib = new InfoBox(); var bounds = new google.maps.LatLngBounds(); // Change this depending on the name of your PHP file downloadUrl("phpsqlajax_genxml2.php", function(data) { var xml = data.responseXML; var markers = xml.documentElement.getElementsByTagName("marker"); for (var i = 0; i < markers.length; i++) { var name = markers[i].getAttribute("name"); var point = new google.maps.LatLng( parseFloat(markers[i].getAttribute("lat")), parseFloat(markers[i].getAttribute("lng"))); var marker = new google.maps.Marker({ map: map, position: point }); bounds.extend(marker.position); var boxText = document.createElement("div"); boxText.innerHTML = "" + name + " Station Down ";; var myOptions = { content: boxText ,disableAutoPan: false ,maxWidth: 0 ,pixelOffset: new google.maps.Size(-140, 0) ,zIndex: null ,boxStyle: { width: "280px" } ,closeBoxMargin: "-10px -10px 0px 0px" ,closeBoxURL: "close_icon.png" ,infoBoxClearance: new google.maps.Size(1, 1) ,isHidden: false ,pane: "floatPane" ,enableEventPropagation: false }; var ib = new InfoBox(myOptions); ib.open(map, marker); google.maps.event.addListener(marker, 'click', function() { ib.open(map, marker); }); } map.fitBounds(bounds); }); } function downloadUrl(url, callback) { var request = window.ActiveXObject ? new ActiveXObject('Microsoft.XMLHTTP') : new XMLHttpRe…

http://stackoverflow.com/a/24952639
accepted answer of: http://stackoverflow.com/q/24952595
type: Answer
upvote count: 1
answers question: http://stackoverflow.com/q/24952595
has comment: http://stackoverflow.com/comment/38781604
score: 1
type: AcceptedAnswer
downvote count: 0
has body: Because there is no direct link between the instance created and the Person.prototype property, just the object that it refers to. When you do new Person(), the resulting instance's underlying prototype is set to the object Person.prototype refers to at that time. It's the same reason I still get 5 here: var a = [1, 2, 3, 4, 5]; var b = a; var a = [] console.log(b.length); ASCII-art can help here. :-) Initially, you have the Person function with a prototype property referring to an object that has the getFullName function: +-----------+ | Person | +-----------+ +-------------+ | prototype |---->| (object) | +-----------+ +-------------+ +------------+ | getFullName |---->| (function) | +-------------+ +------------+ | ... | +------------+ Then you create an instance of it using var student=new Person("Ankur","Aggarwal");: +-----------+ | Person | +-----------+ +-------------+ | prototype |--+->| (object) | +-----------+ | +-------------+ +------------+ | | getFullName |---->| (function) | | +-------------+ +------------+ +-----------+ | | ... | | student | | +------------+ +-----------+ | | __proto__ |--+ | ... | +-----------+ Then you give Person.prototype a new value, but that has no effect on student's connection to its underlying prototype: +-----------+ | Person | +-----------+ +-------------+ | prototype |---->| (object) | +-----------+ +-------------+ +-----------+ | student | +-----------+ +-------------+ | __proto__ |----->| (object) | | ... | +-------------+ +------------+ +-----------+ | getFullName |---->| (function) | +-------------+ +------------+ | ... | +------------+ Side note: __proto__ is not literally a property name, although it will be as of ES6. In ES5 and earlier, an object's underlying prototype wasn't accessible as a property except on engines that had a non-standard extension. I said there's no direct link between the instance and Person.prototype, which is true. There is an indirect link, but it's not really relevant to the question. Stop…

http://stackoverflow.com/comment/38753843
type: QuestionComment
comment on: http://stackoverflow.com/q/24937941
score: 1
has text: This is incorrect: `$('#search').keyup()(function(){`. Should be `$('#search').keyup(function(){`
type: Comment

http://stackoverflow.com/comment/55087690
type: AnswerComment
comment on: http://stackoverflow.com/a/31538515
type: Comment
score: 1
has text: Can any one explain why removing setDeveloperKey works? Shouldn't it be mandatory entry?

http://stackoverflow.com/a/25030734
has comment: http://stackoverflow.com/comment/38951424
has comment: http://stackoverflow.com/comment/38953600
has comment: http://stackoverflow.com/comment/117396104
has comment: http://stackoverflow.com/comment/38951711
score: 0
has body: You can get the users image by using a url like this: http://gdata.youtube.com/feeds/api/users/communitychannel You can get just the username and image thumbnail by appending a query string as described in the partial responses api: ?fields=yt:username,media:thumbnail You can get the response in json format to use easily in javascript by appending: &amp;alt=json-in-script&amp;format=5 You can also specify a callback to execute when the response has loaded by appending: &amp;callback=showImage Your url now looks like this: http://gdata.youtube.com/feeds/api/users/communitychannel?fields=yt:username,media:thumbnail&amp;alt=json-in-script&amp;format=5&amp;callback=showImage To use this in a page put it in a script tag like so: &lt;script type='text/javascript' src="your_url"/&gt; and the callback should look like this: function showImage(data) { var name= data.entry.yt$username.$t; var url = data.entry.media$thumbnail.url; $(document).append("&lt;img src='"+ url +"'/&gt;"); } You must make sure that the showImage callback function is defined before you load the data.
has comment: http://stackoverflow.com/comment/38967360
answers question: http://stackoverflow.com/q/25029113
type: Answer

http://stackoverflow.com/q/24982936
type: Question
tagged with: javascript
has body: Being very new to javascript, I have two html Number selects including years and I want to chain the 2nd select with the 1st one in a way that when I choose a year in first select(while the second select has no options at first), the second select should include years starting from the chosen number till the current year. My sample HTML Code: choose a year 2000 2001 2002 </select My javascript code: Whenever I choose a year from the 1st select, nothing just happens to the second one and stays empty. I appreciate your correcting my js code or provide new code if mine is completely wrong. or should I use ajax for second select to refresh automatically with new options? Thanks in advance.
score: 0
answer count: 1
has answer: http://stackoverflow.com/a/24983243
has title: Chained html number selects
accepted answer: http://stackoverflow.com/a/24983243
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion

http://stackoverflow.com/q/25064015
tagged with: angularjs
type: AnsweredQuestion
has body: I want to use an AngularJS directive as HTML element, and provide it with two values: One is retrieved by iterating through a collection, and the other one is calculated from that value: &lt;mydirective myval="val" mymagic="getMagic(val)" ng-repeat="val in values" /&gt; It works as expected when the getMagic(val) function always returns the same value. In my case the result values are Arrays, and as each call results in a new value, I will end up in a [$rootScope:infdig] 10 $digest() iterations reached. Aborting! error. You can find a fiddle with my example here (if the function is defined like it is done in the commented line, it works). Is there any way to not reevaluate or "watch" the mymagic parameter? I do want the value to be recalculated when the values collection changes, but the function should not be called apart from that. Is there any way to achieve this?
possible better answer: http://stackoverflow.com/a/25064573
type: Question
has comment: http://stackoverflow.com/comment/38990884
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25068665
answer count: 2
accepted answer: http://stackoverflow.com/a/25068665
has answer: http://stackoverflow.com/a/25064573
has title: Providing dynamic value to directive without causing reevaluation in AngularJS
has comment: http://stackoverflow.com/comment/38990945

http://stackoverflow.com/comment/38718929
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24919275
has text: They have a qa forum. I'd say thats a more appropriate please to seek help. http://www.codecademy.com/forums/javascript-beginner-en-6LzGd/2

http://stackoverflow.com/q/25057164
has title: PHP isset show on button click
tagged with: http://stackoverflow.com/tag/html
favorite count: 0
has answer: http://stackoverflow.com/a/25057507
downvote count: 2
has answer: http://stackoverflow.com/a/25057286
upvote count: 1
tagged with: php
possible better answer: http://stackoverflow.com/a/25057507
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38977865
has comment: http://stackoverflow.com/comment/38977810
tagged with: mysql
score: -1
type: Question
answer count: 2
accepted answer: http://stackoverflow.com/a/25057286
tagged with: javascript
has body: I have edit.php file in which I have multiple if(isset($_POST[])) clauses. I have an if clause if(isset($_POST["view"])) which displays a row from database and another one if(isset($_POST["edit"])) which can edit many rows (number of rows is send via html post method). Is it possible to implement a button which once clicked would show the content of if(isset($_POST["edit"]))?

http://stackoverflow.com/a/25033682
has body: If I well understood your query I think that You must use javascript. If your Joomla version is above 3.0, You can do it with jQuery : jQuery('#radio_selector').on('click', function(){//verification script});
score: 0
type: Answer
answers question: http://stackoverflow.com/q/25012457

http://stackoverflow.com/a/25038105
downvote count: 0
type: Answer
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/25038050
has body: You can access object properties using brackets too: result['saved-jobs'] You can find more here: JavaScript property access: dot notation vs. brackets?

http://stackoverflow.com/q/25047752
has title: Specifying column heights in Google Charts Histogram
type: Question
tagged with: charts
tagged with: google-visualization
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25049324
answer count: 1
has answer: http://stackoverflow.com/a/25049324
has body: I want to draw a Google Charts Histogram with two columns. x-axis consists of some value between 0 and 1. For each x value, there is a corresponding y value for each of the two columns. y is the number of people, and it's usually a very large number. I want the histogram to look like the second example in https://google-developers.appspot.com/chart/interactive/docs/gallery/histogram#Example3 However, they only show examples in which one row in data array represents one y value, and I cannot do this for my data, because y is very large. For example, if y value is 100,000, I have to add 100,000 columns, and this is a waste of resources. I considered using a column chart, but the position of x-axis labels are not proportional to x values. A histogram looks better for this data too. See http://jsfiddle.net/y755h/ for the column chart. Is there any way I can specify y values like 100,000, or 500,000?
type: AnsweredQuestion

http://stackoverflow.com/comment/38782153
comment on: http://stackoverflow.com/a/24950903
has text: Good to hear you figured it out :) nice weekend to you too
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38991283
has text: Nice and clean! Note that CSS3 translations are [not supported in IE<9](http://caniuse.com/transforms2d).
comment on: http://stackoverflow.com/a/25064142
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38804741
comment on: http://stackoverflow.com/a/24964284
type: Comment
has text: oh ok. Just from grepping through the energy2d applet source, it appears it will execute any script supplied with the 'script' parameter to the applet. It retrieves this parameter using http://docs.oracle.com/javase/7/docs/api/java/applet/Applet.html#getParameter%28java.lang.String%29
score: 0
type: AnswerComment

http://stackoverflow.com/q/24924872
has answer: http://stackoverflow.com/a/24924898
has title: Javascript `new` operator & prototype
tagged with: constructor
downvote count: 0
tagged with: new-operator
type: AnsweredQuestion
score: 3
has comment: http://stackoverflow.com/comment/38729511
has comment: http://stackoverflow.com/comment/38729564
has comment: http://stackoverflow.com/comment/38729613
has answer: http://stackoverflow.com/a/41614537
tagged with: prototype
accepted answer: http://stackoverflow.com/a/24925151
type: Question
has body: Say we create a Function named 'Shape', and add a property 'name' &amp; method 'toString' on it's prototype: var Shape = function () {}; Shape.prototype.name = 'Shape'; Shape.prototype.toString = function () { return this.name; } console.log(Shape.name); // '' console.log(Shape.toString()); // function () {} var Triangle = new Shape(); console.log(Triangle.name); // 'Shape' console.log(Triangle.toString()); // 'Shape' 'NEW' operator did two things: 1. It points this to 'Triangle' 2. It points 'Triangle's proto to Shape.prototype Then I can understand when I call name &amp; toString on Triangle, it searches for it's prototype chain till Shape.prototype. But my problem is why not Shape searching for it's property(even it's an Object) for the method &amp; property? Thanks.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38729532
has answer: http://stackoverflow.com/a/24925151
favorite count: 0
upvote count: 3
answer count: 3
possible better answer: http://stackoverflow.com/a/24924898

http://stackoverflow.com/a/25015968
has comment: http://stackoverflow.com/comment/38945724
has comment: http://stackoverflow.com/comment/38917982
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38943674
type: Answer
has body: The problem is likely in one of two places: either in your CSV file, or with the jQuery CSV plugin. Your "UsedSpace" and "Capacity" data series are being interpreted as "string" type, which isn't valid to draw a chart with - they must be "number" type. The first thing I suggest is removing the quotes from around your numbers in the CSV: "Name","UsedSpace","Capacity" "GVLVNX00",378,500 "GVLVNX01",421,500 "GVLVNX02",351,500 "GVLVNX04",421,500 "GVLVNX05",283,500 You then need to tell the jQuery CSV plugin to parse your data as numbers when possible: var arrayData = $.csv.toArrays(csvString, { onParseValue: $.csv.hooks.castToScalar });
has comment: http://stackoverflow.com/comment/38945271
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25008009
has comment: http://stackoverflow.com/comment/38904378
answers question: http://stackoverflow.com/q/25008009
has comment: http://stackoverflow.com/comment/57576761
has comment: http://stackoverflow.com/comment/38942721

http://stackoverflow.com/comment/39045615
comment on: http://stackoverflow.com/q/25038577
has text: Hi Zig, I spent sometime reading about the webRequestAPI but still clueless. My requrirement is simple can I pass document.documentElement.lang="ab-CD" through webRequest so that my webpage will load with instead of Any help will be fine !!
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38865648
score: 0
comment on: http://stackoverflow.com/q/24997508
has text: If those objects ONLY contain the 'name' property, then you can just use underscore's pluck() to get the values (like: _(beforeList).pluck('name'); ) and then do a normal union() which will combine two lists, discarding duplicates
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38852584
score: 0
type: Comment
has text: Thanks, but i haven't learned jQuery jet, since i can do everything in javascript. I know it's "harder", but it doesn't matter. In javascript I have indeed tried to add the event to the document - document.addEventListener ...- or something like that. Same result.
comment on: http://stackoverflow.com/a/24990595
type: AnswerComment

http://stackoverflow.com/q/25007171
has body: I am needing to create a calculator in javascript for a website that is wanting to display a total number of items distributed (similar to Apple's iTunes download promotions). The math for the calculation part is easy, it's a whole number approximately every 6 hours, I just am having difficulty making some existing javascripts work because they reset every time the user refreshes the browser page. What is the best way to keep a running total in javascript? Any help is greatly appreciated, thank you!
has comment: http://stackoverflow.com/comment/38883838
answer count: 0
score: 0
has comment: http://stackoverflow.com/comment/38883794
has comment: http://stackoverflow.com/comment/38883873
has comment: http://stackoverflow.com/comment/38883968
tagged with: javascript
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38883857
type: Question
tagged with: http://stackoverflow.com/tag/html
has title: Adding a running total calculator with javascript for a website

http://stackoverflow.com/a/24954395
type: Answer
has comment: http://stackoverflow.com/comment/38785210
has comment: http://stackoverflow.com/comment/38784843
answers question: http://stackoverflow.com/q/24954267
has body: I just updated your fiddle to be the more-usual KO pattern: http://jsfiddle.net/Z3gNC/1/ function Person(name, age) { this.name = ko.observable(name); this.age = ko.observable(age); } $(function () { var vm = (function () { var person = new Person("ABC", 23); return { person: person }; })(); ko.applyBindings(vm); }); The reason you see 'c' in your original fiddle is because vm.person is a ko.observable function, which when minimised looks like: function c(){if(0&lt;arguments.length)return c.Ka(d,arguments[0])&amp;&amp;(c.P(),d=arguments[0],c.O()),this;a.k.zb(c);return d} Every function has a name property: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/name so in this case vm.person.name is the name of the function vm.person which when minified is 'c' ! Edit: if you use a single observable Person, KO won't know that the inner property changes, unless you tell it with a valueHasMutated call. This next demo uses your VM structure and binds the changes in the textbox to the span, via a change event and a valueHasMutated call. So it works, but the 'pure' KO approach above is perhaps preferable for simplicity. http://jsfiddle.net/Z3gNC/6/ function Person(name, age) { this.name = name; this.age = age; } $(function () { var vm = (function () { var person = ko.observable(new Person("ABC", 23)); var mutate = function(data, event) { data.person.valueHasMutated(); } return { person: person, mutate: mutate }; })(); ko.applyBindings(vm); }); ... which needs this HTML: &lt;input data-bind="value:person().name, event: {change: mutate}" /&gt;
upvote count: 1
has comment: http://stackoverflow.com/comment/38784930
has comment: http://stackoverflow.com/comment/38784523
has comment: http://stackoverflow.com/comment/38784668
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38785184

http://stackoverflow.com/a/25066599
type: Answer
answers question: http://stackoverflow.com/q/25066538
has body: Month: new Date().getMonth() Year: new Date().getFullYear()
score: 0

http://stackoverflow.com/q/25052145
has comment: http://stackoverflow.com/comment/38972733
has comment: http://stackoverflow.com/comment/38971129
has title: Google Map Markers does not appear in $.getJSON Javascript
has answer: http://stackoverflow.com/a/25052206
type: Question
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/json
has body: I am reading from a JSON file to plot my latitude and longitude onto Google Maps. I have tried using different approaches but nothing showed up. For this approach, the map showed but the markers are not there. //this is my json file: out1copy.json [{ "GPSLatitude": "1.306279", "GPSLongitude": "103.904783", "Title": "Joo Chiat Road" }, { "GPSLatitude": "1.343176", "GPSLongitude": "103.851983", "Title": "Braddell Road" }, { "GPSLatitude": "1.318105", "GPSLongitude": "103.766597", "Title": "Clementi Avenue" }, { "GPSLatitude": "1.427895", "GPSLongitude": "103.837806", "Title": "Yishun Central" }] This is my html file: Try (Markers gone) Where could have gone wrong?
tagged with: google-maps-markers
answer count: 1
tagged with: javascript
score: 0
accepted answer: http://stackoverflow.com/a/25052206

ios
tags question: http://stackoverflow.com/q/24935541
tags question: http://stackoverflow.com/q/24996145
tags question: http://stackoverflow.com/q/24943202
tags question: http://stackoverflow.com/q/25026109
tags question: http://stackoverflow.com/q/25013565
tags question: http://stackoverflow.com/q/24961294
tags question: http://stackoverflow.com/q/25056735
type: Tag
tags question: http://stackoverflow.com/q/24953746
tags question: http://stackoverflow.com/q/25000939
tags question: http://stackoverflow.com/q/24959513
tags question: http://stackoverflow.com/q/24977964
tags question: http://stackoverflow.com/q/24981959
tags question: http://stackoverflow.com/q/25039064
tags question: http://stackoverflow.com/q/25025525
tags question: http://stackoverflow.com/q/24977653
tags question: http://stackoverflow.com/q/25008690
tags question: http://stackoverflow.com/q/25042009
tags question: http://stackoverflow.com/q/24963302
tags question: http://stackoverflow.com/q/25001566
tags question: http://stackoverflow.com/q/24990960
tag name: ios
tags question: http://stackoverflow.com/q/24949784
tags question: http://stackoverflow.com/q/24962162
tags question: http://stackoverflow.com/q/25053452
tags question: http://stackoverflow.com/q/25003280
tags question: http://stackoverflow.com/q/24929552
tags question: http://stackoverflow.com/q/25010444
tags question: http://stackoverflow.com/q/24925251
tags question: http://stackoverflow.com/q/25016697
tags question: http://stackoverflow.com/q/24999011
tags question: http://stackoverflow.com/q/24954973
tags question: http://stackoverflow.com/q/24980919
tags question: http://stackoverflow.com/q/25029673
tags question: http://stackoverflow.com/q/25059764
tags question: http://stackoverflow.com/q/25045903
tags question: http://stackoverflow.com/q/25061698

http://stackoverflow.com/q/24960637
has comment: http://stackoverflow.com/comment/38796779
type: Question
has comment: http://stackoverflow.com/comment/38799578
has comment: http://stackoverflow.com/comment/38883158
has answer: http://stackoverflow.com/a/24960987
accepted answer: http://stackoverflow.com/a/24960987
answer count: 1
tagged with: javascript
score: 0
has title: Angular resolve within a controller
has comment: http://stackoverflow.com/comment/38796971
tagged with: angularjs
has body: In my global/main controller I load a few ngResources. How can I pause execution of anything else until loaded? similar to the resolve property of routes. // The "global" controller in which I perform one time on load actions. app.controller('FrontendCtrl', function($scope, authService, sessionService) { // Here I check if the user has a cookie and if so fetch info from server to reinit session authService.updateUser(); $scope.$session = sessionService; }); // Auth service app.factory('authService', function($q, Auth, Other, sessionService) { // Populate local user data from server - one query followed by a few subsequent ones - all are ngResources var updateUser = function() { Auth.profile(null, function(data) { if(data) { $q.all({ foo: Other.foo({ user_id: data.id }), bar: Other.bar({ user_id: data.id }), }) .then(function(results) { sessionService.user = _.merge(results, data); }); } }); }; }); // In my view - this doesn't work if there is a delay in loading the updateUser function {{ $session.user.name }}
type: AnsweredQuestion

http://stackoverflow.com/comment/38769014
comment on: http://stackoverflow.com/q/24945690
score: 0
has text: Well, I guess it is not a scope issue for it works fine with chrome and the same about the id selectors..I'll try to add some more information..
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38804754
type: Comment
comment on: http://stackoverflow.com/a/24964804
score: 0
type: AnswerComment
has text: I tried adding the timer and the problem remained. :/

http://stackoverflow.com/comment/38830517
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24978899
has text: Yes, it's an IIFE, see this question http://stackoverflow.com/questions/8228281/what-is-this-iife-construct-in-javascript
type: AnswerComment

http://stackoverflow.com/comment/38784859
comment on: http://stackoverflow.com/a/24954105
type: Comment
has text: Well for that we would need to know a bit more about your architecture, but based on what I know at the moment, just moving it outside of the `.jqimessage` container will make it static (in this case), that way you could register the event again and the function will actually exist.
score: 0
type: AnswerComment

http://stackoverflow.com/q/24934391
has title: How to get line bookmark event in ace online code editor?
type: Question
score: 2
has body: I just started with Ace online code editor and it looks very powerful and easily customizable. I am using the editor as a syntax highlighter on my website. I wanted to implement line bookmarking functionality like Github Gists on my editor. And since github uses Ace editor, I think it will be possible. But there are lots of api and events in Ace editor and I am confused which one to use. If somebody has already implemented the above mentioned feature then please help me out with the api and events needed to implement it. Thanks in advance.
downvote count: 0
tagged with: javascript
answer count: 3
tagged with: github
has answer: http://stackoverflow.com/a/58078581
favorite count: 0
has answer: http://stackoverflow.com/a/24934960
tagged with: ace-editor
has answer: http://stackoverflow.com/a/32209861
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/q/24936172
tagged with: http://stackoverflow.com/tag/pdf
tagged with: http://stackoverflow.com/tag/html
has title: Download pdf generated from base64 in pdf.js
score: 0
type: Question
has body: I followed some step to view a base64 generated PDF in pdf.js, and it work well. I have only one problem, i can't download it. I get this error: Uncaught TypeError: Cannot read property 'split' of undefined on this instruction: var url = this.url.split('#')[0]; Actually i don't have any url, i put my b64 string in localStorage and i directly open it in viewer.js like this: var b64Array=new Uint8Array(base64DecToArr(localStorage['pdf'])); var int8View = b64Array; So i access the viewer by the standart url with no params: /pdfjs/web/viewer.html There is a way to solve this problem ?
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24955486
answer count: 1
accepted answer: http://stackoverflow.com/a/24955486
tagged with: javascript
has comment: http://stackoverflow.com/comment/38766596
tagged with: pdf.js

http://stackoverflow.com/a/25066174
upvote count: 8
type: Answer
score: 8
answers question: http://stackoverflow.com/q/25066052
accepted answer of: http://stackoverflow.com/q/25066052
has body: When you modify the body.innerHTML property, it causes the entire body element to be reconsidered. The iframe element is effectively removed from the DOM and is inserted again, causing it to load twice. The offending line: document.body.innerHTML += ' loaded ';
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/q/24969099
downvote count: 0
answer count: 1
tagged with: javascript
has title: Hide dropdownlist of extjs combobox
favorite count: 0
tagged with: extjs
has answer: http://stackoverflow.com/a/24969463
has body: Hi a newbie in extjs I want to ask you guys on how to hide the dropdownlist of extjs combobox onmouseout. var combo = new ext.form.combobox({ width: 178, store: store, displayField: 'name', valueField: 'value', triggerAction: 'all', emptyText: 'blank' }); combo.applyTo('id');
type: UnansweredQuestion
upvote count: 1
tagged with: ascx
type: Question
score: 1

http://stackoverflow.com/comment/38952929
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25042754
has text: As a test, why don't you try putting the click event on the `a` instead of the `span`: `$("#S1").parent().click(...`. Since your html code snippet shows that the `span` tag has no text, I'm betting that you have some other code that is putting something in there. That code is not in your example and could be the source of the problem.

http://stackoverflow.com/a/24956988
upvote count: 1
has body: may be it will help function reloadData() { // a call to the async method $scope.loading = true; recentClients().then(function(data) { // console.log(data); $scope.loading = false; $scope.client = data; }); } // Start Interval var timerData = $interval(function () { if(!$scope.loading){ reloadData(); } }, 1000);
answers question: http://stackoverflow.com/q/24956641
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/comment/38893114
has text: @Alexvan I got it, don't worry. In 2.php you have to echo the json encoded `$PHPvariable`.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25011979

http://stackoverflow.com/q/24940639
type: Question
score: 1
has body: This is a simplified example of the projects I've worked on. Everything is working properly but for some reason the memory usage increases, Some of the elements are not deleted from the DOM. I have read many articles about Backbone memory leaks but it didn't help. I'm using Backbone.stickit to model binding and I think this is causing the problem. How should I fix this code for best memory performance? Check my sample code on jsbin and performance test video on vimeo test var Data = Backbone.Model.extend({ defaults: { title: "Default Title" }, }); var ItemForm = Backbone.View.extend({ template: _.template(" Your title: <%= title %> <input name='title' value=<%= title %> /> Close "), events: { 'click [name=close]':'closeEditForm' }, bindings: { 'input[name=title]': { observe: 'title', events: ['blur'] } }, initialize: function () { this.listenTo(this.model,'change',this.render); }, render: function() { this.$el.html( this.template( this.model.toJSON() ) ); this.stickit(); return this; }, closeEditForm: function () { // this.undelegateEvents(); this.unstickit(); this.remove(); delete this.$el; // Delete the jQuery wrapped object variable delete this.el; // Delete the variable reference to this node } }); var Item = Backbone.View.extend({ tagName: 'li', template: _.template("<%=title %> Remove Edit "), events: { 'click [name=removeItem]':'removeItem', 'click [name=editItem]':'editItem' }, initialize: function () { this.listenTo(this.model,'change',this.render); this.render(); }, render: function() { this.$el.html( this.template( this.model.toJSON() ) ); this.stickit(); return this; }, removeItem: function () { // this.undelegateEvents(); this.unstickit(); this.remove(); delete this.$el; // Delete the jQuery wrapped object variable delete this.el; // Delete the variable reference to this node }, editItem: function() { $('#main').append( new ItemForm({model: this.model }).render().el ); } }); var Menu = Backbone.View.extend({ el: '#Menu', template: " ADD NEW ", events: {…
downvote count: 0
tagged with: javascript
favorite count: 0
tagged with: backbone.js
has title: Backbone Memory Leak on very basic example
tagged with: backbone-stickit
type: UnansweredQuestion
tagged with: memory-leaks
answer count: 0
upvote count: 1

http://stackoverflow.com/comment/38909016
comment on: http://stackoverflow.com/a/25020413
score: 0
type: Comment
has text: A line of code is not an answer. Why should this answer work? If the OP knew, the question wouldn't exist.
type: AnswerComment

http://stackoverflow.com/a/25016009
score: 0
type: AcceptedAnswer
has body: I use a combination of both. I have 2 global variables (mousex,mousey) I update these on mousemove And i have a draw loop that start on load and repeast every ,n-seconds Edit: the idea is to split the visual and the working code (collision,score,...) The drawing loop fires every 2 sec while the mousemove is updated on everymove -the loop is that set so slow becaus it show the diffrence example : jsfiddle.net/9jW3d/show/``
type: Answer
has comment: http://stackoverflow.com/comment/38900561
accepted answer of: http://stackoverflow.com/q/25015240
answers question: http://stackoverflow.com/q/25015240

http://stackoverflow.com/q/24946599
type: AnsweredQuestion
has body: I'm having problem on single and double quote in window location in javascript. I have this data in my database test's data and i use this in window location like this : function test(name){ window.location.href = "http://localhost/test/tests.php?name="+ name; } this is my php code: $name = "test's data"; echo ' TEST '; and if you check it in development tool it would be like: TEST i know my error is the quotation in test('test's data'). How can i fix my quotations in function so it will redirect you to another page test.php?
has answer: http://stackoverflow.com/a/24946998
downvote count: 1
type: Question
answer count: 2
upvote count: 0
accepted answer: http://stackoverflow.com/a/24946998
has comment: http://stackoverflow.com/comment/38770624
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24946960
has answer: http://stackoverflow.com/a/24946960
has comment: http://stackoverflow.com/comment/38770382
has comment: http://stackoverflow.com/comment/38770381
favorite count: 0
has title: window location not working javascript
tagged with: php
score: -1

http://stackoverflow.com/comment/39000055
type: Comment
type: QuestionComment
has text: @amenthes the symbol variable names are in the original d3 source code, as a way of creating short but meaningful names. Re the original question: why are you copying the library into a new file, and what editor are you using to create it? A good editor shouldn't be inserting HTML entities in scripts.
comment on: http://stackoverflow.com/q/25061579
score: 0

http://stackoverflow.com/q/24975684
answer count: 2
has comment: http://stackoverflow.com/comment/38824444
downvote count: 0
tagged with: asp.net-web-api
tagged with: javascript
has body: Here is a link to their API documentation I would like to practice web programming by creating a bitcoin price ticker from scratch. My plan is to serve a script that makes api calls to exchanges to display the data. This will mean I only have to serve the script, not handle the data server-side. I know that part of programming is learning from documentation, but the docs from bitfinex are very sparse and I couldn't find a tutorial. I created an index.html to test my javascript. It returns a console error: XMLHttpRequest cannot load https://api.bitfinex.com/v1/pubticker/:last_price. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. Here is the full index.html: &lt;html&gt; &lt;head&gt; &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"&gt; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;script&gt; $.getJSON("https://api.bitfinex.com/v1/pubticker/:last_price", function(data, status){ alert("price: "+data +" status: " + status); } ) &lt;/script&gt; Thank you stack exchange &lt;/body&gt;
favorite count: 0
has answer: http://stackoverflow.com/a/31371019
upvote count: 3
type: UnansweredQuestion
score: 3
has title: How do I get data from the Bitfinex web API using javascript
has answer: http://stackoverflow.com/a/24976005
type: Question

elgg
tags question: http://stackoverflow.com/q/25016118
tag name: elgg
type: Tag

http://stackoverflow.com/comment/38732468
comment on: http://stackoverflow.com/q/24926221
score: 1
type: Comment
type: QuestionComment
has text: @trainoasis I do check for previous answers before I ask my own. The ones you mention do not answer the question. (Sometimes people are VERY quick to mark a question as duplicate without actually checking. This hurts the chances of the new question being answered.)

http://stackoverflow.com/q/25035911
score: 0
answer count: 1
has title: Focus going out of the popup page to the parent page
has answer: http://stackoverflow.com/a/25036173
type: UnansweredQuestion
tagged with: css
has body: I have a popup page loading on signin button click. The problem is when I keep pressing tabs, the focus is going out to the parent page. I want the focus to keep looping on the popup on tab press until it is closed http://jsfiddle.net/2EXL5/ HTML Code Sign in Help Signup First Name Last Name Email Id Password Sign Up X Login Email Id Password Sign In
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38938140

http://stackoverflow.com/a/24915039
upvote count: 1
score: 1
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24913939
has body: see this code i hope it works. jQuery(document).ready(function($) { $('input[name=region]').change(function(){ alert(this.value); $('form').submit(); }); });

http://stackoverflow.com/a/25025290
score: 0
has body: The usual usecase for JSONP doesn't involve hard coding the script element into the page. It dynamically generates the script element on demand. By using a function, you can perform an action with the data when the script loads. The alternative would be to insert the script element and then keep polling the global namespace to see if the variable had been populated yet or not.
type: Answer
answers question: http://stackoverflow.com/q/25025238

http://stackoverflow.com/comment/39320587
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25052294
type: Comment
has text: @GuyT I'm a little disappointed that I still can't get it to work, I've given the noconflict jquery a try but that also doesn't seem to work.

http://stackoverflow.com/comment/38951311
has text: Just remove Name</options> if you don't want empty option. Check Angular select documentation. https://docs.angularjs.org/api/ng/directive/select
comment on: http://stackoverflow.com/a/25042321
type: AnswerComment
type: Comment
score: 0

http://stackoverflow.com/q/25032734
score: 0
accepted answer: http://stackoverflow.com/a/25035175
has title: phonegap get a valid base64 code from camera or gallery (android)
tagged with: android
linked to: http://stackoverflow.com/q/14322482
tagged with: cordova
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/6321555
type: Question
answer count: 1
has answer: http://stackoverflow.com/a/25035175
has body: I want to upload a base64 image to my server, but I can't get a complete base64 Code from the camera or the gallery. My code is the following: navigator.camera.getPicture(onSuccess, onFail, { quality: 100, destinationType: Camera.DestinationType.DATA_URL, EncodingType: 1 }); function onSuccess(imageUri) { console.log('ImageURI ' + imageUri); } When the Code is printed to the console, I copy this code and try to valid it like the guy did in this inactive post, with the same issue as he has. phonegap picture base64 android It can't be a limit on the console, because I can get complete base64 codes from local images. I've tried some other qualities too, like 50 or 10.
tagged with: javascript

http://stackoverflow.com/q/25061577
has answer: http://stackoverflow.com/a/25064222
linked to: http://stackoverflow.com/q/3369045
downvote count: 0
score: 1
possible better answer: http://stackoverflow.com/a/36688862
type: Question
type: AnsweredQuestion
tagged with: jquery-ui
has title: How to pass aspectRatio option to alsoResize Object in jQuery UI's resizable function?
tagged with: javascript
tagged with: resize
accepted answer: http://stackoverflow.com/a/25064222
answer count: 2
has body: Alright, to make it short, here you can see the problem: http://jsfiddle.net/EgBh3/ When resizing the slider on the left side the video on the right is resizing too. It's not implemented in the jQuery UI that the other div size is inverted when resizing. I found this useful function here: jQuery UI Resizable alsoResize reverse The problem is that the aspect ratio of the video changes. If you play it after resizing you see that the control bar is longer than the video itself for example. The normal resizable() function offers the option to set an aspectRatio that should be kept. But is it possible to pass such an option to the alsoResizeReverse function? If yes, how? Here's the code: HTML: 1 2 3 4 5 CSS: *{ padding: 0; margin: 0; } body{ font-family: Arial, Helvetica, Verdana, sans-serif; font-size: 12px; } #wrapper{ width: 980px; height: 1000px; margin: 0 auto; margin-top: 20px; box-shadow: 0 0 10px #ccc; } #slider{ width: 400px; height: 300px; float: left; margin-left: 10px; } #video_wrapper{ float: right; margin-right: 10px; } #video_wrapper video{ width: 548px; height: 308px; } .bx-pager{ display: none; } #custom_pager{ float: left; width: 400px; height: auto; } #custom_pager li{ float: left; list-style-type: none; cursor: pointer; padding: 0 3px; } #custom_pager li:hover { font-weight: bold; } .bx-wrapper{ margin-bottom: 0 !important; } .current_slide{ font-weight: bold; } .ui-resizable-se{ z-index: 300000 !important; } Javascript/jQuery: $('.bxslider').bxSlider({ mode: 'fade', infiniteLoop: false, hideControlOnEnd: true, keyboardEnabled: true, useCSS: false, controls: false }); $('#slider').resizable({ aspectRatio: 750 / 577, handles: 'se', containment: '#wrapper', autoHide: true, alsoResizeReverse: "#movie", resize: function (e, ui) { $('.bxslider img, .bx-viewport, .bx-wrapper').css({ width: ui.size.width, height: ui.size.height }); $('.bx-wrapper img').css({ maxWidth: ui.size.width }); $('#custom_pager').css({ width: ui.size.width }); //console.log($('#custo…
upvote count: 1
tagged with: jquery
has answer: http://stackoverflow.com/a/36688862
favorite count: 0

http://stackoverflow.com/q/24976031
answer count: 1
upvote count: 1
has title: Raphaeljs resize canvas to fit content
type: AnsweredQuestion
score: 1
tagged with: raphael
type: Question
has answer: http://stackoverflow.com/a/25041031
accepted answer: http://stackoverflow.com/a/25041031
downvote count: 0
tagged with: javascript
favorite count: 0
has body: In Raphaeljs I have content that is exceeding the canvas size. What I want to do is to have the canvas expand and have a container around the canvas that is scrollable so the user can view all of the content. &lt;div class="canvas_container" id="canvas_container"&gt; &lt;svg&gt; &lt;/svg&gt; &lt;/div&gt; Is there any way that I can Resize the Raphaeljs canvas after all of the content has been loaded so that it fits everything? Basically, a "scale to fit". My canvas_container div is set to have a scrollable overflow, so if I can just get Raphaeljs to resize to fit everything then it should work.

http://stackoverflow.com/comment/38780369
type: AnswerComment
score: 0
has text: Nope, that will animate `.dot` slower and slower by each one and I need same animation duration on every `.dot`.
type: Comment
comment on: http://stackoverflow.com/a/24951513

http://stackoverflow.com/a/24985198
upvote count: 1
answers question: http://stackoverflow.com/q/24985079
downvote count: 0
type: Answer
has body: Without forloop: var number = 0; var interval = setInterval(function(){ alert(number); number++; if(number === 3) { clearInterval(interval); } }, 2000); JSFIDDLE
score: 1

http://stackoverflow.com/a/24999437
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24996642
has body: There are 2 problems with your code: The label needs a for attribute and the input needs a unique id such that the for and id have the same value. e,g: The Radio Label After adding the dynamic radio buttons, instead of refreshing the controlgroup, initialize the checkboxradio widget: $('#semList').html( data ); $('#semList input[type="radio"]').checkboxradio(); Here is a working DEMO

http://stackoverflow.com/comment/38757858
comment on: http://stackoverflow.com/q/24939644
type: Comment
type: QuestionComment
score: 0
has text: no javascript errors in dev tools.

http://stackoverflow.com/comment/38936126
type: QuestionComment
comment on: http://stackoverflow.com/q/25034879
score: 0
has text: Your last line confused me. Are you using the Dojo AMD loader or RequireJS? They have different error handling, so if you're using Dojo, it won't work as described in your question. Print the following in your console: `define.amd`, what does it say?
type: Comment

http://stackoverflow.com/comment/38875844
score: 0
type: Comment
type: QuestionComment
has text: My trouble is that this is a discussion forum, so I have no direct way to change the AJAX call. All I can do is decide the code that gets injected by the AJAX call. What I'm doing is probably better served by a server side script like PHP, but I don't have access to the server either, so it has to be generated by JavaScript or some other in-line method. The result will be a DIV with a SCRIPT inside that dynamically generates content and inserts it into the DIV, but because it's dynamic content, the DIV can't have a specific ID.
comment on: http://stackoverflow.com/q/25000378

http://stackoverflow.com/comment/38735216
comment on: http://stackoverflow.com/q/24928167
score: 0
type: Comment
has text: try using var_dump($_POST); to see what you are getting.
type: QuestionComment

http://stackoverflow.com/comment/38824467
has text: @guest271314 - I don't know if jQuery will remove/change `.notify()` or when. It is being removed from the promise standards (to be done a different way) and I assume that eventually jQuery will follow those specifications because they will want to be able to interoperate with promises and notifications that come from outside of jQuery. It's not an imminent thing, just something I picked up by reading what the folks who work on the promise standards write and do, so something I figured I would avoid until it's being done a way that is not as likely to be changed.
comment on: http://stackoverflow.com/a/24973026
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25038713
has comment: http://stackoverflow.com/comment/38943850
answers question: http://stackoverflow.com/q/25038670
type: Answer
has comment: http://stackoverflow.com/comment/38943911
has comment: http://stackoverflow.com/comment/38943024
has comment: http://stackoverflow.com/comment/38943669
score: 3
has comment: http://stackoverflow.com/comment/38943829
has comment: http://stackoverflow.com/comment/38942967
upvote count: 3
has comment: http://stackoverflow.com/comment/38955968
downvote count: 0
has comment: http://stackoverflow.com/comment/38943584
has body: IDs should be unique. The moment you change the id to a class (#con -> .con) and modify your code appropriatelly, they all will be selected. See this example: http://jsfiddle.net/shomz/38PB2/

http://stackoverflow.com/comment/38943911
type: Comment
has text: yea I will because of this I have lost my precious time
comment on: http://stackoverflow.com/a/25038713
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38786131
type: Comment
comment on: http://stackoverflow.com/a/24946018
has text: No I don't have access to the code or people. But the page is static and the link always calls this function.
type: AnswerComment
score: 0

http://stackoverflow.com/a/25488580
type: AcceptedAnswer
type: Answer
accepted answer of: http://stackoverflow.com/q/24966674
has body: The issue I was having was in the Gemfile: turbolinks. Turbolinks was behaving as designed--it was not reloading the page unless I refreshed the page. The reason this worked in my IE browser is when turbolinks fails (old browser) it fails gracefully and allows the pages to be reloaded (I learned all of this from Rails Cast #390. All I needed to do was put my code in a variable ready = -> (all of my code) call this variable on document ready $(document).ready(ready) Tell turbolinks about it $(document).on('page:load', ready)
score: 0
answers question: http://stackoverflow.com/q/24966674

http://stackoverflow.com/comment/38950680
score: 1
type: Comment
has text: You're trying to make something that jQuery already has built in, just do `var index = $("#list").children().index(this)`
type: QuestionComment
comment on: http://stackoverflow.com/q/25042645

http://stackoverflow.com/a/24975963
score: 6
accepted answer of: http://stackoverflow.com/q/24975843
has body: Here's one way to do this: http://jsbin.com/xavaxudi/1/edit?js,console. Note: this is something I just wrote up in a few minutes. If you're dealing with large quantities of data then you'll probably have to optimize accordingly. var rawFbData = { "wed_1_open": "17:00", "wed_1_close": "02:00", "thu_1_open": "17:00", "thu_1_close": "02:00", "fri_1_open": "17:00", "fri_1_close": "02:00", "sat_1_open": "12:00", "sat_1_close": "02:00", "sun_1_open": "12:00", "sun_1_close": "20:00" }; console.log(rawFbData); var formattedData = {}; for (var key in rawFbData) { if (key.substr(-5) === '_open') { var openDay = key.substr(0, 3); var openTime = rawFbData[key]; var endTimeKey = key.replace('_open', '_close'); var endTime = rawFbData[endTimeKey]; var formattedDataKey = openTime + ' - ' + endTime; if (formattedData[formattedDataKey] === undefined) { formattedData[formattedDataKey] = []; } formattedData[formattedDataKey].push(openDay); } } //console.log(formattedData); for (var formattedDatakey in formattedData) { var formattedDatakeyLen = formattedData[formattedDatakey].length; if (formattedDatakeyLen &gt; 1) { var firstDay = formattedData[formattedDatakey][0]; var lastDay = formattedData[formattedDatakey][formattedDatakeyLen - 1]; console.log(firstDay + ' - ' + lastDay + ': ' + formattedDatakey); } else if (formattedData[formattedDatakey].length === 1) { console.log(formattedData[formattedDatakey][0] + ': ' + formattedDatakey); } }
answers question: http://stackoverflow.com/q/24975843
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 6
has comment: http://stackoverflow.com/comment/38825164

http://stackoverflow.com/q/25055209
has comment: http://stackoverflow.com/comment/38974334
tagged with: javascript
score: 0
answer count: 1
type: UnansweredQuestion
has body: I'm trying to create a clone of an self.tags observable array within each line object I create, where self.field_name reflects the value but self.field_value is an independant value for each Line object. I'm getting a bit mixed up how to do this, do I need a manual subscription to only update one of the values? function TechnicalViewModel(){ var root = this; function Tag(data){ var self = this; self.field_name = ko.observable(data.field_name) self.field_value = ko.observable(data.field_value) } root.tags = ko.observableArray([ { new Tag(field_name : 'tag_name_1', field_value : '', new Tag(field_name : 'tag_name_2', field_value : '', new Tag(field_name : 'tag_name_3', field_value : '' }]) function Line(data) { var self = this; self.tags = root.tags; } root.lines = ko.observableArray([])) }
has title: Create clones of root model observable array within objects
tagged with: knockout.js
type: Question
has answer: http://stackoverflow.com/a/25056454
has comment: http://stackoverflow.com/comment/38975158

http://stackoverflow.com/comment/38950158
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25042373
has text: Thanks, now how do I implement this into the tag?
type: AnswerComment

http://stackoverflow.com/q/25039916
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/33314019
downvote count: 0
tagged with: nginx
has answer: http://stackoverflow.com/a/70715681
has body: I have this node.js app proxied by Nginx (on production). A route is something like this: exports.download = function(req, res){ var id = req.params.id; if (id &amp;&amp; id == 'latest') { res.download(config.items.release_directory+'/&lt;1.6GB-file&gt;.zip', function(err){ if (err) { console.log(err); } else { // do something } }); } else { res.redirect(301, '/'); } }; So, clicking the right route/URL the browser starts to download the big file but then it stops always at 1.08GB (the file is about 1.6GB), truncating it. I really cannot understand why. Any ideas? EDIT: The config.items.release_directory is a static Express directory declared as: app.use('/releases', express.static(path.join(__dirname, '..', 'releases'))); EDIT2: On development with grunt serving directly the app without Nginx it works fine. SOLVED: read the comments below, problem is proxy_max_temp_file_size variable in Nginx
has answer: http://stackoverflow.com/a/64282626
type: Question
upvote count: 6
tagged with: javascript
has answer: http://stackoverflow.com/a/25041896
tagged with: express
favorite count: 0
possible better answer: http://stackoverflow.com/a/64282626
tagged with: node.js
answer count: 4
tagged with: file
score: 6
has title: Nginx node.js express download big files stop at 1.08GB
has comment: http://stackoverflow.com/comment/38945931
has answer: http://stackoverflow.com/a/33314019

http://stackoverflow.com/q/25011297
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38896252
favorite count: 0
has answer: http://stackoverflow.com/a/25011675
linked to: http://stackoverflow.com/q/10636611
has body: In my Google Chrome Extension, I want to store the page source of a URL input by the user in a string and then parse it. I found similar questions and I tried the following methods: var titleList = $.getJSON(URL); Error: No 'Access-Control-Allow-Origin' header is present on the requested resource. $.get(URL, function (response) { alert(response) }); Error: GET chrome-extension://lcacjlgephhfpadlaehfejnlkgpnacfg/www.google.com net::ERR_FILE_NOT_FOUND
tagged with: google-chrome-extension
has comment: http://stackoverflow.com/comment/38898369
has title: Get page source using Javascript, given a certain URL
upvote count: 2
type: UnansweredQuestion
downvote count: 1
score: 1
type: Question
has comment: http://stackoverflow.com/comment/38896452

http://stackoverflow.com/comment/38978202
type: Comment
has text: you want to update and remove the tag value individually right? have you seen updated fiddle?
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25056454

http://stackoverflow.com/a/24992878
has comment: http://stackoverflow.com/comment/38856869
downvote count: 0
answers question: http://stackoverflow.com/q/24992773
has comment: http://stackoverflow.com/comment/38856789
upvote count: 1
has comment: http://stackoverflow.com/comment/38856737
has body: as the documentation says "will return a jQuery collection" you should try changing your code in: var imagesrc = $(this).find(".shape img").first().attr("src"); alert(imagesrc);`
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38857368
has comment: http://stackoverflow.com/comment/38856877

http://stackoverflow.com/q/25068855
has comment: http://stackoverflow.com/comment/39000741
has comment: http://stackoverflow.com/comment/39000561
has comment: http://stackoverflow.com/comment/39000600
downvote count: 1
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/39000824
score: -1
type: Question
has title: Javascript click event fired twice, already stopping proagation
upvote count: 0
has answer: http://stackoverflow.com/a/25069124
tagged with: javascript
has comment: http://stackoverflow.com/comment/39000676
has body: I have a very very strange problem, but I can't replicate it here, because I can't track down what is generating it, and it's part of a 200+ lines JS file, I will try to explain it at my best: My problem is regarding DOM manipulation, I'm only using vanilla JavaScript. I have an element A, when you click on it, a function is triggered to show the content of a div, I'm simply using addEventListener('click', function(){ ... }, false). It works. On the same page, I have a similar situation, B. Here the problem: once I clicked for the first time on B, every time I click on A, the click element is fired twice. I have searched on google, but the only results I found were talking about the need of stopping the event propagation. I'm already doing so. What makes it strange, is that the problem exist only once I clicked for the first time on B, otherwise it works perfectly. Any idea? Please ask any question needed to better understand the problem.
answer count: 1
has comment: http://stackoverflow.com/comment/39000728
has comment: http://stackoverflow.com/comment/39000644
favorite count: 0
has comment: http://stackoverflow.com/comment/39000513
accepted answer: http://stackoverflow.com/a/25069124

http://stackoverflow.com/q/24963733
tagged with: css
type: AnsweredQuestion
score: 0
accepted answer: http://stackoverflow.com/a/24963853
type: Question
has body: I am having difficulty understanding the following behaviour of Javascript / CSS. I am attempting to create a modal div which will serve as an enlarged photo from a gallery. I want to display this dead centre on screen. If I define the div as display: none and then change this via Javascript, it doesn't seem to work as I would expect. I appreciate it would be simpler to just use Example 1 below and it isn't necessary to hide the div first. What I would like to do, however, is define the div in HTML with display: none and then display it later. I don't want to have to create the div with Javascript. The below is simply the easiest way to illustrate the issue. Example 1 below works as you might expect. Example 2 works only if you comment out the last line which sets the margins. If you do, then the div vanishes. Example 1 - Works as expected CSS #photoviewdiv{ position: fixed; /*display: none;*/ width: 70%; top: 50%; left: 50%; background: white; z-index:1000; } JS var photoviewdiv = document.createElement("div"); photoviewdiv.setAttribute("id", "photoviewdiv"); document.body.appendChild(photoviewdiv); //photoviewdiv.style.display = "inline"; photoviewdiv.innerHTML = "Hello"; var viewerwidth = photoviewdiv.offsetWidth; var viewerheight = photoviewdiv.offsetHeight; photoviewdiv.setAttribute("style", "margin-left: -" + viewerwidth/2 +"px; margin-top: -" + viewerheight/2 +"px"); Example 2 - Only works up until set margins - then photoviewdiv disappears CSS #photoviewdiv{ position: fixed; display: none; width: 70%; top: 50%; left: 50%; background: white; z-index:1000; } JS var photoviewdiv = document.createElement("div"); photoviewdiv.setAttribute("id", "photoviewdiv"); document.body.appendChild(photoviewdiv); photoviewdiv.style.display = "inline"; photoviewdiv.innerHTML = "Hello"; var viewerwidth = photoviewdiv.offsetWidth; var viewerheight = photoviewdiv.offsetHeight; photoviewdiv.setAttribute("style", "margin-left: -" + viewerwidth/2 +"px; margin-top: -" + viewerheight…
tagged with: javascript
has comment: http://stackoverflow.com/comment/38802455
has title: Javascript doesn't seem to correctly handle hidden elements that are later displayed
answer count: 1
has answer: http://stackoverflow.com/a/24963853
has comment: http://stackoverflow.com/comment/38802590

http://stackoverflow.com/comment/38848463
has text: There was a bug in my original code. I fixed that in update 1. Then I realised the button wasn't in the grid. That fix is in update 2.
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24986793
type: QuestionComment

http://stackoverflow.com/q/25022503
has answer: http://stackoverflow.com/a/25022758
has body: I need to know how to query the content of an embed tag using src. I've an embed tag where I use a custom page as src. I need to access to the rendered content using jquery, but I just get nothing. Any idea or help will be appreciated! TIA! Milton
has title: Get content inside rendered embed tag with src
type: UnansweredQuestion
upvote count: 1
score: 1
type: Question
downvote count: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/comment/38924922
type: AnswerComment
has text: Thanks, would you happen to know how i can check the results of `document.getElementById("sMastery").innerHTML += summonerMastery[page].name+", ";` for a specific word or string? For example, if i wanted to check the returned results for the word "Offense"?
comment on: http://stackoverflow.com/a/25028274
score: 0
type: Comment

http://stackoverflow.com/a/24956597
downvote count: 0
type: Answer
score: 3
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24956200
has body: Not sure how you would get the colour after applying the filter exactly but you can use the same colour for your svg elements and re-apply the filter. Your svg output will be something like this: <feColorMatrix in="SourceGraphic" type="saturate" values="5" /> <g filter="url(#saturate)"> <rect width="300" height="100" '+ 'style="fill:'+ dColorx + '; stroke-width:3;stroke:rgb(0,0,0)"> </g> Working jsFiddle
has comment: http://stackoverflow.com/comment/38788403
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24956200

http://stackoverflow.com/a/24912733
accepted answer of: http://stackoverflow.com/q/24912687
has body: You have a typo in your selector at this line: $("button", "#contextManu").removeClass('disabled'); #contextManu needs to have the a changed to an e like so: $("button", "#contextMenu").removeClass('disabled');
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24912687
downvote count: 0
type: Answer
upvote count: 11
score: 11

http://stackoverflow.com/q/25059448
answer count: 1
favorite count: 0
has answer: http://stackoverflow.com/a/25062141
tagged with: angularjs
has title: Drop down model data not being set and ng-change issue using keyboard
tagged with: http://stackoverflow.com/tag/html
type: AnsweredQuestion
upvote count: 1
accepted answer: http://stackoverflow.com/a/25062141
downvote count: 1
type: Question
tagged with: javascript
score: 0
has body: I have a drop down on my html: When I select the drop down using mouse, ng-change always fires and model data ModelData.ApplicationForm updates correctly. But when I use keyboard and select the drop down, model data only update on first time drop down selection change and ng-change fires only for the first time but the second time neither model data updates nor ng-change fires. Again, If I change the selected item in the dropdown more than twice. It starts updating the modeldata ApplicationForm. what could be the problem!

http://stackoverflow.com/a/37735503
answers question: http://stackoverflow.com/q/24923508
has body: In you css add .simpleCart_items table { width:100%; } This should extend the whole table.
type: Answer
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/38977231
type: Comment
type: QuestionComment
has text: @Mohit But using pure HTML/Javascript, is it possible? A responsive web application does not deal with Objective-C
comment on: http://stackoverflow.com/q/25056735
score: 0

http://stackoverflow.com/comment/38975200
score: 1
has text: its angular js $scope but its more a general query replace $scope.filtereditems with banana
comment on: http://stackoverflow.com/q/25055378
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/42297494
has text: I forgot I posted this question but yes, that is the solution I ended up going with. Will mark as answer for future reference.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/26864700

http://stackoverflow.com/a/24922772
accepted answer of: http://stackoverflow.com/q/24920303
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: Google Chrome ignores the value 0 for stroke-widths (uses 1). Try using strokeColor=none The API specification is worth reading when facing such problems.
upvote count: 3
score: 3
answers question: http://stackoverflow.com/q/24920303

http://stackoverflow.com/comment/38970644
has text: just wrap a form inside dialog and with my code you will redirect to whatever action action you will give inside form tag..
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25052977
type: AnswerComment

http://stackoverflow.com/q/24989877
tagged with: nan
has title: gsp dropdown value returned as NaN in IE7 document mode(javascript)
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24990031
has body: I am reading a index value of a dropdown of a gsp page through javascript. The js function works in all the browsers except in IE7 document mode. The js returns the value as NaN in IE7 DOCMODE. Tried for more than half a day,but am not able to find the reason. Any help/suggestion is really appreciated. Copying the js function for your reference. &lt;script&gt;var encodedMonthRange = new Array(); &lt;g:each in="${ReportService.RangeList()}" var="mRange"&gt; encodedMonthRange.push('${mRange?.encodeAsBase64()}'); function encodeParams(){ var index =Number(document.getElementById("monthRange").selectedIndex); alert("Index : " + index.toString()); var encodedVal = encodedMonthRange[index]; alert(encodedVal); document.getElementById("monthRangeEncoded").value = encodedVal; document.getElementById("historyOverview").submit(); } &lt;script&gt; Html code: &lt;div class="fl" style="padding-right:20px;"&gt; &lt;g:select id="monthRange" class="lstBox autocolor autoWidth" from="${ReportService.RangeList()}" valueMessagePrefix="filter" value="${params.monthRange}" onchange="encodeParams()" /&gt; &lt;/div&gt;
type: Question
tagged with: internet-explorer-7
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/comment/38948585
score: 0
type: Comment
has text: Objects, Arrays, Numbers and HTMLElements were also designed to do one specific thing, and they also have usable valueOf()s. Thanks for your answer though.
type: AnswerComment
comment on: http://stackoverflow.com/a/25041174

http://stackoverflow.com/comment/38916746
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25022380
has text: I once had the same problem. This happened using Datatables 1.8 and I had to download an extra plugin called TableTools and point to these .swf files and it worked. In html also I had to include . What version are you using?
score: 0

http://stackoverflow.com/comment/38770803
comment on: http://stackoverflow.com/q/24946749
has text: @Khalid php is fine the ajax just wont show the result if the page inst refreshed.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24982143
answers question: http://stackoverflow.com/q/24982114
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: We can use interface defined explicitly or we can just use inline type definition // inline type var abc: {id:number;name:string}[] = [{ "id": 1, "name": "x" }, { "id": 2, "name": "x" }] // wrong // var abc: {id:number;name:string}[] = [{ x : 1}] // explicit interface interface IData{ id:number; name:string; } var def: IData[] = [{ "id": 1, "name": "x" }, { "id": 2, "name": "x" }] // wrong // var def: IData[] = [{x : 1 }] check both <a href="http://www.typescriptlang.org/Playground#src=var%20abc%3A%20%7Bid%3Anumber%3Bname%3Astring%7D%5B%5D%20%3D%0D%0A%20%20%5B%7B%20%22id%22%3A%201%2C%20%22name%22%3A%20%22x%22%20%7D%2C%20%7B%20%22id%22%3A%202%2C%20%22name%22%3A%20%22x%22%20%7D%5D%0D%0A%20%20%0D%0A%2F%2F%20wrong%0D%0A%2F%2F%20var%20abc%3A%20%7Bid%3Anumber%3Bname%3Astring%7D%5B%5D%20%3D%20%5B%7B%20x%20%3A%201%7D%5D%0D%0A%20%20%0D%0Ainterface%20IData%7B%0D%0A%09id%3Anumber%3B%0D%0A%09name%3Astring%3B%0D%0A%7D%0D%0A%0D%0Avar%20def%3A%20IData%5B%5D%20%3D%0D%0A%20%20%20%5B%7B%20%22id%22%3A%201%2C%20%22name%22%3A%20%22x%22%20%7D%2C%20%7B%20%22id%22%3A%202%2C%20%22name%22%3A%20%22x%22%20%7D%5D%0D%0A%20%20%0D%0A%2F%2F%20wrong%20%0D%0A%2F%2F%20var%20def%3A%20IData%5B%5D%20%3D%20%5B%7Bx%20%3A%201%20%7D%5D" rel="nofollow">here
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24982114
score: 2

http://stackoverflow.com/a/25016688
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38902019
has comment: http://stackoverflow.com/comment/38901968
accepted answer of: http://stackoverflow.com/q/25016594
answers question: http://stackoverflow.com/q/25016594
type: Answer
has comment: http://stackoverflow.com/comment/38902076
has body: the correct code would be new RegExp('^\\D' + mystring, 'g'); this works because RegExp creates a regular expression from a string.
score: 3
has comment: http://stackoverflow.com/comment/38902245
downvote count: 0
has comment: http://stackoverflow.com/comment/38901925
has comment: http://stackoverflow.com/comment/38902057
has comment: http://stackoverflow.com/comment/38902104
has comment: http://stackoverflow.com/comment/38902296
upvote count: 3

http://stackoverflow.com/q/24969679
tagged with: php
linked to: http://stackoverflow.com/q/10157586
type: Question
type: AnsweredQuestion
has body: So my table contains a button in every row. The purpose of the button is to update that certain row, whenever it is clicked. And i have to reload the whole table to do this (SELECT * FROM table). My problem is that the table is so long that when you reload the page, you have to scroll down to see if how the row is updated. I want to scroll it to a particular submit button when the page is reloaded. I might want to use javascript and however i am new to it. I have seen ajax functionality in this link but i can't seem to implement it, because i don't know how to retrieve values from php file to html. But i can do vice versa, (E.G. xmlhttp.open("GET","updatedb.php?q="+str+"&s"=+str2,true);) Update values from MYSQL table without reloading the page? if (isset($_POST['lvl'] && isset($_POST['$poke_ID'])) { // increment the lvl to +1 //update the database } .... //SELECT ALL .... while($row = mysqli_fetch_array($result)) { $lvl= $row['lvl']; $poke_ID = $row['ID']; echo " "; echo " " . $row['trainer'] . " "; echo " " . $row['skills'] . " "; echo " " . $row['strength'] . " "; echo " " . $row['weakness'] . " "; echo " " . $row['lvl'] . " "; echo " " .<<<_END _END; echo " "; echo " "; } echo " ";
has title: when reloading page containing a table with mysql data, it should go to a specific part of the table
tagged with: mysql
score: 0
has comment: http://stackoverflow.com/comment/38813174
answer count: 1
tagged with: javascript
tagged with: ajax
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/24970047
accepted answer: http://stackoverflow.com/a/24970047

http://stackoverflow.com/comment/38780583
type: QuestionComment
comment on: http://stackoverflow.com/q/24951662
has text: @gpgekko: Can you just point me to the specs which states that if you have it open. I'm kind of lost searching for it. So that i can back my argument.
score: 0
type: Comment

http://stackoverflow.com/q/25051202
has comment: http://stackoverflow.com/comment/38967018
accepted answer: http://stackoverflow.com/a/25051593
has answer: http://stackoverflow.com/a/25051265
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25051287
favorite count: 0
has comment: http://stackoverflow.com/comment/38966943
has answer: http://stackoverflow.com/a/25051274
answer count: 5
possible better answer: http://stackoverflow.com/a/25051274
has comment: http://stackoverflow.com/comment/38966948
has comment: http://stackoverflow.com/comment/39034069
has answer: http://stackoverflow.com/a/25051271
has title: What's the good reason for removing an event after using it in javascript or unbinding after binding it in jquery?
downvote count: 2
has answer: http://stackoverflow.com/a/25051593
upvote count: 1
has body: What's the good reason for removing an event handler after using it in javascript or unbinding after binding it in jQuery? for example, binding and unbinding in jQuery.. $( "#foo" ).bind( "click.myEvents", handler ); $( "#foo" ).unbind( "click.myEvents", handler ); Or in javascript, document.getElementById("myDIV").addEventListener("mousemove", myFunction); document.getElementById("myDIV").removeEventListener("mousemove", myFunction);
type: Question
has comment: http://stackoverflow.com/comment/38966863
type: AnsweredQuestion
score: -1
linked to: http://stackoverflow.com/q/18233199

http://stackoverflow.com/comment/38823688
comment on: http://stackoverflow.com/a/24975114
score: 0
type: AnswerComment
type: Comment
has text: @ kbadas still syntax error of asp.. Mine syntax is write whatever i written in question just when i pass parameter it gives error..please help

http://stackoverflow.com/q/24921079
has answer: http://stackoverflow.com/a/24921587
has answer: http://stackoverflow.com/a/24966879
tagged with: mustache
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38722590
has comment: http://stackoverflow.com/comment/38723226
accepted answer: http://stackoverflow.com/a/24966879
has comment: http://stackoverflow.com/comment/38723259
type: Question
score: 0
has body: I have a requirement of displaying a list array in two divs, first half in first DIV and second half list in second DIV. Please not that I don't want to splice the list array in two parts and display them in two lists. Here is the template I have, for example &lt;!-- First half number of items should be displayed in firstHalf div --&gt; &lt;div id="firstHalf"&gt; {{#each names:i}} {{firstName}} {{lastName}} {{/each}} &lt;/div&gt; &lt;!-- Second half number of items should be displayed in secondHalf div --&gt; &lt;div id="secondHalf"&gt; {{#each names:i}} {{firstName}} {{lastName}} {{/each}} &lt;/div&gt; For example If I have data like below var data = [ { firstName : "Joe", lastName: "Armstrong" }, { firstName : "Jose", lastName: "Valim" }]; It needs to be rendered like below &lt;div id="firstHalf"&gt; Joe Armstrong &lt;/div&gt; &lt;div id="firstHalf"&gt; Jose Valim &lt;/div&gt; Please give me suggestions to proceed further.
tagged with: ractivejs
tagged with: javascript
has title: Limit number of list items to be displayed in List expression
has answer: http://stackoverflow.com/a/24921703
has comment: http://stackoverflow.com/comment/38722743
answer count: 3
possible better answer: http://stackoverflow.com/a/24921587

http://stackoverflow.com/comment/38786372
has text: Wonderful, thanks very much! Should have seen that myself. Refactoring is the a much needed next step, just very eager to present a prototype.
comment on: http://stackoverflow.com/a/24954198
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24981745
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24981694
has body: The most efficient way is to keep track of the max value as your object is being dynamically created like so: var indexes = {}; var maxVal = str.indexOf(specchar[0]); // contains largest value var maxKey = ''; // contains key corresponding to largest value for (var i = 0; i &lt; specchar.length; i++) { var val = str.indexOf(specchar[i]); if (val &gt; maxVal) { maxVal = val; maxKey = specchar[i]; } indexes[specchar[i]] = val; }
answers question: http://stackoverflow.com/q/24981694
has comment: http://stackoverflow.com/comment/38835633
upvote count: 3
type: AcceptedAnswer
type: Answer

http://stackoverflow.com/a/24946054
answers question: http://stackoverflow.com/q/24945778
score: 1
has body: You need to evaluate the scroll position of the element that's scrolling and you need to evaluate the position on the page of elements you want to trigger on. Here's an example with jquery, but it could also be easily done in vanilla js. http://jsfiddle.net/gunderson/r64SR/ CSS html,body { height: 100%; width: 100%; margin:0; padding:0; } section{ height: 220px; } nav { position: fixed; top:0; left: 0; width: 100%; height: 20px; border: 1px solid #888; } HTML Section 0 Section 1 Section 2 Section 3 Section 4 Section 5 Section 6 Section 7 JS var $window = $(window), $nav = $('nav'), $sections = $('section') $window.on("scroll", onScroll); function onScroll(e){ $sections.each(function(){ var $section = $(this); if ($section.offset().top - $window.scrollTop() < 0){ $nav.css('backgroundColor', $section.data('color')); } }) }
downvote count: 0
type: Answer
upvote count: 1

http://stackoverflow.com/q/24982853
has title: Simulating hover behaviour in Android browser for touch events
tagged with: android
has answer: http://stackoverflow.com/a/24985707
tagged with: css
score: 2
has body: My Wordpress website is using Superfish 1.5.4 to render menu items. My menu consists of a number of parent menu items, which are also clickable pages, and on hovering over these parent items, the sub menu items should appear When hovering over a parent menu item in my PC's browser the sub menu items appear, and this is the intended behaviour. In iPhone browsers, when touching a parent menu item, the sub menu items appear, and this too is the preferred behaviour. (So this effectively triggers the hover behaviour) The problem is that on Android devices, touching a parent menu item causes a click event as opposed to the hover behaviour we see for iPhone. I've looked at the Superfish JavaScript and I don't see any iPhone specific logic. Therefore, I'm wondering why a touch in an iPhone causes the hover behaviour, but not in an Android device. What am I missing here?
accepted answer: http://stackoverflow.com/a/24985707
upvote count: 2
type: AnsweredQuestion
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/63605812
answers question: http://stackoverflow.com/q/24960459
score: 0
type: Answer
has body: I was able to resolve similar issue by loading jquery before angular. Also if $ is failing for you, You can always use angular.element('') in place of $

http://stackoverflow.com/q/24977781
tagged with: javascript
score: 4
possible better answer: http://stackoverflow.com/a/48375486
has answer: http://stackoverflow.com/a/56488401
downvote count: 0
linked to: http://stackoverflow.com/q/25602117
has answer: http://stackoverflow.com/a/39320709
favorite count: 0
has title: fill form programmatically in Android Webview - JavaScript
has answer: http://stackoverflow.com/a/24977839
accepted answer: http://stackoverflow.com/a/24977839
tagged with: android
upvote count: 4
answer count: 4
has answer: http://stackoverflow.com/a/48375486
type: AnsweredQuestion
tagged with: java
tagged with: webview
type: Question
has body: I'm trying to automatically fill a form from the website of my school. I've seen some ways to do with javascrip. Here is my code: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.navegador_siiau_layout); navegador_siiau = (WebView) findViewById(R.id.wv_navegador_siiau); navegador_siiau.getSettings().setJavaScriptEnabled(true); navegador_siiau.loadUrl("http://siiauescolar.siiau.udg.mx/wus/gupprincipal.inicio"); navegador_siiau.setWebViewClient(new WebViewClient() { public void onPageFinished(WebView view, String url) { String user="207512134"; String pwd="FENMAA"; view.loadUrl("javascript:document.getElementsByName('p_codigo_c').value = '"+user+"';document.getElementsByName('p_clave_c').value='"+pwd+"';"); } }); } The result is a blank page with the last string I try to put in the form... What can I do to fill and submit the form correctly?

http://stackoverflow.com/comment/38964743
comment on: http://stackoverflow.com/q/25050012
has text: you need to use [dom ready handler](http://learn.jquery.com/using-jquery-core/document-ready/) - in jsfiddle by default the script is added in a `windlow.onload` handler that is why it is workign
type: Comment
type: QuestionComment
score: 3

http://stackoverflow.com/comment/38889458
type: AnswerComment
type: Comment
has text: Thank you @ defghi1974. So, if I want to copy all the attribute an svg has, is there a way to call for all of them? And how can I make the maing to be transformable please? How can I append that to a g?
comment on: http://stackoverflow.com/a/25008525
score: 0

http://stackoverflow.com/comment/38838937
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24980677
score: 0
has text: @Sid i tried activating the Google+ API and the Contacts API to no avail

http://stackoverflow.com/comment/53890437
type: Comment
has text: @xyz ummm thanks?? If I solved your problem I'm glad I could help.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24994332

http://stackoverflow.com/comment/38869629
score: 0
type: Comment
has text: [`OS.File.writeAtomic`](https://developer.mozilla.org/en-US/docs/JavaScript_OS.File/OS.File_for_the_main_thread#OS.File.writeAtomic) probably would be easiest (but you might need to wrap your head around promises and `Task.jsm` first). Otherwise, you can just write it to any output stream, either directly to a file stream (but that is bad because sync I/O on the main thread), or by creating e.g. an `nsIPipe`, writing the data there (`.outputStream`) and `asyncCopy`in it into the file (`.nsIInputStream`)
type: AnswerComment
comment on: http://stackoverflow.com/a/24999209

http://stackoverflow.com/comment/38771510
type: Comment
has text: @KevinB good point, didn't properly note the plain string data input
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24946544

http://stackoverflow.com/comment/39138893
has text: my problem now is - when multiple items i get the price using getfield...outside span it displays correctly but when inside it-its displays the price of the last item whichever one u click.
type: AnswerComment
comment on: http://stackoverflow.com/a/24980784
score: 0
type: Comment

http://stackoverflow.com/comment/38945619
type: Comment
comment on: http://stackoverflow.com/a/25039501
has text: Yes if I put an alert function before or after the print() function it runs, it's very strange. Is there someway I can post the whole page code? I dont want to post it in the question
score: 0
type: AnswerComment

http://stackoverflow.com/a/24987918
has comment: http://stackoverflow.com/comment/38848267
answers question: http://stackoverflow.com/q/24987901
accepted answer of: http://stackoverflow.com/q/24987901
upvote count: 1
has comment: http://stackoverflow.com/comment/38847971
has comment: http://stackoverflow.com/comment/38847810
type: AcceptedAnswer
downvote count: 0
score: 1
has body: I don't think String will cut trailing 0s, But if you will convert that in number then it will ignore trailing 0s after decimal point. var foo = 14 * 0.2; console.log(+foo.toFixed(3));
type: Answer

http://stackoverflow.com/comment/38877301
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25003719
has text: I always recommend using a `undefined` entry in the map to make sure you handle the `default:`
score: 0

http://stackoverflow.com/q/24957419
has comment: http://stackoverflow.com/comment/38790675
has comment: http://stackoverflow.com/comment/38790012
answer count: 0
has body: I don't understand this. I have element ... this.optionElement = $("&lt;option /&gt;").text(this.name) .data('contact-detail', this); ... with some data stored with jQuery data I append option to select. Later, I use innerHTML that removes select from html. And with that, jQuery data are lost for that option. But the thing is, I still have reference to that select and also references to its options. So I can append select and options back in html. So I don't understand, why are data lost. PS: Now I'm fixing this with detach, but it is annoying. EDIT: I really tried to reproduce my problem. Lot of things might not make any sence. My widget is larger and contains more object so... http://jsfiddle.net/D5Gfc/6/ js: // Object declarations var Select = function (wrapper) { this.select = $("&lt;select /&gt;"); this.wrapper = wrapper; this.init(); }; Select.prototype.init = function () { this.select.change(this.onChange.bind(this)); this.select.appendTo(this.wrapper); }; Select.prototype.onChange = function () { var cDetail = this.select.find("option:selected").data("contact-detail"); console.log("before html wipe:"); console.log(this.select.find("option:selected").data()); console.log(cDetail.option.data()); this.wrapper.html(""); this.wrapper.html(this.select); console.log("after:"); console.log(this.select.find("option:selected").data()); console.log(cDetail.option.data()); // in my code, this line still shows data }; var ContactDetail = function (name, select) { this.select = select; this.name = name; this.init(); }; ContactDetail.prototype.init = function () { this.option = $("&lt;option /&gt;").text(this.name).data("contact-detail", this); this.select.select.append(this.option); }; // Part where I run widget var list = ["phone", "blog", "email", "about"]; var wrapper = $("#wrapper"); var select = new Select(wrapper); for (var i = 0; i &lt; list.length; i++) { new ContactDetail(list[i], select); }
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38790784
has comment: http://stackoverflow.com/comment/38790215
type: Question
score: 0
upvote count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38793888
tagged with: javascript
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38789925
has title: jQuery data() are lost if innerHTML is used

http://stackoverflow.com/comment/38950613
score: 0
type: AnswerComment
type: Comment
has text: Nevermind, I think I figured it out. You basically put me on the right track, but didn't exactly have my solution. I'll post my solution.
comment on: http://stackoverflow.com/a/25041791

http://stackoverflow.com/comment/38823317
has text: @BobDylan: But you're accessing `a.items` anyway?
comment on: http://stackoverflow.com/a/24975011
type: Comment
score: 1
type: AnswerComment

http://stackoverflow.com/q/24941795
has body: My application is distributed on 3 servers : the client code provider (port 4000) the REST server (port 3000) the image provider (port 3001) I am using BackboneJS for client code. Is there a way to prefix every relative image url with javascript as is it possible for ajax request with : $.ajaxPrefilter( function( options, originalOptions, jqXHR ) { options.url = 'http://localhost:3000' + options.url; }); so that I could have something like : &lt;img src="items/1.png"&gt; //get it on http://localhost:3001 instead of default http://localhost:4000 Thanks.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38771014
answer count: 0
type: Question
has comment: http://stackoverflow.com/comment/38791870
has title: Prefix img source url
tagged with: javascript
score: 0
tagged with: cross-domain
has comment: http://stackoverflow.com/comment/38770473
tagged with: backbone.js
has comment: http://stackoverflow.com/comment/38791736
has comment: http://stackoverflow.com/comment/38762273

http://stackoverflow.com/q/25049457
tagged with: angularjs
has title: Angular $watch not triggering for array changes
accepted answer: http://stackoverflow.com/a/25049494
upvote count: 1
type: AnsweredQuestion
score: 1
type: Question
has body: I'm attempting to trigger a $watch after a timeout in angular: My Controller .controller('MyCtrl', ['$scope', function ($scope) { $scope.chickens = ["Jim", "Joe", "Fred"]; $scope.chickens.push("Steve"); setTimeout(function () { $scope.chickens.push("Larry"); $scope.$apply(); }, 500); }]) Then the $watch is wired up in my directive's link function: My Directive Link link: function (scope, element, attrs) { scope.$watch('chickens', function (newChickens, oldChickens) { $(element).html(''); newChickens.forEach(function (chicken) { $(element).append($('&lt;li/&gt;', { 'text': chicken })); }); }); } The $watch only seems to fire once with the first four elements, it never fires after the fifth is added. I tried adding the $scope.$apply() there to apply the changes. Doesn't seem to be working. Here's the Fiddle for the example. I'd appreciate any help in the situation. Thanks!
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25049494
favorite count: 0

http://stackoverflow.com/q/25008509
type: Question
answer count: 1
tagged with: arrays
tagged with: javascript
has comment: http://stackoverflow.com/comment/39193274
has answer: http://stackoverflow.com/a/25008748
score: 0
accepted answer: http://stackoverflow.com/a/25008748
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38886352
type: AnsweredQuestion
has body: Hey Guys, I am trying to split my responses from my RSS feed reader up into pages. I'm doing this by populating a feedList array with RSS Items, and taking 2 items at a time to display and placing them in a displayList array connected to an ng-repeat. When you click next page it will update the displayList array with 2 new items from the feedArray. I got a simplified version running with an array of names http://jsfiddle.net/halfasleep/ZJFke/4/ When I tried to implement it with the feed reader code, it doesn't populate the displayList array before trying to display it, when you hit "Next Page" it will drop some items into the displayList array and start to display it (though for some reason only moving 1 item at a time instead of 2). Any help would be appreciated! JS Fiddle: http://jsfiddle.net/WDL8U/ Html Reader Trial There are {{feedList.length}} entries. {{list.title}} {{list.contentSnippet}} - {{list.author}} Previous Page Next Page JS var feedList = []; var displayList = []; var app = angular.module('FeedReader',['ngResource']); app.factory('feedLoader',['$resource', function($resource){ var googleAPI = $resource('http://ajax.googleapis.com/ajax/services/feed/load',{},{ collect: { method: 'JSONP', params: { v: '1.0', callback: 'JSON_CALLBACK' } } }); return googleAPI; }]); app.service('createFeedList',['feedLoader', function(feedLoader){ this.get = function(){ var feed = { feedName: 'Slashdot', feedURL: 'http://rss.slashdot.org/Slashdot/slashdot' }; feedLoader.collect({ q: feed.feedURL, num: 10 },{},function(result){ var feed = result.responseData.feed.entries; for(i = 0; i < feed.length; i++){ feedList.push(feed[i]); } }); return feedList; } }]); app.controller('blogCtrl',['$scope', '$sce', 'createFeedList', function($scope, $sce, createFeedList){ $scope.feedList = createFeedList.get(); // Page Code $scope.hideP = true; var begin = 0; var end = 2; $scope.displayList = [$scope.feedList[begin],$scope.feedList[end]]; $scope.next = function(){ if(end <= $scope.fee…
has title: AngularJS: Populating One Array from Another (Creating Pages)

http://stackoverflow.com/comment/38982295
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25059113
has text: Only the first slide slides i need it to loop automatically and i also need my next and prev button to work any suggestions.
type: AnswerComment

http://stackoverflow.com/comment/38802074
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24963512
has text: and, i had the same typo 'boder' in my code too. that fixes my problem.

http://stackoverflow.com/comment/38992152
score: 0
comment on: http://stackoverflow.com/q/25064555
has text: Why do you render only once (before fetching the calender events)?
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24999540
upvote count: 0
score: -2
accepted answer of: http://stackoverflow.com/q/24999380
has body: you need to create your own,something like: $('body').addClass('my_class'); //add the 'classChanged', event $('body').on('classChanged', some_callback); function some_callback() { //do something alert("class changed"); } //trigger for class change $('body').trigger('classChanged'); Demo:: jsFiddle
type: AcceptedAnswer
type: Answer
downvote count: 2
answers question: http://stackoverflow.com/q/24999380

http://stackoverflow.com/q/25068950
has answer: http://stackoverflow.com/a/25087466
has body: I am not using the Javascript SDK because that is client-side whereas I'm making a server-side call. I want to make a page post so that I can make an ad creative with it. I can do the call perfectly fine in the Graph API Explorer tool, but I cannot make the same call (with the same long-lived access tokens that continue to work in the Graph Explorer) from Javascript. Here is my code: tok = &lt;valid and never expiring user token&gt;; var pg_tok = &lt;valid and never expiring page token&gt;; var act_id = &lt;account_id&gt;; var pg_id = &lt;page_id&gt;; var call_to_action = 'INSTALL_MOBILE_APP'; var fb_app_url = 'https://itunes.apple.com/us/app/id284882215'; var msg = 'Test creative, ya see'; var pic_url = 'https://s3.amazonaws.com/&lt;path_to_my_image&gt;'; var ROOT = 'https://graph.facebook.com/'; var pagepost_endpoint = ROOT+pg_id+'/feed'; console.log(pagepost_endpoint); var pagepost_params = { access_token: pg_tok, call_to_action: { type: call_to_action, value: {link: fb_app_url} }, message: msg, picture: pic_url, published: false }; console.log(pagepost_params); var pagepost_res = HTTP.post(pagepost_endpoint, {params: pagepost_params}); console.log(pagepost_res); I have played around a bunch with params vs. data for where pagepost_params goes in the HTTP.post that is giving the error (that is Meteor's HTTP btw). -Putting everything in params gives the error: {"error":{"type":"Exception","message":"No Call To Action Type was parseable. Please refer to the call to action api documentation","code":1373054,"is_transient":false}}. -Putting everything in data gives the error: {"error":{"message":"(#200) This API call requires a valid app_id.","type":"OAuthException","code":200}}. -Putting access_token in params and everything else in data gives the error: {"error":{"message":"Invalid parameter","type":"FacebookApiException","code":100,"error_subcode":1349125}}. One more clue for everyone, if I change the HTTP.post to HTTP.get, and just put access_token in params and in…
score: 0
answer count: 2
possible better answer: http://stackoverflow.com/a/25087466
tagged with: javascript
tagged with: facebook-graph-api
has title: javascript - make facebook page post
accepted answer: http://stackoverflow.com/a/25129516
tagged with: facebook-ads-api
tagged with: facebook
type: AnsweredQuestion
tagged with: http
type: Question
linked to: http://stackoverflow.com/q/23158347
has answer: http://stackoverflow.com/a/25129516

http://stackoverflow.com/comment/38728375
score: 0
comment on: http://stackoverflow.com/q/24924410
has text: you should save this image in your folder and should return a flag from server exists or not,if image not exists on server then show it.to save the response time...
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38974445
comment on: http://stackoverflow.com/a/25054930
score: 0
type: AnswerComment
type: Comment
has text: How is in: `.css({opacity : 1}).fadeIn('slow')` **fadeIn()** supposed to happen after you set `opacity: 1` ?

http://stackoverflow.com/comment/39009909
has text: They should be the same, the `xtype` is inferred (if not explicitly specified) from the `alias`. There's no reason for them to be different.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25048377

http://stackoverflow.com/comment/38902924
comment on: http://stackoverflow.com/q/25017100
score: 0
has text: The error message `Function.prototype.apply: argumentsArray is not an array-like object` (or something along the lines of this) should be clear enough, or at least tell you to [check the docs](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply)
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24937082
has comment: http://stackoverflow.com/comment/38751916
has comment: http://stackoverflow.com/comment/38751982
answer count: 4
has answer: http://stackoverflow.com/a/24937680
has answer: http://stackoverflow.com/a/24937676
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38752459
upvote count: 1
has comment: http://stackoverflow.com/comment/38753963
has comment: http://stackoverflow.com/comment/38752018
downvote count: 1
has comment: http://stackoverflow.com/comment/38752066
type: Question
has answer: http://stackoverflow.com/a/24937497
has comment: http://stackoverflow.com/comment/38754158
has answer: http://stackoverflow.com/a/24937396
accepted answer: http://stackoverflow.com/a/24937680
has comment: http://stackoverflow.com/comment/38752477
score: 0
has comment: http://stackoverflow.com/comment/38754192
has comment: http://stackoverflow.com/comment/38752287
possible better answer: http://stackoverflow.com/a/24937396
tagged with: javascript
tagged with: jquery
has body: So what I wanna do is to click an image, which opens up a popup window with the image-URL in a textfield. Here is should be possible to change the URL and by that changing the image-URL. Im very poor with javascript and thats why im asking for help. HTML &lt;img src="#" onClick="changePicture();" /&gt; Javascript function changePicture() { var myPopup = window.open("", "", "width=200, height=100"); }
favorite count: 0
has comment: http://stackoverflow.com/comment/38752553
has title: Click image opens popup
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38754244

http://stackoverflow.com/q/25000952
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25000984
has body: I am currently trying to show two scroll bars, one at the top and one at the bottom of a ListView. However, my document.getelementbyid keeps returning null and I cant figure out why. I am also using a master page if that helps. &lt;script type="text/javascript"&gt; function DoubleScroll(element1) { var element = document.getElementById(element1); if (!element) return; var scrollbar = document.createElement('div'); scrollbar.appendChild(document.createElement('div')); scrollbar.style.overflow = 'auto'; scrollbar.style.overflowY = 'hidden'; scrollbar.style.width = '500px'; scrollbar.firstChild.style.width = element.scrollWidth + 'px'; scrollbar.firstChild.style.paddingTop = '100px'; scrollbar.firstChild.appendChild(document.createTextNode('\xA0')); scrollbar.onscroll = function () { element.scrollLeft = scrollbar.scrollLeft; }; element.onscroll = function () { scrollbar.scrollLeft = element.scrollLeft; }; element.parentNode.insertBefore(scrollbar, element); } DoubleScroll(document.getElementById('doublescroll')); &lt;/script&gt; Here is the div id I am trying to reach: &lt;div id="doublescroll" style=" width: 100%; height: auto;"&gt;
score: 1
has answer: http://stackoverflow.com/a/25001149
tagged with: listview
type: Question
upvote count: 1
tagged with: javascript
has title: Document.getelementbyId returns null when searching for div id
tagged with: asp.net
favorite count: 0
accepted answer: http://stackoverflow.com/a/25001021
possible better answer: http://stackoverflow.com/a/25000984
answer count: 3
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25001021
downvote count: 0

http://stackoverflow.com/a/24923695
has body: You can do it with css and here is a link to a working example: Original Posts: Image Greyscale with CSS &amp; re-color on mouse-over? http://www.cheesetoast.co.uk/add-grayscale-images-hover-css-black-white/ "Add the following CSS class to your image elements:" img.grayscale{ filter: grayscale(100%); -webkit-filter: grayscale(100%); /* For Webkit browsers */ filter: gray; /* For IE 6 - 9 */ -webkit-transition: all .6s ease; /* Transition for Webkit browsers */ } "The hover effect:" img.grayscale:hover{ filter: grayscale(0%); -webkit-filter: grayscale(0%); filter: none; } Working CodePen Example: http://codepen.io/Cheesetoast/pen/sfCKa
score: 0
answers question: http://stackoverflow.com/q/24922127
type: Answer

http://stackoverflow.com/comment/38954636
type: Comment
comment on: http://stackoverflow.com/q/25044618
has text: jQuery is perfectly happy making cross origin requests, subject to the normal limitations imposed on them by browsers.
score: 0
type: QuestionComment

http://stackoverflow.com/a/25013535
score: 0
has comment: http://stackoverflow.com/comment/38896300
has comment: http://stackoverflow.com/comment/38896437
has comment: http://stackoverflow.com/comment/38896670
type: Answer
has comment: http://stackoverflow.com/comment/38895924
has body: I think you are using different js file for JQ plot library: http://www.jqplot.com/src/jquery.jqplot.min.js jqPlot Pure JavaScript plotting plugin using jQuery * Version: 1.0.0b2_r792 and your is: http://britishlifeinsurance.com/js/jquery.flot.min.js /* Javascript plotting library for jQuery, v. 0.7. * * Released under the MIT license by IOLA, December 2007. * */ Just guessing...
answers question: http://stackoverflow.com/q/25013329

http://stackoverflow.com/comment/135190855
comment on: http://stackoverflow.com/a/24963805
score: 0
type: AnswerComment
has text: Seems like the replacement for this DOMAttrModified is using the newer [MutationObserver](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver). Still, this answer doesn't directly help the poster figure out what they need, unless you add the tip of adding a debug statement and inspecting the stack, or perhaps using `console.trace()` instead of `console.log()`
type: Comment

http://stackoverflow.com/q/24939436
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24939737
has answer: http://stackoverflow.com/a/24939737
tagged with: date
type: Question
accepted answer: http://stackoverflow.com/a/24939483
tagged with: javascript
has answer: http://stackoverflow.com/a/24939574
has body: I have a date string that looks like this: 2014-07-21T12:55:31.513Z. Is there some simple way to convert this to a date? I found that there is Date.parse() however that dives me milliseconds since Jan. 1st, 1970 which it doesn't look like that fits my needs.
answer count: 3
has answer: http://stackoverflow.com/a/24939483
has title: Easy way to convert a string that is formatted as a date into a Date object in Javascript?
score: 0

http://stackoverflow.com/a/25068014
type: Answer
answers question: http://stackoverflow.com/q/25066757
score: 0
has body: Is there a way to automate the creation of the object you pass to people.on() given the value of the template's on-click attributes? Ractive removes these on-click attributes Otherswise, something like this could be hacked together with jQuery var people = new Ractive({ el: "#userlist", template: usersTemplate, data: data, complete: function(){ var onHandler = {}, action; $("[on-click]", "#userlist").each(function(e){ action = $(this).attr('on-click'); onHanlder[action] = getProxyHandler(action); }); this.on(onHandler); } });

http://stackoverflow.com/comment/38748954
type: AnswerComment
has text: You understood me wrong. This is how the final script should look like http://jsfiddle.net/4VpJN/
type: Comment
comment on: http://stackoverflow.com/a/24934849
score: 0

http://stackoverflow.com/q/25010244
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25010366
possible better answer: http://stackoverflow.com/a/25035379
score: 1
upvote count: 1
type: Question
tagged with: angularjs-directive
tagged with: javascript
has title: AngularJS creating dummy directive
accepted answer: http://stackoverflow.com/a/25010366
answer count: 2
downvote count: 0
tagged with: angularjs-ng-repeat
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25035379
tagged with: http://stackoverflow.com/tag/html
has body: I want to create in AngularJS a "dummy" element to make nested ng-repeats. So that following data.test = [{h:1, d:[11,12]}, {h:2, d:[21,22]}]; ---------------------- {{a.h}} {{b}} will expand into 1 11 12 2 21 22 Note that I don't want to be each group in div or any other element. I have tried following directive app.directive('dummy', function () { return { restrict: 'E', replace: true, template: '' }; }); However, it seems like it is preserving dummy nodes. Is this possible?

weinre
type: Tag
tag name: weinre
tags question: http://stackoverflow.com/q/24945567
tags question: http://stackoverflow.com/q/24909706

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

http://stackoverflow.com/comment/38963990
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25049575
score: 0
has text: `+=` in that context means concatenation, but `-=` still means subtraction, of *numbers*.

http://stackoverflow.com/a/25153997
type: Answer
accepted answer of: http://stackoverflow.com/q/25036821
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/39860379
upvote count: 2
type: AcceptedAnswer
has body: What about this code: var call = navigator.mozTelephony.dial('+1555332134'); call.addEventListener('connected', function() { call.hangUp(); }); I got this from the book "Firefox OS in Action": http://manning.com/jongboom/FirefoxOSiA_MEAP_CH01.pdf
answers question: http://stackoverflow.com/q/25036821

http://stackoverflow.com/a/24933220
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24932912
answers question: http://stackoverflow.com/q/24932912
score: 5
type: Answer
has body: It is not possible to use sections in a partial view, you have to move this script to main view or use a custom helper. And also since you are using AJAX you have to use delegated events to attach an event handler. Please read the Direct and delegated events section of .on(). $(document).on('click', '#btn', function(){ alert("Hi"); var filterstring = $('#txtCode').val(); $.get("/Test/Details?filterstring=" + $('#txtCode').val() + "", function (data) { var getHTML = $(data); $('#WebGrid').empty(); $('#WebGrid').html($('#WebGrid', getHTML)); ChkAddClass(); }); }); Thanks!
upvote count: 5
has comment: http://stackoverflow.com/comment/38744714
has comment: http://stackoverflow.com/comment/38744903

http://stackoverflow.com/a/25004286
has body: var projectangular.module('my_app') .controller('QueryCtrl', ['$scope', 'Query', function ($scope,$http, Query) { $scope.onSubmit = function() { $http.post('http://162.243.232.223:3000/api/query', { 'input': 'my_input' }).then( //sucess function(response){ angular.copy(response ,$scope.queries); console.log(json); }, //error function(){ alert("cant post"); }); }; } ])
answers question: http://stackoverflow.com/q/25004182
downvote count: 0
type: Answer
upvote count: 1
score: 1

http://stackoverflow.com/comment/38745716
has text: SUPERB! Can this be tweaked so it only applies to specific drop downs on the page?
comment on: http://stackoverflow.com/a/24933773
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/25020466
score: 4
answers question: http://stackoverflow.com/q/25020379
has comment: http://stackoverflow.com/comment/38910629
has comment: http://stackoverflow.com/comment/38911824
type: Answer
has comment: http://stackoverflow.com/comment/38910648
has comment: http://stackoverflow.com/comment/38911656
has comment: http://stackoverflow.com/comment/38909883
has body: The {{ ... }} template tag does not have to worry about quoting in JavaScript, as it'll be replaced by the URL before it is ever interpreted as JavaScript. In other words, there is no need to escape those quotes: oDiv.innerHTML = '&lt;img src="{{ url_for('static', filename='images/bubble4.png') }}"&gt;'; However, if you are placing this in a JavaScript file located in your static/ folder, then it'll never execute the Jinja2 code; that only applies to dynamic templates, not static assets. Make sure you put this in a template; you can have your main macro add this URL as a data- attribute to your HTML body, for example: &lt;body data-bubble-img="{{ url_for('static', filename='images/bubble4.png') }}"&gt; then have you javascript load that: var bubble_img = $('body').data('bubble-img'); oDiv.innerHTML = '&lt;img src="' + bubble_img + '"&gt;';
has comment: http://stackoverflow.com/comment/38910897
has comment: http://stackoverflow.com/comment/38911668
accepted answer of: http://stackoverflow.com/q/25020379
has comment: http://stackoverflow.com/comment/38909592
has comment: http://stackoverflow.com/comment/38910942
has comment: http://stackoverflow.com/comment/38910235
upvote count: 4
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/25014288
score: 1
upvote count: 1
has comment: http://stackoverflow.com/comment/38897869
has comment: http://stackoverflow.com/comment/38926946
has comment: http://stackoverflow.com/comment/38901316
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25013987
answers question: http://stackoverflow.com/q/25013987
has body: Using regex alone to parse DOM is a no-no. However.. If you don't have nested you can use the following code to get an array of values: var string = " 123 asd "; var tds = string.split(" "); var values = []; for(var i=0; i<tds.length-1; i++){ //last element is empty if you split like this values.push(tds[i].substr(4)); //ommit the " " } alert(values); More complex structures could be a problem and I would advise you to break the TDs up to separate ones and then extract the values using regex (/ (.*) /g and select group 1). But for this example it works fine. jsFiddle
type: Answer

http://stackoverflow.com/comment/38856963
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24992248
has text: To add $rootScope in directive?
type: AnswerComment

http://stackoverflow.com/q/24985608
has comment: http://stackoverflow.com/comment/38847081
tagged with: angularjs-ng-repeat
favorite count: 0
answer count: 0
downvote count: 0
tagged with: angularjs
type: UnansweredQuestion
has title: ng-repeat using scope function return value not calling function
has body: I'm having a bit of a trouble using the return value of a function as the array to iterate over in ng-repeat in a custom directive. The code is rather simple: .directive('treeRow', [function () { return function createDirective() { var treeController; return { restrict: 'E', require: '^treeGrid', scope: { row: '=' }, templateUrl: 'components/treegrid/templates/row.html', link: function (scope, element, attrs, gridController) { treeController = gridController; }, controller: function ($scope) { $scope.getColumnDefinitions = function () { return treeController.getColumnDefinitions(); }; } }; }(); }]); The template: {{row[column.key]}} Using a debugger, the getColumnDefinitions function is actually never called in the template. Inspecting the code, the function is present though. Simply echoing it in the template works fine though: {{getColumnDefinitions()}} Using ng-init to assign the return value to a temporary variable doesn't call the function either. Adding the data directly to the scope doesn't work either: link: function (scope, element, attrs, gridController) { treeController = gridController; scope.columnDefinitions = gridController.getColumnDefinitions(); }, This directive is part of another ng-repeat, used as: Update Apparently this is an issue with the td element. Changing it to be a div element instead works just fine: {{ row[column.key] }} Using angular.js 1.3.* . Any suggestions / hints are welcome, Thanks :)
has comment: http://stackoverflow.com/comment/38845735
tagged with: angularjs-directive
score: 1
type: Question
upvote count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38846128

http://stackoverflow.com/q/25000277
has title: Unable to parse data from an xml file in the Parse Cloud using xmlreader in express app
has body: My objective is to get elements of an xml file which i already saved on Parse Cloud for my express app. I started coding after referring this for xmlreader and the guide on Parse httpRequest to retrieve parse file. I tested reading xml elements using xmlreader like this: exports.xmlmodule = function(req, res) { if (Parse.User.current()){ Parse.User.current().fetch().then(function(user){ var xmlreader = require('cloud/xmlreader'); var someXml = ' ' + ' ' + ' 1 ' + ' ' + ' Casuals ' + ' ' + ' ' + ' 34 ' + ' 1 ' + ' Jeans ' + ' ' + ' ' xmlreader.read(someXml, function (err, res){ if(err) return console.log(err); // using the .count() and the .at() function, you can loop through nodes with the same name: for(var i = 0; i < res.dataset.brands.count(); i++){ console.log( res.dataset.brands.TheId.at(i).text() ); console.log( res.dataset.brands.ParentId.at(i).text() ); console.log( res.dataset.brands.CategoryorProductName.at(i).text() ); } console.log(""); }); });} else{ res.render('login',{welcome: 'Please login to continue'});} }; and it worked. (Please ignore the 'user' fetch which is not relevant here). Then i tried to get xml file from parse cloud using httprequest and it also worked. Now when i combine both these to get to my objective, i get an error: Failed with: TypeError: Object [object Object] has no method 'charAt' at Object.write (sax.js:918:31) at Object.exports.read (xmlreader.js:157:12) at main.js:21:11 at e (Parse.js:2:5101) at Parse.js:2:4651 at Array.forEach (native) at Object.x.each.x.forEach [as _arrayEach] (Parse.js:1:665) at c.extend.resolve (Parse.js:2:4602) at Object.<anonymous> (<anonymous>:573:17) I used cloud function and here is my main.js require ('cloud/app.js'); var xmlreader = require('cloud/xmlreader'); Parse.initialize("xxxxx", "xxxxx"); Parse.Cloud.define('myxmlfunction',function(req,res){ Parse.User.current().fetch().then(function(user){ var theid= user.get('StoreId'); var Stores= Parse.Object.extend('Stores'); var query= new Parse.Query…
type: Question
has answer: http://stackoverflow.com/a/25006063
answer count: 2
tagged with: xml-parsing
has answer: http://stackoverflow.com/a/25009073
tagged with: javascript
tagged with: express
score: 0
tagged with: parse-platform
type: UnansweredQuestion

http://stackoverflow.com/comment/38928057
type: Comment
score: 6
type: AnswerComment
comment on: http://stackoverflow.com/a/25030302
has text: have you check your base url? is your css associated to datapicker? I can't find your #datepicker,

http://stackoverflow.com/comment/38949149
has text: I'm glad you found a solution! However, if you think that my solution could be useful, could you mind to add an 'upvote' to it? :-)
type: AnswerComment
comment on: http://stackoverflow.com/a/25012497
score: 0
type: Comment

http://stackoverflow.com/comment/38928494
has text: Thx for sharing! But this method won't be approved by AMO editors (the people that review the addons for acceptance on addons.mozilla.org) you need to import the script. So create a `chrome.manifest` file and put the scripts in a foldre and in `chrome.manifest` set `contentaccessible=true` on that path. If you would like to go this way let me know and I'll post this solution.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25024728
type: Comment

http://stackoverflow.com/q/24919275
has answer: http://stackoverflow.com/a/24919541
answer count: 4
has body: I'm new to Javascript and I'm currently doing this question on codecademy. When trying to run the code, I keep getting an error as such: "SyntaxError: Unexpected token". Could anyone give an explanation why? Here's my code: var sleepCheck = function(numHours); if (function(numHours) &gt;= 8) { return "You're getting planety of sleep! Maybe even too much"; } else { return "Get some more shut eye!"; } sleepCheck(10); sleepCheck(5); sleepCheck(8);
tagged with: function
upvote count: 0
has title: Functions & if / else
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/24919387
has answer: http://stackoverflow.com/a/24919383
score: -1
has comment: http://stackoverflow.com/comment/38718929
has answer: http://stackoverflow.com/a/24919385
downvote count: 1
tagged with: if-statement
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/q/24912734
tagged with: http://stackoverflow.com/tag/pdf
tagged with: marionette
type: AnsweredQuestion
upvote count: 3
has comment: http://stackoverflow.com/comment/38767841
type: Question
score: 3
has comment: http://stackoverflow.com/comment/38709957
has comment: http://stackoverflow.com/comment/38710233
has comment: http://stackoverflow.com/comment/38744878
has title: PDFJS is not defined in pdf.worker.js (Backbone+Marionette+pdf.js)
has body: I want to render a PDF inside a Backbone.js/Marionette View with pdf.js, but PDFJS is not defined in pdf.worker.js. It is however defined in the Backbone View itself and also accessible via the console. This is the code for the View: module.exports = PDFView = Marionette.ItemView.extend({ template: require('../../../templates/pdf_frame.hbs'), onRender: function(){ var PDF_PATH = '../../pdf/websummitpitch.pdf'; var PAGE_NUMBER = 1; var PAGE_SCALE = 1.5; var SVG_NS = 'http://www.w3.org/2000/svg'; if (PDFJS) { console.log("PDFJS is loaded in Backbone View"); } else { console.log("PDFJS is NOT loaded in Backbone View"); } PDFJS.workerSrc = "/js/pdf.worker.js"; console.log("workerSrc is set to ", PDFJS.workerSrc); // Loading document and page text content PDFJS.getDocument({url: PDF_PATH}).then(function (pdfDocument) { console.log("get document"); pdfDocument.getPage(PAGE_NUMBER).then(function (page) { console.log("get page"); var viewport = page.getViewport(PAGE_SCALE); page.getTextContent().then(function (textContent) { // building SVG and adding that to the DOM var svg = this.buildSVG(viewport, textContent); // render svg in &lt;canvas id="render"&gt; in template document.getElementById('render').appendChild(svg); }); }); }); }, buildSVG: function(viewport, textContent) { // Building SVG with size of the viewport (for simplicity) var svg = document.createElementNS(SVG_NS, 'svg:svg'); svg.setAttribute('width', viewport.width + 'px'); svg.setAttribute('height', viewport.height + 'px'); // items are transformed to have 1px font size svg.setAttribute('font-size', 1); // processing all items textContent.items.forEach(function (textItem) { // we have to take in account viewport transform, which incudes scale, // rotation and Y-axis flip, and not forgetting to flip text. var tx = PDFJS.Util.transform( PDFJS.Util.transform(viewport.transform, textItem.transform), [1, 0, 0, -1, 0, 0]); var style = textContent.styles[textItem.fontName]; // adding text element var text = documen…
answer count: 1
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24935825
favorite count: 0
tagged with: backbone.js
tagged with: pdf.js
accepted answer: http://stackoverflow.com/a/24935825

http://stackoverflow.com/comment/38957016
type: AnswerComment
has text: The image opens, but in order for the image to refresh I have to hit refresh in the address bar and refresh the whole page
type: Comment
comment on: http://stackoverflow.com/a/25044627
score: 0

http://stackoverflow.com/comment/39022112
type: QuestionComment
comment on: http://stackoverflow.com/q/25002287
has text: Yea i asked a specific question about the syntax of the streams in my case. I tried a few things and I think i am misunderstanding something. Callbacks are still bizarre to me, no matter how many tutorials i read or try even with successfully written callback functions it still does not click with me like everything else. When a callback works for me its magic to me. I have no idea how I managed to get it to work :/
score: 0
type: Comment

http://stackoverflow.com/comment/38864793
score: 0
type: QuestionComment
type: Comment
has text: I dont have control on client code :(
comment on: http://stackoverflow.com/q/24997034

http://stackoverflow.com/comment/38795424
type: Comment
type: QuestionComment
has text: @mdesdev Thanks, but it doesn't work for me.
comment on: http://stackoverflow.com/q/24959655
score: 0

http://stackoverflow.com/a/35117591
score: 23
upvote count: 23
answers question: http://stackoverflow.com/q/25052758
downvote count: 0
has body: Just to note that: var keys = Object.keys(obj), i = keys.length; while(--i) { // } will not run for the index 0 and then you'll miss one of your attributes. This in an array like ["a","b","c","d"] will run only d,c,b, and you'll miss the "a" 'cause index is 0 and 0 is false. You need to decrement after the while check: var keys = Object.keys(obj), i = keys.length; while(i--) { // }
type: Answer

http://stackoverflow.com/comment/38991274
type: Comment
score: 1
type: QuestionComment
has text: How about you explain why you are doing all this - eg what is the big picture
comment on: http://stackoverflow.com/q/25064155

http://stackoverflow.com/q/24968738
type: Question
tagged with: javascript
has title: Binding image source in knockout dynamically
answer count: 1
downvote count: 0
has body: I want to bind a new image path to image , I have a popup ,where on select of checkbox,I get a new image path which I need to bind with the image of parent window, so I have a public function which is getting called on selection of checkbox in popup page, Below is what i tried, &lt;a data-bind="attr:{href: thumburl , target:'_self'}" class="light"&gt; &lt;img data-bind="attr: {src: Image} " /&gt; &lt;/a&gt; javascript : &lt;script&gt; function parentFunc(path) { // I get the new path here. } $(function () { var audioObject = { ID:0, Image: "", ContentID: 0 } function Audio(data) { var self = this; this.thumburl = ko.observable("http://localhost:61437/Admin/Thumbnail/Play?ContentID=" + data.ContentID); console.log('mapping to js', data); ko.mapping.fromJS(data, audioObject, self); } // as it is an edit page, I am loading the data using id. var loadData = function (id) { var _url = '/api/v2/my/audio'; $.ajax({ type: 'get', url: _url + '/' + id, success: function (d) { if (!!d.error) { console.log(d.message); } else { var model = new Audio(d); ko.applyBindings(model, document.getElementById("audioEdit")); console.log(model); } } }); } loadData(@ViewBag.Id); }); Any suggestions on what can I do to make this work?? New to knockout!!
score: 1
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
upvote count: 1
tagged with: knockout.js
has answer: http://stackoverflow.com/a/24970109

http://stackoverflow.com/a/25032341
score: 7
has body: There is no magic syntax to delete only one element from an array that is stored in chrome.storage. In order to delete an item from the array, you has to retrieve the stored array, throw away the unwanted items (or equivalently, keep only the items that you want to keep), then save the array again: chrome.storage.local.get({users: []}, function(items) { // Remove one item at index 0 items.users.splice(0, 1); chrome.storage.set(items, function() { alert('Item deleted!'); }); }); See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice. Note that if you want to delete one or more items whose value satisfies a certain condition, you have to walk the array in reverse order. Otherwise you may end up removing the wrong items since the indices of the later elements are off by one after removing the first item, off by two when you've removed two items, etc.
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/25032058
has comment: http://stackoverflow.com/comment/38931160
accepted answer of: http://stackoverflow.com/q/25032058
has comment: http://stackoverflow.com/comment/38934401
upvote count: 7

http://stackoverflow.com/a/24933589
has body: Try it please. HTML: &lt;form runat="server"&gt; &lt;input type="file" id="imgInput"&gt; &lt;img src="#" alt="image" id="img"&gt; &lt;/form&gt; JavaScript: function readURL(input) { if (input.files &amp;&amp; input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { $('#img').attr('src', e.target.result;) } reader.readAsDataURL(input.files[0]); } } $('#imgInput').change(function() { readURL(this); });
answers question: http://stackoverflow.com/q/24932687
type: Answer
has comment: http://stackoverflow.com/comment/38745328
score: 0

http://stackoverflow.com/comment/38702766
score: 0
type: Comment
type: QuestionComment
has text: I apologies, it is a reference to the object. But can't I use reference to the object to call the object? and if not how could i possibly call each individual object within the loop, so the function could place the correct marker to the correct location?
comment on: http://stackoverflow.com/q/24909862

http://stackoverflow.com/a/24977264
has comment: http://stackoverflow.com/comment/38828182
answers question: http://stackoverflow.com/q/24977103
score: 1
has comment: http://stackoverflow.com/comment/38827503
has comment: http://stackoverflow.com/comment/38827528
downvote count: 0
has body: It looks like you have a problem with the structure of the data in your scope. Your example JSON shows an object with an entries property and a count property. You then put that whole object in your scope as entries. This means you'd need to access the entries as entries.entries, with the count in entries.count. Perhaps this controller is closer to what you wanted: myApp.controller("MyController", ['$scope', '$http', '$log', function($scope, $http, $log){ ... $http.get('https://myServiceURL').success(function(data){ $scope.entries = data.entries; $scope.count = data.count; }); }]);
has comment: http://stackoverflow.com/comment/38827600
type: Answer
upvote count: 1

http://stackoverflow.com/q/25007094
downvote count: 0
has title: ScrollDown page to the next element
tagged with: javascript
tagged with: jquery
answer count: 1
has answer: http://stackoverflow.com/a/25007355
favorite count: 0
upvote count: 2
type: UnansweredQuestion
tagged with: scroll
score: 2
type: Question
has body: When the user scrolldown with the mousewheel, I'd like the page go down untill exactly the begining of the next element. Like : &lt;section class="One"&gt; ... &lt;/section&gt; &lt;section class="Two"&gt; ... &lt;/section&gt; &lt;section class="Three"&gt; ... &lt;/section&gt; When you enter the website, you'll be at the start page, when you scrolldown 1x, I'd like the page scroll untill the begining of section 2 and so on... Imagine the sections like, home / about / contact I tried this, but in this example, I have to write the exactly name of the elements and I would have to write one of this for each section... Is there a different way to do so ? window.onload=function myScroll() { x = document.getElementById("chat"); h = x.clientHeight; x.scrollTop = h; } &lt;div id="chat" style="width: 100%; height: 70px; overflow: scroll; border: 1px solid grey"&gt;

http://stackoverflow.com/a/25041958
downvote count: 0
score: 1
has body: You can use a second array to preserve the order of keys. var order = []; //add something to map map['a'] = 1; order.push('a'); map['b'] = 2; order.push('b'); //iterate in order for (var i=0; i&lt; order.length;++i) { alert(map[order[i]); } Preserving consistency of the order array might be tricky since you always need to update the order array when you modify the original map.
answers question: http://stackoverflow.com/q/25041814
upvote count: 1
type: Answer

http://stackoverflow.com/q/25066052
downvote count: 1
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25066174
answer count: 1
tagged with: javascript
favorite count: 0
has body: I'm testing events on an iframe and i came across something quite weird. I have looked around for other people with the same problem but found none exactly with these characteristics. I have a page that contains an iframe: Parent ...go to the 2nd page... and the iframe: Iframe When i load the page, the onload event on the iframe is run twice and, more weird even, it looks like the iframe itself is being loaded twice because the loaded element the console looks like this (the variable i is twice '0'): iframe loaded 0 iframe.html:11 parent loaded (index):13 iframe loaded 0 iframe.html:11 To add to the weirdness, if i don't attach the onload event on the parent file, the iframe's onload runs correctly, only once. If you want to run it without interference just go to http://sureshots.andrepadez.com/iframetest/ I need to know if i'm doing something wrong or if this is a known issue and how can i fix it.
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25066174
upvote count: 2
has title: window.onload called twice inside an iframe
score: 1
tagged with: iframe

http://stackoverflow.com/a/24987447
upvote count: 1
answers question: http://stackoverflow.com/q/24986942
downvote count: 0
score: 1
has body: Thanks everyone for your help! I'd almost given up and wanted to use a button to toggle it instead. The more you know! And since this is an answer to my question: e.stopPropogation()
type: Answer

http://stackoverflow.com/q/25045047
score: 0
answer count: 2
tagged with: jquery
has title: Uncaught TypeError: object is not a function on "(function($)"
has answer: http://stackoverflow.com/a/25045351
linked to: http://stackoverflow.com/q/1873983
has comment: http://stackoverflow.com/comment/38955607
has comment: http://stackoverflow.com/comment/38956570
possible better answer: http://stackoverflow.com/a/25045130
has answer: http://stackoverflow.com/a/25045130
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38955575
accepted answer: http://stackoverflow.com/a/25045351
linked to: http://stackoverflow.com/q/7145514
type: Question
has comment: http://stackoverflow.com/comment/38956502
tagged with: javascript
has comment: http://stackoverflow.com/comment/38955525
has body: Why do I get the following error... Uncaught TypeError: object is not a function ...at the following line, of a certain JS script? (function($){ And why do I get that error only when JS are concatenated? (I'm using Gulp) And why does it work if I add ; before that line, like that: ;(function($){ ? update The preceding line - that is, the object which is not a function, according to the runtime error - on the concatened script was a }, as in: storage = { //... } I'm used to always put semicolon, but not after curly braces. Turns out the curly braces could delimit the end of a statement, like in this case, and then it's recommended to use the semicolon to avoid this error. Here's a good explanation.
linked to: http://stackoverflow.com/q/2717949
has comment: http://stackoverflow.com/comment/38955947
has comment: http://stackoverflow.com/comment/38955931

http://stackoverflow.com/q/24959266
has comment: http://stackoverflow.com/comment/38794689
has answer: http://stackoverflow.com/a/24959945
has comment: http://stackoverflow.com/comment/38794531
has comment: http://stackoverflow.com/comment/38793884
has comment: http://stackoverflow.com/comment/38794676
tagged with: codeigniter
has comment: http://stackoverflow.com/comment/38794570
tagged with: php
has body: I am trying to write a script that will add the video currently being viewed to a database of favourites. However every time it runs, an error is returned, and nothing is stored in the database. Here is the JQuery $(document).ready(function() { $("#addfav").click(function() { var form_data = {heading: $("#vidheading").text(), embed : $("#vidembed").text()}; jQuery.ajax({ type:"POST", url:"localhost/stumble/site/add_to_fav.php", dataType: "json", data: form_data, success: function (data){ console.log(data.status); alert("This Video Has Been Added To Your Favourites") }, error: function (data){ console.log(data.status); alert("You Must Be Logged In to Do That") } }); }) }) The add_to_fav.php is this... public function add_to_fav(){ $this-&gt;load-&gt;model('model_users'); $this-&gt;model_users-&gt;add_favs(); } And the add_favs function is below public function add_favs(){ if($this-&gt;session-&gt;userdata('username')){ $data = array( 'username' =&gt; $this-&gt;session-&gt;userdata('username'), 'title' =&gt; $this-&gt;input-&gt;post('heading'), 'embed' =&gt; $this-&gt;input-&gt;post('embed') ); $query = $this-&gt;db-&gt;insert('fav_videos',$data); if($query){ $response_array['status'] = 'success'; echo json_encode($response_array); }}else { $response_array['status'] = 'error'; echo json_encode($response_array); } } Thank you for the input, this has me stuck but I am aware it may be something relatively simple, my hunch is that it is something to do with returning success or error.
has comment: http://stackoverflow.com/comment/38794388
has comment: http://stackoverflow.com/comment/38794194
has comment: http://stackoverflow.com/comment/38794734
has comment: http://stackoverflow.com/comment/38794497
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38795475
has comment: http://stackoverflow.com/comment/38793502
has comment: http://stackoverflow.com/comment/38793613
has comment: http://stackoverflow.com/comment/38794410
has comment: http://stackoverflow.com/comment/38793829
has comment: http://stackoverflow.com/comment/38794585
accepted answer: http://stackoverflow.com/a/24959945
type: Question
has title: Jquery AJAX with codeigniter, always returns error
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38794492
has comment: http://stackoverflow.com/comment/38793528
tagged with: ajax
score: 0
has comment: http://stackoverflow.com/comment/38793729
has comment: http://stackoverflow.com/comment/38793686
has comment: http://stackoverflow.com/comment/38794542

http://stackoverflow.com/a/24930362
has body: Nothing is wrong with Chrome. Can you show the code for uploading the file? I always used Chrome for my default browser, and nothing goes wrong here. here is the proof http://jsfiddle.net/3ZE7Z/ &lt;form&gt; &lt;input type='text' onchange='alert("change!");'&gt; &lt;/form&gt; Edit: Make sure you have the latest version of Chrome. By default, Chrome will check for update and update itself
has comment: http://stackoverflow.com/comment/38900626
answers question: http://stackoverflow.com/q/24930054
score: 0
has comment: http://stackoverflow.com/comment/38888776
type: Answer

http://stackoverflow.com/q/24914746
has body: I use the following code on a text box to include a datepicker and set it to the current date: $(function() { $("#datepicker").datepicker({ dateFormat: "dd-mm-yy" }).datepicker("setDate", "0"); }) While this sets the datepicker's value to the current date, it also displays the calendar in the background, like so: The calendar is not even attached to the datepicker field, it just shows in the background. Why this creepy behavior and how can I fix it?
tagged with: datepicker
score: 1
duplicate of: http://stackoverflow.com/q/4580727
has title: Datepicker shows calendar on pageload
answer count: 2
has answer: http://stackoverflow.com/a/24914801
has comment: http://stackoverflow.com/comment/38712288
upvote count: 1
has answer: http://stackoverflow.com/a/24915091
tagged with: jquery-ui
type: UnansweredQuestion
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
linked to: http://stackoverflow.com/q/4580727
type: Question

apache
tag name: apache
tags question: http://stackoverflow.com/q/24985072
type: Tag
tags question: http://stackoverflow.com/q/24995054

http://stackoverflow.com/a/25029177
has comment: http://stackoverflow.com/comment/38961312
score: 0
has body: It is better to use the Touch Event or Tap Event when using a mobile device An example of this event would be A Js Fiddle Example Is Here You can find more information about thisClick Here
has comment: http://stackoverflow.com/comment/38948889
type: Answer
answers question: http://stackoverflow.com/q/25028610

http://stackoverflow.com/comment/38742683
comment on: http://stackoverflow.com/q/24932325
has text: did you seen this ? http://code.stephenmorley.org/javascript/dom-nodetype-constants/
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25018609
has answer: http://stackoverflow.com/a/25018749
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38905552
has comment: http://stackoverflow.com/comment/38905950
has answer: http://stackoverflow.com/a/25018797
has title: div gets pushed down for apparently no reason
linked to: http://stackoverflow.com/q/4827977
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25018704
tagged with: css
accepted answer: http://stackoverflow.com/a/25018797
has answer: http://stackoverflow.com/a/25018890
answer count: 4
has comment: http://stackoverflow.com/comment/38905601
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25018704
score: 0
has comment: http://stackoverflow.com/comment/38905551
has body: I have a simple grid with 5 divs, each one containing an image. Why the last div (with the different image) has an offset? It gets pushed down for no apparent reason. Example here. CSS .thumb-container { border: 1px solid #e5e5e5; padding: 15px; margin-right: 15px; margin-bottom: 15px; width: 130px; height: 130px; display: inline-block; } JavaScript $.when( loadImageSet(imageURLs) ).then(function(data){ var imageSet = []; $.each(data, function(index, value){ imageSet.push(value); }) for (var i = 0; i &lt; imageSet.length; i++) { var thumbContainer = $('&lt;div&gt;', {class: 'thumb-container'}); img = resizeImage(imageSet[i], 100); thumbContainer.append(img); $('.box').append(thumbContainer); } }); EDIT I got it, I need to set vertical-align: top to .thumb-container or display:block to the img. But still don't understand why it behaves that way.
linked to: http://stackoverflow.com/q/5804256
type: Question

http://stackoverflow.com/a/25038613
downvote count: 0
type: Answer
has body: Your approach isn't that bad if you have a relatively small number of documents and don't change positions a lot. As an alternative you could store the positional metadata in a separate array. Position updates would only touch one document. Basic Python example: def move(positions, old_index, new_index): element = positions.pop(old_index) positions.insert(new_index, element) return positions # Fetch array from MongoDB (or from anywhere really) positions = [ { '_id': 'ObjectId("...")', 'name': "bubble", 'description': "some description" }, { '_id': 'ObjectId("...")', 'name': "bubbleA", 'description': "some description" }, { '_id': 'ObjectId("...")', 'name': "bubbleB", 'description': "some description" }, { '_id': 'ObjectId("...")', 'name': "bubbleC", 'description': "some description" }, { '_id': 'ObjectId("...")', 'name': "bubbleD", 'description': "some description" }, { '_id': 'ObjectId("...")', 'name': "bubbleE", 'description': "some description" }, { '_id': 'ObjectId("...")', 'name': "bubbleF", 'description': "some description" } ] old_index = 3 new_index = 0 move(positions, old_index, new_index) # New positions: # # [{'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubbleC'}, &lt;-- # {'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubble'}, # {'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubbleA'}, # {'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubbleB'}, # {'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubbleD'}, # {'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubbleE'}, # {'_id': 'ObjectId("...")', 'description': 'some description', 'name': 'bubbleF'}] Writing a small helper function would help with moving elements around by _id or name.
answers question: http://stackoverflow.com/q/25036089
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25036089
type: AcceptedAnswer

http://stackoverflow.com/a/24911001
score: 0
accepted answer of: http://stackoverflow.com/q/24910550
type: Answer
answers question: http://stackoverflow.com/q/24910550
has body: A knockout observable array is just a javascript array when unwrapped. You could use a computed if you want to associate a subset of items with the item just clicked var samePlaceSlices = ko.computed(function() { // assumes you have observableArray called timeSlices var timeSlicesArr = timeSlices(), samePlaceSliceArr = []; // just loop through items like a normal array for(var i = 0; i &lt; timeSlicesArr.length; i++) { // assumes slices have a property called place, not an observable // and a single observable called clickedSlice that is the last clicked slice if(timeSlicesArr[i].place == clickedSlice().place) { samePlaceSliceArr.push(timeSlicesArr[i]); } } return samePlaceSliceArr;
type: AcceptedAnswer

http://stackoverflow.com/comment/38909722
type: Comment
comment on: http://stackoverflow.com/a/25020744
score: 0
type: AnswerComment
has text: oh right, didnt notice it thanks. ill fix it in a bit

http://stackoverflow.com/a/25029627
type: Answer
upvote count: 1
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25029503
has body: You can try below code by getting some random value and use it for if / else conditions : $(function(){ $('.apple').each(function(){ var random = ((Math.random()*100) + 50).toFixed(); if(random &gt; 100) $('.container').append($(this)); else if(random &lt; 100) $('.container').prepend($(this)); else { var childCount = $('.container').children().length; $('.container').find('div:eq('+(childCount/2)+')').append($(this)); } }); }); Demo

http://stackoverflow.com/a/24995279
downvote count: 0
has body: Your current event listener $( "[type=checkbox]" ).change is only bound to the checkboxes present in the dom on pageload. Instead use .on() function to bind to dynamic dom elements $(document).on("change", ":checkbox", function(){ //your ajax }
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24995074
has comment: http://stackoverflow.com/comment/38937648

http://stackoverflow.com/comment/38818887
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24972488
has text: It appears to have worked. Thank you!

http://stackoverflow.com/comment/38980972
type: QuestionComment
comment on: http://stackoverflow.com/q/25058817
has text: I cannot understand your question precisely.. can you please rephrase it to make a clear question.?
type: Comment
score: 0

http://stackoverflow.com/comment/38899647
type: Comment
score: 0
has text: What's the value of `pagemode` JS variable when you're submitting the form ? Also, did you include `customfunctions.js` in your html ? Keep in mind that the only time it won't go to server side function is when your JS returns `false`
type: QuestionComment
comment on: http://stackoverflow.com/q/25015555

http://stackoverflow.com/a/24921107
type: Answer
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24919143
downvote count: 0
has body: I changed a couple of variables names and remove the 's' from https on the url, also set diagnostics to false since it was throwing weird symbols. Hope this is what you were looking for demo function drawTable() { // use jQuery to make an AJAX request for data $.ajax({ type: "get", dataType: 'json', url: 'http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.quoteslist%20where%20symbol%3D%27BRDT%2CAPPL%27&amp;format=json&amp;diagnostics=false&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&amp;callback=', success: function (data) { var dt = new google.visualization.DataTable(); dt.addColumn('string', 'Symbol'); dt.addColumn('number', 'Open'); // parse the JSON into the DataTable for (var i = 0; i &lt; data.query.results.quote.length; i++) { Symbol = data.query.results.quote[i].Symbol; Open = parseFloat(data.query.results.quote[i].Open); if (isNaN(Open)) { Open = 0; } dt.addRow([Symbol, Open]); } var table = new google.visualization.Table(document.querySelector('#table_div')); table.draw(dt); }, error: function (e, a, s) { alert(s); } }); } google.load('visualization', '1', { packages: ['table'], callback: drawTable });
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24919143

http://stackoverflow.com/comment/38744511
comment on: http://stackoverflow.com/q/24932912
type: QuestionComment
has text: I checked it in crome developer tools. but function is not firing
type: Comment
score: 0

http://stackoverflow.com/q/24994580
score: 3
has comment: http://stackoverflow.com/comment/38890613
tagged with: javascript
has comment: http://stackoverflow.com/comment/38865550
has comment: http://stackoverflow.com/comment/38860358
has comment: http://stackoverflow.com/comment/38898997
has comment: http://stackoverflow.com/comment/38864281
has answer: http://stackoverflow.com/a/25015119
has comment: http://stackoverflow.com/comment/38864023
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38864634
has comment: http://stackoverflow.com/comment/38864227
has comment: http://stackoverflow.com/comment/38864250
has title: adding hover and onclick effect for sliding images?
has comment: http://stackoverflow.com/comment/38865629
has comment: http://stackoverflow.com/comment/38860276
accepted answer: http://stackoverflow.com/a/25015119
has comment: http://stackoverflow.com/comment/38866438
tagged with: hover
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38864142
tagged with: onclick
upvote count: 3
has comment: http://stackoverflow.com/comment/38864194
has body: I'm using a jQuery script for sliding images on my website. I don't know how to fix my hover (now it just slides by 1 logo when I need to slide until mouseout) and click effect (which slide by 1 logo) for my "next" and "prev" buttons. Here is the JavaScript for 2 buttons that I've tried: if(o.btnPrev) $(o.btnPrev).click(function() { return go(curr-o.scroll); }); if(o.btnNext) $(o.btnNext).click(function() { return go(curr+o.scroll); }); if(o.btnGo) $.each(o.btnGo, function(i, val) { $(val).click(function() { return go(o.circular ? o.visible+i : i); }); }); EDIT - I found out how to add hover and click events to my buttons, but I still need to add a hover effect on the button that slides logos until mouseout. Can someone point me in the right direction please? EDIT-2 - there is new jq code, and what i need now is to scroll my logos when mouse is over the arrows until its out,so i want that when im on the arrows its scrolls the logos 1by1 until the coursor is out, for the moment i need to go out and go on the arrow to scroll the next logo and i need also to add the speed of scrolling on mouseover, thnaks.. New JQ scritp for buttons if(o.btnPrev) $('#previous').click (function () { return go(curr-o.scroll); }); if(o.btnNext) $('#next').click (function () { return go(curr+o.scroll); }); if(o.btnGo) $.each(o.btnGo, function(i, val) { $(val).click (function() { return go(o.circular ? o.visible+i : i); }); }); if(o.btnPrev) $('#previous').mouseover(function () { return go(curr-o.scroll); }); if(o.btnNext) $('#next').mouseover(function () { return go(curr+o.scroll); }); if(o.btnGo) $.each(o.btnGo, function(i, val) { $(val).mouseover(function() { return go(o.circular ? o.visible+i : i); }); }); and here is JSFiddle with full JQ Script : http://jsfiddle.net/Lfy6Y/21/
has comment: http://stackoverflow.com/comment/38864620
has comment: http://stackoverflow.com/comment/38864354
type: Question
has comment: http://stackoverflow.com/comment/38866530
has comment: http://stackoverflow.com/comment/38864389

http://stackoverflow.com/a/25015103
answers question: http://stackoverflow.com/q/25013334
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25013334
has comment: http://stackoverflow.com/comment/38933813
type: Answer
has body: It appears you're having trouble accessing the options that belong to the instance of the class, correct ? And you know this is because jQuery.each sets this to an object-wrapped version of the val variable, so @options does not work in that callback. In my example below, the slight change is that I've closed the each callback over the variable opts, which will allow your loop to refer to the contents of @options even though this has been changed. class Cat defaults: name: 'tabby' weight: 5 constructor: (@options) -&gt; opts = @options $.each @defaults, (key, val) -&gt; opts[key] = val unless opts.hasOwnProperty(key) c = new Cat(name: 'fluffy') console.log c.options Notice, no double arrow is needed :) In your case, the double arrow wouldn't have hurt since you were accessing the variable val instead of using @ to refer to the value of the current iteration, but you're right to try to get rid of =&gt; when not absolutely necessary. Try it at this fiddle: http://jsfiddle.net/chicagogrooves/72fa3/ That said, I'd like to mention that for the case of overwriting defaults, you could use jquery.extend instead of manually writing your loop. This is a common enough thing to do that it is part of many libraries, not something you need to write by hand usually. But I wanted to explain more thoroughly since double arrows and this are good concepts to know.
score: 2
upvote count: 2

http://stackoverflow.com/comment/38814267
has text: You should really think about using a more recent version. The current version is 5.0
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24969463
type: AnswerComment

http://stackoverflow.com/q/24984237
tagged with: twitter-bootstrap-3
has comment: http://stackoverflow.com/comment/38878597
has comment: http://stackoverflow.com/comment/38885790
tagged with: twitter-bootstrap
type: UnansweredQuestion
answer count: 0
type: Question
has title: how to slide element using bootstrap 3 grid system
has body: I'm trying to implement sliding menu. I'm using bootstrap 3 grid system. How can I move element from one side to another using bootstrap's grid system? Without grid system I would simply position my element absolutely and then change the left property like shown in this Plunker but I feel that this solution would be incorrect. Any help? HTML: Click me Hello Plunker! CSS: div { width: 200px; height: 100px; background-color: green; position:absolute; left:0; right:auto; transition: all 0.5s linear; } div.left { left:0; } div.left { left:200px; } JS: var el = document.getElementById('clickMe') el.addEventListener('click', function(e) { var element = document.querySelector('div'); if (element.classList.contains('left') { element.classList.remove('left'); element.classList.add('right'); } else { element.classList.remove('right'); element.classList.add('left'); } })
tagged with: javascript
score: 0
tagged with: css

http://stackoverflow.com/comment/38811684
score: 0
type: AnswerComment
has text: They seem to be fine at the moment?
type: Comment
comment on: http://stackoverflow.com/a/24947870

http://stackoverflow.com/comment/38895329
has text: do you want the the div with "test" in it to be on top of the shape ?
comment on: http://stackoverflow.com/q/25012952
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38751102
score: 0
type: Comment
has text: Thank you so very much. I find all three posted solutions useful but this one is the most practical for my actual use case. I appreciate the help.
comment on: http://stackoverflow.com/a/24923109
type: AnswerComment

http://stackoverflow.com/comment/38930686
has text: @ Robert. Do you mean something like: s1.attr("*", attrs.item(i).svg);
score: 0
comment on: http://stackoverflow.com/q/25013379
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24929760
type: Answer
has body: Why you whant add div to Options? You could try like this: $('#platypusDropDown').click(function () { var dropHeight = $(this.options[0]).height() * this.options.length; if($(this).data('open')) { $(this).data('open', false); $('#addCategory').css('padding-top', '0px') return; } $('#addCategory').css('padding-top', dropHeight + 'px') $(this).data('open', true); }); JSFIDDLE DEMO
answers question: http://stackoverflow.com/q/24928716
score: 0

http://stackoverflow.com/a/31264868
has comment: http://stackoverflow.com/comment/53410954
answers question: http://stackoverflow.com/q/24911126
type: Answer
score: 13
downvote count: 1
has body: Myjson.com provides api, which runs in Jsfiddle.net. Custom my myjson: // Loading JSON with CROS var url = 'https://api.myjson.com/bins/3ko1q'; $.ajax({ type: 'GET', url: url, async: false, contentType: "application/json", dataType: 'json', success: function (data) { alert('success'); console.log(data); }, error: function (e) { alert('error'); console.log(e); } }); Myjson GET Example: // 1. Create valid uri via POST // 2. GET using newly created uri var obj = { "key": "value", "key2": "value2" }; var data = JSON.stringify(obj); $("#clickMe").click(function () { $.ajax({ url: "https://api.myjson.com/bins", type: "POST", data: data, contentType: "application/json; charset=utf-8", dataType: "json", success: function (data, textStatus, jqXHR) { // load created json $.get(data.uri, function (data, textStatus, jqXHR) { var json = JSON.stringify(data); $("#data").val(json); }); } }); });
has comment: http://stackoverflow.com/comment/121145964
upvote count: 14

http://stackoverflow.com/q/25046060
has body: Is it possible to simulate a click on an embedded YouTube video in an HTML document? I know a video can be autoplayed with a simple change in the link, but I want to start play by simulating a click from the cursor. It should be registered as a click from the user. Any help is appreciated.
has comment: http://stackoverflow.com/comment/38963204
has comment: http://stackoverflow.com/comment/38963219
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38959440
has comment: http://stackoverflow.com/comment/38960474
has answer: http://stackoverflow.com/a/25046309
tagged with: youtube
has comment: http://stackoverflow.com/comment/38959825
score: 0
linked to: http://stackoverflow.com/q/3277369
upvote count: 1
downvote count: 1
type: Question
tagged with: flash
tagged with: javascript
has title: How to simulate a click on an embedded youtube video with javascript
tagged with: click
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38960526
favorite count: 0

http://stackoverflow.com/a/24977309
type: AcceptedAnswer
has body: You can wrap your object in a function so you can perform operations on it, e.g. concatenations. var car = function () { var color = 'red', hubcaps = 'spinning', full_name = color + ' ' + hubcaps; return { color: color, wheels: 4, hubcaps: hubcaps, age: 4, full_name: full_name }; // (); &lt;- calls the anonymous function after defining it }(); // true car.full_name === "red spinning"; Edit: Like what @Jimmyt1988 said, if you want to instantiate new versions of this functions, i.e. OO Javascript, you can remove the inline function call (); and use it like so var myCar = new car(); alert(mycar.color);
has comment: http://stackoverflow.com/comment/38827729
type: Answer
has comment: http://stackoverflow.com/comment/38827665
score: 3
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24977221
upvote count: 3
answers question: http://stackoverflow.com/q/24977221

http://stackoverflow.com/comment/38966757
type: Comment
has text: cool.got it. so the temporary object(wrapper) is created as if by calling new String(str), when u trying to access the property.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25051081

http://stackoverflow.com/q/24919307
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/38719436
tagged with: javascript
has comment: http://stackoverflow.com/comment/38719258
has comment: http://stackoverflow.com/comment/38719505
has title: How do I create a dynamic json array?
has comment: http://stackoverflow.com/comment/38719053
has comment: http://stackoverflow.com/comment/38719099
linked to: http://stackoverflow.com/q/1168807
has comment: http://stackoverflow.com/comment/38718912
duplicate of: http://stackoverflow.com/q/1168807
has body: I have the following javascript code: var eventItems = { "addevent": { name: "Add New Event" }, "addtodo": { name: "Add New Todo" } }; console.log(eventItems); How can I create the eventItems object dynamically? I've tried this, and it doesn't work. var eventItems = []; eventItems.push({ "addevent": { name: "Add New Event" } }); eventItems.push({ "addtodo": { name: "Add New Todo" } }); console.log(eventItems); I realize the first statement isn't an array, but I'm not sure of the syntax to add these 2 elements dynamically one at a time. Edited: modified question to clarify what I'm trying to do.
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38719199
has comment: http://stackoverflow.com/comment/38719242
has comment: http://stackoverflow.com/comment/38719169
has comment: http://stackoverflow.com/comment/38719309
answer count: 0
tagged with: http://stackoverflow.com/tag/json
score: 0

http://stackoverflow.com/comment/38950926
type: Comment
has text: Well... that's weird. You caused me to dig in to it a bit more. In Chrome my page and your pen both have a working button and a broken link. In Firefox, my page and your pen both have a broken button and a working link...
type: QuestionComment
comment on: http://stackoverflow.com/q/25042697
score: 1

http://stackoverflow.com/comment/38883130
has text: There's no `class="actusactuevent_53d6e48c65b68"` in the HTML.
score: 1
type: AnswerComment
comment on: http://stackoverflow.com/a/25006837
type: Comment

http://stackoverflow.com/a/24941825
score: 2
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24941748
answers question: http://stackoverflow.com/q/24941748
type: AcceptedAnswer
has body: The meta tags only apply to the html page, not loaded resources. Instead, respond with the header Cache-Control: no-store for the js files. Further reading: http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Avoiding_caching Note that the script itself will have to be updated so that the browser requests it, along with the above header.
upvote count: 2
type: Answer

http://stackoverflow.com/a/24965437
answers question: http://stackoverflow.com/q/24965295
has comment: http://stackoverflow.com/comment/38805472
type: Answer
upvote count: 1
has comment: http://stackoverflow.com/comment/38805542
score: 1
downvote count: 0
has body: Looks like I got beaten to the button, so here is an alternative way. I'm assuming all of those elements are enclosed in somesort of parent element, such as 'enclosingDiv'. If that is so, a simple answer would be: var e = document.getELmentById('enclosingDiv'); var divAsString = String(e); var newDivAsString = divAsString.replace('text', 'candy'); e.innerHTML = newDivAsString;
has comment: http://stackoverflow.com/comment/38805443

http://stackoverflow.com/comment/38939310
type: QuestionComment
comment on: http://stackoverflow.com/q/25030792
has text: Hmm, CORS is annoying me :( By the way I tried your base64 suggestion and it worked, however it really messes up my code because some of the image files are quite large. I suppose I could store the image data as text in a separate text file and call it. I'll try your localhost solution and see if I can get that working.
score: 0
type: Comment

http://stackoverflow.com/a/25040280
has body: There really isn't anything you can do to prevent the code from being seen. This is because the transmission of Javascript over HTTP is clear text and the browser relies on that so you can't send an encrypted javascript file. What you CAN do, is to minify and obfuscate the file, so that it is harder to read. This will replace: function compareNumbers(firstNumber, secondNumber) { return firstNumber &lt; secondNumber; } with: function a(b, c) { return b &lt; c; } So it's still somewhat readable, but not as easy to understand.
upvote count: 0
type: AcceptedAnswer
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/25040145
accepted answer of: http://stackoverflow.com/q/25040145
score: -1

http://stackoverflow.com/comment/38984791
score: 0
comment on: http://stackoverflow.com/a/25060348
type: AnswerComment
has text: You get some error message? Add `console.log(xmlhttp.readyState)` at the beginning of the `onreadystatechange` function to see how far it goes.
type: Comment

http://stackoverflow.com/comment/38899707
score: 0
type: AnswerComment
type: Comment
has text: @Benjamin That is... Way too much change.
comment on: http://stackoverflow.com/a/24988713

http://stackoverflow.com/q/25066110
tagged with: css
tagged with: twitter-bootstrap-3
score: 0
has answer: http://stackoverflow.com/a/25075853
type: Question
tagged with: javascript
answer count: 1
has body: I'm having this problem in Firefox 31.0 where, when I scale down my browser to the mobile version and click on the drop down icon my navigation items will then shift to the right of my logo. This is not a issue with Chrome or Safari this only resides with Firefox 31.0. I'm using the latest build from Bootstrap v3.2.0. I've pasted my HTML and CSS to this post for reference. CSS #logo { height: 100%; margin-top: 5px; } .navbar-nav { padding-top: 7px; } .navbar { top:-100px; } .navbar-brand { padding: 0px; } .navbar { min-height: 62px; } .navbar-toggle { margin-top: 13px; margin-bottom: 12px; } .navbar-inverse .navbar-toggle { border-color: #000; } .navbar-inverse .navbar-nav li { margin-right:14px; } .navbar-inverse .navbar-nav li a { font-family: 'MuseoSans700', Verdana, Arial, TimesNewRoman; letter-spacing: 0.3px; font-size:13px; } .navbar-inverse { background-color: #000; border-color: #000; } .navbar-inverse { background-image: -webkit-linear-gradient(45deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.15) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.15) 50%, rgba(0, 0, 0, 0.15) 75%, transparent 75%, transparent); background-image: linear-gradient(to bottom, #000 0, #000 100%); } .navbar-inverse .navbar-nav > li > a { color: #ffffff; } .navbar-inverse .navbar-nav > li > a:hover, .navbar-inverse .navbar-nav > li > a:focus { color:#545454; } .navbar-inverse .navbar-nav > li > a:active { color:#545454; } HTML CASE STUDIES ABOUT US CONTACT Thanks, Abel
type: UnansweredQuestion
has title: Bootstrap 3 navbar-brand logo shifting navigation links in FireFox 31.0

http://stackoverflow.com/comment/38958771
score: 0
type: AnswerComment
has text: You shouldn't need an `eval()` for that if you use Polymer's [type hinting](http://www.polymer-project.org/docs/polymer/polymer.html#attrhinting). Basically, add `chartData: [],` before your `ready()` method and Polymer will automatically store `this.chartData` as an array.
type: Comment
comment on: http://stackoverflow.com/a/25026567

http://stackoverflow.com/q/24940692
has answer: http://stackoverflow.com/a/24940865
tagged with: javascript
type: Question
score: 0
has answer: http://stackoverflow.com/a/24941289
tagged with: jquery
has answer: http://stackoverflow.com/a/24940908
tagged with: http://stackoverflow.com/tag/html
tagged with: css
answer count: 4
has answer: http://stackoverflow.com/a/24940955
has body: I am trying to implement the jQuery Validate Popover plugin and it works perfect...except that the popovers appears on white color, instead of the soft red color it appers on the plugin's demo page. I have been try to style them using CSS, and I was able to change the popup color, but not the arrow: .error-popover { background-color: red; &lt;-- this works color: white; } .error-popover .arrow:after { border-color: red transparent; &lt;-- this doesn't } You can check what I'am trying here I am using the latest version of Bootstrap3, jQuery and jQuery Validate. Any ideas on what I am missing here? Thanks Victor Espina
tagged with: twitter-bootstrap
type: UnansweredQuestion
has title: How to change color of a jQuery Validate Popover

http://stackoverflow.com/a/25038970
downvote count: 1
answers question: http://stackoverflow.com/q/25038902
score: 0
has body: Try: $(document).on("change", "#Standard", function(){ And: $(document).on("change", "#Exceptional", function(){
has comment: http://stackoverflow.com/comment/38982585
type: Answer
upvote count: 1

http://stackoverflow.com/q/25066821
has comment: http://stackoverflow.com/comment/38996489
score: 0
has title: I am baffled why this javascript is not changing the color of my h2 elements
has comment: http://stackoverflow.com/comment/38997082
answer count: 1
has comment: http://stackoverflow.com/comment/38996626
tagged with: javascript
tagged with: jquery
has body: I am trying to color all strong and h2 tags based upon an earlier selection (male or female). I have done this to previous li and a tags, so I am confused as to why this isn't working. I must need to go buy a rubber ducky b/c I've been stuck for a while and this seems too easy. CSS: .colorPink { color: #a0426a!important; } .colorBlue { color: blue!important; } Javascript (passing in male/female string, this code does get hit b/c other stuff gets colored): function SetGender(e) { sessionStorage.gender = e; if (sessionStorage.gender == "male") { document.getElementById("category-list").className += " colorBlue"; //..many other class/id color changes //Change H2/Strong tag color color $("#adviceBodyDisplay h2").addClass("colorBlue"); } else if(sessionStorage.gender=="female") { document.getElementById("category-list").className += " colorPink"; //..many other class/id color changes //Change H2/Strong tag color color $("#adviceBodyDisplay h2").addClass("colorPink"); } } HTMLstuff: Real Life Example 1: other text
has comment: http://stackoverflow.com/comment/38996622
has comment: http://stackoverflow.com/comment/38997123
has comment: http://stackoverflow.com/comment/38996650
has comment: http://stackoverflow.com/comment/38996564
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38997147
tagged with: css
has comment: http://stackoverflow.com/comment/38997385
has comment: http://stackoverflow.com/comment/38997029
has answer: http://stackoverflow.com/a/25066952
has comment: http://stackoverflow.com/comment/38997459
has comment: http://stackoverflow.com/comment/38996658
type: Question
has comment: http://stackoverflow.com/comment/38996492
has comment: http://stackoverflow.com/comment/38996641
has comment: http://stackoverflow.com/comment/38996519

http://stackoverflow.com/a/24976465
has body: Try: toggle.menu() instead of open.menu()
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24976450
score: 0
has comment: http://stackoverflow.com/comment/38826150
type: Answer
accepted answer of: http://stackoverflow.com/q/24976450

http://stackoverflow.com/a/24962747
type: Answer
score: 1
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24962649
answers question: http://stackoverflow.com/q/24962649
type: AcceptedAnswer
downvote count: 0
has body: The way you have it now you would access it simply with params[:input]. The params hash gets all path, get and post variables in a single hash.

http://stackoverflow.com/q/24937997
has answer: http://stackoverflow.com/a/25119837
type: Question
has body: I have the underneath code, the editor loads and does not give errors. It does however not enforce the cropping/resizing of the image. I copied the config straight out of the examples,.. (except for the theme that is) But it somehow does not work. Can anyone help out? aviaryObject = new Aviary.Feather({ apiKey: 'xxxx', apiVersion: 3, tools: 'all', theme: 'light', onSave: function(imageID, newURL) { var img = document.getElementById(imageID); img.src = newURL; }, onError: function(errorObj) { alert(errorObj.message); } }); aviaryObject.launch({ image: 'imgId', url: [server-url], forceCropPreset: ['Logo','150x150'], forceCropMessage: 'Please crop your photo to this size', });
score: 0
accepted answer: http://stackoverflow.com/a/25119837
answer count: 1
tagged with: javascript
tagged with: aviary
has title: Aviary "forceCropPreset" not working
type: AnsweredQuestion

http://stackoverflow.com/comment/38978864
has text: @Lord_JABA Sorry, forgot a thing
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25057409
score: 0

http://stackoverflow.com/a/25005588
answers question: http://stackoverflow.com/q/25005511
type: Answer
upvote count: 1
downvote count: 0
score: 1
has body: To help you understand this code , look at what goes after the return statement as an object { ready: function () { console.log('document.ready'); }, load: function() { console.log('document.load'); } } an object that has two items which are both functions. this object is returned and assigned to the variable PageCode, now you can call the frist function PageCode.ready(); and the second PageCode.load(); The $(document).ready(); and the $(window).load(); functions take as arguments functions, which are going to be executed when the document is ready and when the window is loaded. that's why you call them with functions as arguments $(document).ready(PageCode.ready); $(window).load(PageCode.load);

http://stackoverflow.com/comment/38704312
has text: @tymeJV sorry not following, how to put the code inside the callback?
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24911248
type: AnswerComment

http://stackoverflow.com/a/25018451
has body: Setting model.FileName in the action doesn't do anything to the UI or the database. It depends on what you are trying to update, but if you are trying to update the UI, you would need to push the model back down to the client, and then reload the UI via client-JavaScript (since you are doing an AJAX post with JQuery).
score: 3
has comment: http://stackoverflow.com/comment/38909806
has comment: http://stackoverflow.com/comment/38906886
has comment: http://stackoverflow.com/comment/38911042
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38906096
type: Answer
answers question: http://stackoverflow.com/q/25018368
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25018368
has comment: http://stackoverflow.com/comment/38905580

http://stackoverflow.com/comment/38813131
score: 0
comment on: http://stackoverflow.com/q/24962439
type: Comment
type: QuestionComment
has text: I'd call it "an element of the domain of `JSON.stringify`".

http://stackoverflow.com/a/25012716
type: Answer
answers question: http://stackoverflow.com/q/25012535
score: 1
upvote count: 1
downvote count: 0
has body: try this,

http://stackoverflow.com/q/25056856
has comment: http://stackoverflow.com/comment/38977254
has body: heres the button &lt;asp:Button ID="Button1" runat="server" Text="Create Account" OnClientClick="return UserValueValidation();" OnClick="Button1_Click" /&gt; heres the function itself function UserValueValidation() { var fname, lname, email, pwd, cpwd,emailExp; fname = document.getElementById("TextBox6").value; lname = document.getElementById("TextBox5").value; email = document.getElementById("TextBox4").value; pwd = document.getElementById("TextBox3").value; cpwd = document.getElementById("TextBox7").value; emailExp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([com\co\.\in])+$/; if (fname == '' &amp;&amp; lname == '' &amp;&amp; email == '' &amp;&amp; pwd == '' &amp;&amp; cpwd == '' &amp;&amp; emailExp == '') { alert("Enter all fields"); return false; } else { if (fname == ' ') { alert("Enter Name"); return false; } if (lname == ' ') { alert("Enter lastname"); return false; } if (email == ' ') { alert("Enter email"); return false; } if (email != '') { if (!email.match(emailExp)) { alert("Invalid Email Id"); return false; } } if (pwd == ' ') { alert("Enter password"); } if (cpwd == ' ') { alert("Please confirn your password"); return false; } if (pwd != cpwd) { alert("Passwords doesn't match"); return false; } } } On clicking create account the following message pops up Javascript runtime error:UserValueValidation() is undefined... upon click i have redirected the page to the new user acount page using session state...
score: 0
has title: Getting a javascript validation error on signup page when clicking "Create Account" button
has answer: http://stackoverflow.com/a/25056936
has comment: http://stackoverflow.com/comment/38978639
has comment: http://stackoverflow.com/comment/38978299
answer count: 1
tagged with: asp.net
has comment: http://stackoverflow.com/comment/38977481
has comment: http://stackoverflow.com/comment/38978701
type: UnansweredQuestion
type: Question
tagged with: c#
tagged with: javascript

http://stackoverflow.com/a/24968437
has comment: http://stackoverflow.com/comment/38810979
has body: apply jquery function $(".dp").datepicker(); in your function addInput like this function addInput() { document.getElementById('text').innerHTML += " Date "+fields+": "; document.getElementById('count_off').value=fields; $(".dp").datepicker(); // add this line } UPDATE 2 : function addInput() { document.getElementById('text').innerHTML += " Date "+fields+": "; document.getElementById('count_off').value=fields; $("date_"+fields).datepicker(); // add this line fields += 1; }
has comment: http://stackoverflow.com/comment/38810950
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24968384
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38811208

http://stackoverflow.com/q/24910234
answer count: 2
favorite count: 0
has title: How to use LUT with JavaScript?
has answer: http://stackoverflow.com/a/59936957
accepted answer: http://stackoverflow.com/a/25252446
upvote count: 12
type: AnsweredQuestion
downvote count: 0
tagged with: lookup-tables
tagged with: image-processing
has answer: http://stackoverflow.com/a/25252446
type: Question
possible better answer: http://stackoverflow.com/a/59936957
tagged with: javascript
has body: I'm new to image processing. I want to use JavaScript to apply effects to images using LUTs (LookUp Tables) or the corresponding lookup PNGs, something like this: I have googled a lot and couldn't find an article or any resource which will describe the exact process of pixel transformation using LUTs. I have found a nice article here, which describes the 1D and 3D LUTs and the differences between them. But its still is not fully clear for me. I want something like this, which is done for iOS. P.S. Please do not post links/answers regarding image filtering libs, which are using convolution matrices for effects or for filters. Update: Finally! I have got the answer thanks to @abbath. I've created a gist in GitHub, which you can find here.
score: 12

facebook
tags question: http://stackoverflow.com/q/25004282
tags question: http://stackoverflow.com/q/24922534
tags question: http://stackoverflow.com/q/25033964
type: Tag
tags question: http://stackoverflow.com/q/24975843
tags question: http://stackoverflow.com/q/25050021
tags question: http://stackoverflow.com/q/25034083
tags question: http://stackoverflow.com/q/25050797
tags question: http://stackoverflow.com/q/24987862
tags question: http://stackoverflow.com/q/24996215
tags question: http://stackoverflow.com/q/25068950
tags question: http://stackoverflow.com/q/25062326
tags question: http://stackoverflow.com/q/24916405
tags question: http://stackoverflow.com/q/24977312
tags question: http://stackoverflow.com/q/25031613
tag name: facebook
tags question: http://stackoverflow.com/q/25009781
tags question: http://stackoverflow.com/q/24958615
tags question: http://stackoverflow.com/q/24937536
tags question: http://stackoverflow.com/q/25008759
tags question: http://stackoverflow.com/q/24932153
tags question: http://stackoverflow.com/q/24933728
tags question: http://stackoverflow.com/q/25041126
tags question: http://stackoverflow.com/q/25025759
tags question: http://stackoverflow.com/q/24952380
tags question: http://stackoverflow.com/q/24967685
tags question: http://stackoverflow.com/q/25067931
tags question: http://stackoverflow.com/q/24930110

http://stackoverflow.com/comment/38762383
has text: Then I would recommend you the web fundamentals on multi device layouts. https://google-developers.appspot.com/web/fundamentals/layouts/ . In your case media queries would be the `right way` to solve the problem.
comment on: http://stackoverflow.com/a/24939628
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25056344
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25057212
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: angularjs
has body: I have a a webpage which has different tabs. The tabs used to be different pages, but now through angularjs they are effectively a 'single-page' with no loading between each clicked tab. So every URL has a '#' marshcentre#/page/77 marshcentre#/news marshcentre#/promotion However, when I select the 'contact us' page I get a URL like this marshcentre/contactus which is fine because it is a form that needs submitting. but once on this page, returning to the other tabs is without the single page effect so links are now like marshcentre/page/77 without the hash. Is there a way to append the hash to links? I am not sure how else to solve this =active_link_to "Overview", centre_path(sensitive_venue), active: :exclusive, class_active: "active", class: "inner_container" here is an example link. Thanks
has title: interpolating a '#' in a rails url
type: UnansweredQuestion
upvote count: 1
tagged with: ruby-on-rails

http://stackoverflow.com/a/25068169
answers question: http://stackoverflow.com/q/25068126
upvote count: 8
accepted answer of: http://stackoverflow.com/q/25068126
has comment: http://stackoverflow.com/comment/39002133
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38999442
score: 8
downvote count: 0
has comment: http://stackoverflow.com/comment/38999220
has comment: http://stackoverflow.com/comment/39001774
has comment: http://stackoverflow.com/comment/38999094
has body: Just do (jQuery): var divs = $("div:not([id])"); Or, as nicely pointed out by @PitaJ document.querySelectorAll('div:not([id])')

http://stackoverflow.com/comment/38700212
has text: I'm not sure that link answers my particular question since I'm looking for solution, not necessary with .on('click'), but any solution that will work for me.
comment on: http://stackoverflow.com/q/24909628
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38891329
has text: I did try with a src tag on the script, but it doesn't work. The script loads immediately without a delay. I tried with an empty src="" where the script doesn't load and show and when I try with src="img.js" the script just loads without the delay?
comment on: http://stackoverflow.com/q/25005940
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24996490
possible better answer: http://stackoverflow.com/a/36407315
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/36407315
type: AnsweredQuestion
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24996650
has answer: http://stackoverflow.com/a/58239285
favorite count: 0
has body: 2014-07-28 How do I find the month, year and day with moment.js given the date format above? var check = moment(n.entry.date_entered).format("YYYY/MM/DD"); var month = check.getUTCMonth(); var day = check.entry.date_entered.getUTCDate(); var year = check.entry.date_entered.getUTCFullYear();
answer count: 5
has answer: http://stackoverflow.com/a/37109409
score: 117
has title: How to find the day, month and year with moment.js
tagged with: momentjs
has answer: http://stackoverflow.com/a/24996650
upvote count: 118
has answer: http://stackoverflow.com/a/49935717

android
tags question: http://stackoverflow.com/q/25039515
tags question: http://stackoverflow.com/q/24951734
tags question: http://stackoverflow.com/q/24962162
tags question: http://stackoverflow.com/q/24939991
tags question: http://stackoverflow.com/q/24923288
tags question: http://stackoverflow.com/q/25017226
tags question: http://stackoverflow.com/q/25034279
tags question: http://stackoverflow.com/q/24972542
tags question: http://stackoverflow.com/q/24979324
tags question: http://stackoverflow.com/q/24989926
tags question: http://stackoverflow.com/q/24997102
tags question: http://stackoverflow.com/q/24925251
tags question: http://stackoverflow.com/q/24949967
tags question: http://stackoverflow.com/q/24991983
tags question: http://stackoverflow.com/q/25054542
tags question: http://stackoverflow.com/q/24941184
tags question: http://stackoverflow.com/q/25043558
tags question: http://stackoverflow.com/q/24961650
tags question: http://stackoverflow.com/q/24943312
tags question: http://stackoverflow.com/q/24949013
tags question: http://stackoverflow.com/q/24939613
tags question: http://stackoverflow.com/q/24954516
tags question: http://stackoverflow.com/q/25009759
tags question: http://stackoverflow.com/q/24954973
tags question: http://stackoverflow.com/q/25021360
tags question: http://stackoverflow.com/q/24977781
tags question: http://stackoverflow.com/q/24970931
tags question: http://stackoverflow.com/q/25010008
tags question: http://stackoverflow.com/q/25032734
tags question: http://stackoverflow.com/q/25063206
tags question: http://stackoverflow.com/q/25024045
tags question: http://stackoverflow.com/q/24909611
tags question: http://stackoverflow.com/q/24934280
tags question: http://stackoverflow.com/q/24993288
tags question: http://stackoverflow.com/q/24922317
tags question: http://stackoverflow.com/q/24926221
tags question: http://stackoverflow.com/q/24983108
tags question: http://stackoverflow.com/q/25031240
tags question: http://stackoverflow.com/q/24911008
tags question: http://stackoverflow.com/q/24995571
tags question: http://stackoverflow.com/q/25015714
tags question: http://stackoverflow.com/q/24933111
tags question: http://stackoverflow.com/q/25054316
tags question: http://stackoverflow.com/q/24914256
tags question: http://stackoverflow.com/q/24998374
tags question: http://stackoverflow.com/q/25056183
tags question: http://stackoverflow.com/q/24994824
tags question: http://stackoverflow.com/q/25011611
tags question: http://stackoverflow.com/q/25033852
tags question: http://stackoverflow.com/q/24917405
tags question: http://stackoverflow.com/q/24963302
tags question: http://stackoverflow.com/q/24981032
tags question: http://stackoverflow.com/q/25045484
tags question: http://stackoverflow.com/q/25014009
tag name: android
tags question: http://stackoverflow.com/q/24988020
tags question: http://stackoverflow.com/q/25013099
tags question: http://stackoverflow.com/q/24982853
type: Tag
tags question: http://stackoverflow.com/q/24999310
tags question: http://stackoverflow.com/q/25007365

http://stackoverflow.com/comment/38966463
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25050564
has text: I don't understand. If you CSS rules of the form `.A .C`, they will work the same whether or not `B` is there. Document fragments won't help here because they are by definition not in the DOM. PS. In your question, did you mean to say "sibling nodes C and D"?
score: 0

http://stackoverflow.com/comment/38864823
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24996871
has text: `data = $.parseJSON(data); // <====== Added` are you serious? `for (var i = 0; i < data.length; i++) {` and then `parseJSON` ?
type: Comment

http://stackoverflow.com/comment/38730288
has text: I'm not sure about detecting if installed or not, but in general terms a web app can detect the 'User Agent' to determine what platform it's running on. For example, if you are using jQuery, you can call this API http://api.jquery.com/jquery.browser/
comment on: http://stackoverflow.com/q/24925251
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25062592
has body: I'm currently using a Flexigrid and I would like to recover the column number and also the row number of the selected cell. I managed to recover the content of the selected one by adding "process: procMe" in the column model and by writing the following function : function procMe(celDiv, id){ $(celDiv).click(function(){ var content = this.innerHTML; } } But I didn't find yet how to get the column and row numbers. Thanks for any help !
has title: Get column and row number of the selected cell of a Flexigrid
type: Question
score: 0
tagged with: flexigrid
answer count: 1
has answer: http://stackoverflow.com/a/25075381
tagged with: javascript
type: UnansweredQuestion

http://stackoverflow.com/comment/38965844
comment on: http://stackoverflow.com/a/25050597
type: AnswerComment
has text: @user3593878 yes, if you are starting the index from 1 instead of 0... can you use [console logging](https://developers.google.com/chrome-developer-tools/docs/console) to see the values in the array... see the console log in http://jsfiddle.net/arunpjohny/2y773/1/
score: 0
type: Comment

http://stackoverflow.com/comment/38831911
has text: @techfoobar: Problem there is precision errors can still interfere.
score: 0
comment on: http://stackoverflow.com/q/24979513
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38896256
type: AnswerComment
type: Comment
has text: Yup, tickPostioner is not enough. I need to change axis scaling.
comment on: http://stackoverflow.com/a/24993864
score: 0

http://stackoverflow.com/a/24995686
upvote count: 1
type: Answer
has comment: http://stackoverflow.com/comment/38863345
has comment: http://stackoverflow.com/comment/38864233
downvote count: 0
has comment: http://stackoverflow.com/comment/38864484
has comment: http://stackoverflow.com/comment/38868889
has comment: http://stackoverflow.com/comment/38861946
has comment: http://stackoverflow.com/comment/38864814
has comment: http://stackoverflow.com/comment/38864341
score: 1
accepted answer of: http://stackoverflow.com/q/24992802
has body: I do something similar to this, and I think the best place to do it is in the adapter, so you only have to do it once. I'll give my example using the RESTAdapter because it's most common, but it'll likely work with any adapter. App.ApplicationAdapter = DS.RESTAdapter.extend({ ajaxOptions: function(url, type, hash) { var options = this._super(url, type, hash); options.headers = options.headers || {}; // I don't know what `pusher` is, but you can always inject it into your adapter options.headers.socketId = this.pusher.get('socketId'); return options; } }); Now, every API request will include the socketId header. EDIT: To inject the pusher: Ember.Application.initializer({ name: 'injectPusherIntoStore', after: 'pusherConnected', initialize: function(container, application) { application.inject('adapter', 'pusher', 'pusher:main'); } });
answers question: http://stackoverflow.com/q/24992802
has comment: http://stackoverflow.com/comment/38864554
type: AcceptedAnswer

http://stackoverflow.com/comment/38905375
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25016021
has text: hey thanks for the comments. I managed to get this corrected though. It was nothing todo with the maths it was all down to the lines array and SegandSubSegCount. Basically I was trying to draw more lines than i needed
type: Comment

http://stackoverflow.com/a/24911187
has body: A couple things to change here: You'd want an object with each choice as a key, and each price as a value - not an array Call your function onchange and pass in the select element via this //Make veggy an object var veggy = {}; veggy["Tomatoes"] = 5.99; veggy["Lettuce"] = 7.66; veggy["Potato"] = 4.52; veggy["Carrots"] = 2.13; veggy["Artichoke"] = 10.58; Change your select onChange: &lt;select onChange="getPrice(this);"&gt; And your function: function getPrice(select) { document.getElementById("price").value = veggy[select.value]; }
score: 1
has comment: http://stackoverflow.com/comment/38703310
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24911103
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24911103
type: Answer
downvote count: 0
has comment: http://stackoverflow.com/comment/38703117
has comment: http://stackoverflow.com/comment/38703166

http://stackoverflow.com/a/24961186
accepted answer of: http://stackoverflow.com/q/24960564
answers question: http://stackoverflow.com/q/24960564
type: Answer
score: 1
has body: use the following code jQuery.fn.center = function () { this.css("position","absolute"); this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px"); this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px"); return this; }
upvote count: 1
downvote count: 0
type: AcceptedAnswer

http://stackoverflow.com/a/25038894
answers question: http://stackoverflow.com/q/25038054
has body: I have crafted a fiddle for you below just click this link. &lt;div class="article"&gt; &lt;input size="1" class="quantity" value="1" /&gt; &lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt; &lt;input type="hidden" name="cmd" value="_xclick" /&gt; &lt;input type="hidden" name="business" value="myemail..." /&gt; &lt;input type="hidden" name="item_name" value="'.$item.'" /&gt; &lt;input type="hidden" name="quantity" value="1" /&gt; &lt;input type="hidden" name="amount" value="'.$price.'" /&gt; &lt;/form&gt; &lt;/div&gt; $(document).ready(function () { $(".quantity").change(function() { console.log($(this).next().find("input[name='item_name']").val()); //$(this).siblings('form input[name="quantity"]').val($(this).val()); }); });
score: 0
type: Answer

http://stackoverflow.com/q/24927369
has body: Here's my conundrum: My website uses PJAX to load HTML into the '#main' container for each page. Each page has its own specific javascript file. E.g: 'dashboard.index.js', 'inbox.index.js' and so on. Note: All libraries are preloaded on the first load of the page through PreloadJS to avoid javascript compilation overhead. The first load of the page is perfect, no worries, since it is a normal HTML load. However if i come back to this page again, PJAX won't reload the javascript file, given it's already in the DOM. What i tried so far &amp; didn't work perfectly: Place javascript file at the bottom of 'main' container. PJAX transfers it to the 'HEAD' of the DOM and won't load it the second time around. Place in-line scripts in the 'main' container to execute functions of each page. Fails since the code is executed before JS libraries are loaded. Bind 'PJAX success' event and execute function. Unable to determine which function to execute based on current loaded page. Hence, my question: Is there any strategy to load specific javascript files associated to each page?
score: 2
type: AnsweredQuestion
upvote count: 2
type: Question
has comment: http://stackoverflow.com/comment/38734243
tagged with: dom
has title: Execute page-specific javascript code after PJAX success
answer count: 1
tagged with: pjax
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24990201
favorite count: 0
accepted answer: http://stackoverflow.com/a/24990201
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25027647
has title: IE and html5 videos just stop working
score: 1
linked to: http://stackoverflow.com/q/16079275
upvote count: 1
accepted answer: http://stackoverflow.com/a/25071189
type: Question
tagged with: internet-explorer
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I am using jQuery to hide and show a complex page. Within that page are numerous video tags. Eventually in IE11 the videos just stop serving. Response code 200 typically, though 206 has been seen often on some. html: &lt;video id="m1-video" class="m1-video story-video active"&gt; &lt;source src="http://www.somesite.com/videos/m1.webm" type='video/webm;codecs="vp8, vorbis"'/&gt; &lt;source src="http://www.somesite.com/videos/m1.mp4?v=1234" type='video/mp4;codecs="avc1.42E01E, mp4a.40.2"' /&gt; &lt;/video&gt; Each video will have an event listener on it, like this: ('#m1-video').get(0).addEventListener('ended', closeM1, false); And they are typically triggered in a series of callbacks like so: $('#cruise').animate({opacity:1, width: $(window).width(), height:$(window).height()}, 1000, function(){ try { $('#m1-video').get(0).currentTime = 0; } catch(error) { if (error.code === 11) { //do something or nothing. I dont care } } $('#cruise-info').animate({left:0}, 500, function(){ $('#cruise-info-1 h2').css({top:'50%', opacity:0}).animate({top:'45%', opacity:1}, 1200, 'linear', function(){ $('#m1-video').fadeIn(500, function(){ $('#m1-video').get(0).play(); }); }); }); }); htaccess has the video lines in it: AddType video/mp4 .mp4 .m4v AddType video/webm .webm The code is pretty basic. on callback of some routine, find the video and trigger .play() this works in all browsers, and it even works in IE, except that after a while, like 30 page loads, it stops serving videos and gives me a blank screen. Normal conditions calling something like document.getElementById('m1-video').error returns null. But when it starts acting up document.getElementById('m1-video').error.code returns 4 - which suggests improper encoding. Except that it worked fine for several dozen loads and that same identical encoding profile works for basically every site we build (h264 standard mp4 encoding). Sometimes I can clear browser cache, and close the browser and reopen it, and I will get one video tha…
favorite count: 0
has answer: http://stackoverflow.com/a/25071189
tagged with: http://stackoverflow.com/tag/html
tagged with: video
type: AnsweredQuestion

http://stackoverflow.com/q/25041616
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/25041688
has answer: http://stackoverflow.com/a/25041684
possible better answer: http://stackoverflow.com/a/25041692
answer count: 4
upvote count: 3
has title: How can I target and disable the nth LI in a UL list?
accepted answer: http://stackoverflow.com/a/25041688
type: AnsweredQuestion
score: 3
tagged with: javascript
has answer: http://stackoverflow.com/a/25041697
type: Question
has body: I need your help, How would I go about targeting and applying a disabled prop on the Nth LI in a UL list using jQuery? For example, if I were to select the 3rd LI in my UL and apply a disabled prop to it: Apples Oranges Pears Bananas
has answer: http://stackoverflow.com/a/25041692
downvote count: 0

http://stackoverflow.com/q/24940517
score: 1
type: Question
downvote count: 0
tagged with: javascript
tagged with: appsdk2
has title: Rally custom data store will not update
answer count: 1
tagged with: rally
favorite count: 0
has answer: http://stackoverflow.com/a/24942611
has body: My Rally custom data store will not update. Im having the problem described in [this][1] post. My scenario is: I will be adding rows to a grid, which has a custom data store. then I sort a grid column, and all the new rows I added get deleted. There is nothing fancy about my custom store, and I've tried autoSync:true, but that does nothing. Are custom stores Read-only, in the sense that any changes made to the original data are transient and will get deleted with a reload()? This is my store that I add to the rallygrid me.customStore = Ext.create('Rally.data.custom.Store', { data: customData, listeners:{ load: function(customStore){ //do some stuff } } });
type: UnansweredQuestion
upvote count: 1

http://stackoverflow.com/comment/38893146
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25011909
has text: @Ranjith http://pastebin.com/2tpAsV0g it really is basic PHP coding.

http://stackoverflow.com/q/25038054
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25038894
score: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/25039112
tagged with: php
tagged with: paypal
has body: I've seen an example that does this but I get "undefined" every time I try to access the values. I want the user to be able to enter an amount and then set that amount within the input value. The HTML looks like this: echo '&lt;div class="article"&gt; &lt;input size="1" class="quantity" value="1"/&gt; &lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt; &lt;input type="hidden" name="cmd" value="_xclick"&gt; &lt;input type="hidden" name="business" value="myemail..."&gt; &lt;input type="hidden" name="item_name" value="'.$item.'"&gt; &lt;input type="hidden" name="quantity" value="1"&gt; &lt;input type="hidden" name="amount" value="'.$price.'"&gt; //so on... &lt;/form&gt; &lt;/div&gt;'; There are several item on the page, each in a div class article. With jQuery I'm trying to do this: $(document).ready(function () { $(".quantity").change(function() { alert($(this).siblings('form input[name="item_name"]').val()); //$(this).siblings('form input[name="quantity"]').val($(this).val()); }); }); I keep getting "undefined"...when I tested another input field within the article div, I could get the val() and change it. What am I doing wrong here? SOLUTION: This Post helped me...had to get rid of JS, unhide the inputs and just let the user fill out the form.
linked to: http://stackoverflow.com/q/9389552
has title: Change PayPal button amount input value to user's selection
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25039112
type: Question
answer count: 2
has answer: http://stackoverflow.com/a/25038894

http://stackoverflow.com/q/24946176
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/24952044
tagged with: rest
has title: Bulk REST API POST Processing
has answer: http://stackoverflow.com/a/24946536
favorite count: 0
tagged with: php
tagged with: node.js
type: AnsweredQuestion
score: 3
upvote count: 3
has body: I'm migrating 40,000 records from one system to another, and the only way to import data into the receiving system is via rest API POST calls. I'm looking for advice on the fastest approach to iterate through 40,000 REST API calls. I have the data I need to transfer formatted as JSON, and I've chunked the objects into 40+ .json files using PHP. Ideally I'd like to handle the POST's asynchronously if possible, any advice on approaches using PHP, JavaScript, Node.js or bash would be tremendously helpful.
accepted answer: http://stackoverflow.com/a/24946536
has comment: http://stackoverflow.com/comment/38769714
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/24952044

http://stackoverflow.com/q/24986627
tagged with: http://stackoverflow.com/tag/json
type: Question
tagged with: mongodb
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24986817
has comment: http://stackoverflow.com/comment/38846821
has body: Thanks to embedded documents, we don't need join operations. However, I need to get all fields in a same level to prepare a list or report. Are there any easy-way to get all fields in a same level? For instance; I want to prepare a report with all the following fields. In this case, I need to get all JSON data in a same level. { "_id": "1", "date" : "2014-07-30 02:00", "personnel" : { "_id": "14", "name": "xxxx Stackton", "address" : { "city": "nevercity", "province": "neverland" } }, "customer": { "_id": "473", "name": "xxxx Jordan" }, "payment": { "method": "cash", "amount": "67.40" } }
score: 0
has title: How to get all fields in a same level in embedded documents in MongoDB
has comment: http://stackoverflow.com/comment/38875544
accepted answer: http://stackoverflow.com/a/24986817
type: AnsweredQuestion

http://stackoverflow.com/q/25029500
has body: $.each(data[i].replies, function(m, n) { var currentdate = new Date(); console.log(n.entry.date_entered); check = moment(n.entry.date_entered, 'YYYY/MM/DD'); check1 = moment(currentdate, 'YYYY/MM/DD'); console.log(check); console.log(check1); var month = check.format('M'); var day = check.format('DD'); var year = check.format('YYYY'); var month1 = check1.format('M'); var day1 = check1.format('DD'); var year1 = check1.format('YYYY'); get = moment([year, month, day]); get1 = moment([year1, month1, day1]); g = get1.from(get); }); Sample n.entry.date_entered : 2014-07-28 12:23:43 For all the dates i am getting a few seconds ago don't know why
has comment: http://stackoverflow.com/comment/38926087
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38926380
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38926645
favorite count: 0
has title: Time from X not working as expected moment.js
has answer: http://stackoverflow.com/a/25029805
type: Question
score: 1
tagged with: momentjs
has comment: http://stackoverflow.com/comment/38926493
upvote count: 1
answer count: 1

http://stackoverflow.com/q/25062531
type: AnsweredQuestion
has body: I have a project that requires me to add drop-down navigation. I am using GUMBY and have added the drop-downs. The problem I am having is as you rollover each main navigation link- the sub-links drop-down but once you mouse over the sub-links - the main navigation color switches back. I've tried to stylize a mouse out event but that doesn't work. How can I keep the main nav link the same color when you mouseover the sub-links? http://ffresearch.com/who-we-are-dropdown.html .row > ul" href="#"> Our Difference Who We Are Our Mission Our Leadership What We Do Overview Unique Research Services Our Capabilities Experience Qualitative Quantitative Support Services Connect Tips and Tools ProTalk™ Best Practice Tips
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/25062756
accepted answer: http://stackoverflow.com/a/25062756
tagged with: css
tagged with: gumby-framework
has title: Navigation roll-over needs to be same color when going down to sublinks

http://stackoverflow.com/q/24948356
has body: I am currently working on a new project which required a slider. I have implemented slick JS for one of my project. Now I need to add thumbnails which will appear when we hover the dots which will link to the slider For example, click on first thumb and slider will advance to first slide,....click on third and slides to third slide. HTML My Now Amazing Webpage
has comment: http://stackoverflow.com/comment/38774703
has answer: http://stackoverflow.com/a/70446704
score: 16
type: Question
tagged with: javascript
answer count: 2
has comment: http://stackoverflow.com/comment/38774284
has answer: http://stackoverflow.com/a/25107816
downvote count: 0
has title: how to add thumbnails to dots of slick slider mentioning the current slide
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
upvote count: 16

http://stackoverflow.com/a/25067246
score: 2
answers question: http://stackoverflow.com/q/25066815
upvote count: 2
accepted answer of: http://stackoverflow.com/q/25066815
type: AcceptedAnswer
downvote count: 0
type: Answer
has body: So I figured out my error in thinking, and wrote a simple example below explaining my confusion: hope this helps others! function Class () { // this: an object with a prototype of Class, if 'new'ed, window otherwise var that = this; function privateMethod () { // this: a reference to window. privateMethod still belongs to Class' closure var dat = this; // that: an object with a prototype of Class, if 'new'ed, window otherwise var dis = that; } } I replaced my reference to this with my afore-defined var Drawing = this; (A lot of people use the form var that = this) and the reference is there, despite it not being available to the inline console command line. Appreciate the thought provoking convo that lead to the answer! I believe again.

http://stackoverflow.com/q/24986746
has body: I have a component that I want to trigger a route level action on so I can transition to a different route. App = Ember.Application.create(); App.Router.map(function() { }); App.IndexRoute = Ember.Route.extend({ actions: { complete: function() { // This never happens :( console.log('Triggered complete!'); } } }); App.MyAreaComponent = Ember.Component.extend({ actions: { clickMyButton: function() { console.log('Triggering complete action.'); // Attempting to trigger App.IndexRoute.actions.complete here this.sendAction('complete'); } } }); What I am trying to accomplish is when MyAreaComponent's 'clickMyButton' action is triggered, it will trigger the IndexRoute's 'complete' action. I have set up a jsbin to demonstrate my issue: http://emberjs.jsbin.com/wivuyike/1/edit According to the EmberJs documentation on action bubbling: If the controller does not implement a method with the same name as the action in its actions object, the action will be sent to the router, where the currently active leaf route will be given a chance to handle the action. So with this in mind I would expect the component to say "Let's check my controller and see if it has an action called 'complete'. No? Ok, let's check my route (IndexRoute) to see if it has an action called 'complete'. Yes? Ok, trigger it!" The only thing I can think of is that because of the way the component is set up, IndexRoute isn't set as the route of the component, so the action bubbling just stops at the controller. I'm unsure where to go from here. Do I need to do something special to make my component aware of my IndexRoute?
accepted answer: http://stackoverflow.com/a/24987241
has title: Trigger route action from component
answer count: 3
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24987241
tagged with: ember.js
score: 8
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/74718645
downvote count: 0
has answer: http://stackoverflow.com/a/24986809
has answer: http://stackoverflow.com/a/74718645
upvote count: 8
type: Question

http://stackoverflow.com/comment/38769408
type: QuestionComment
comment on: http://stackoverflow.com/q/24945276
score: 0
has text: @Kousha it doesn't work. If I change this.autoRefreshInSec to autoRefreshInSec, it says "autoRefreshInSec" is not defined. As I said, "this" is working everywhere except inside onTimeout callback.
type: Comment

http://stackoverflow.com/comment/38891192
type: Comment
comment on: http://stackoverflow.com/a/25011037
score: 0
type: AnswerComment
has text: Yup, no need to overcomplicate things, you're welcome.

http://stackoverflow.com/comment/38754090
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24936873
has text: Yes. Actually I am very new to AJAX and Javascript. I am not sure how to get 10 articles in a single call and then set them in HTML. Any help would be appreciated.
score: 0

http://stackoverflow.com/comment/38710565
type: Comment
type: QuestionComment
score: 1
has text: Then if it's a demo, have one account and tell all users what it is?!
comment on: http://stackoverflow.com/q/24914868

http://stackoverflow.com/a/25025789
has comment: http://stackoverflow.com/comment/38919276
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38919335
has body: Timeouts don't execute until after your main function has finished, this means that by the time your timeout function executes per loop, your i variable will be at its final value (in this case = 0). Your function declaration is also incorrect as the timeout function does not pass in those parameters for you. To do this, you need to wrap your timeout inside of another function call that takes in the parameters for the current loop, try something like this instead... for (var i=array.length-1; i&gt;=0;i--) { function(array, i) { setTimeout(function() { document.getElementById('Result').innerHTML += Math.floor(array[i]); }, (i+1) * 3000); }(array, i); }
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/25025668
has comment: http://stackoverflow.com/comment/38919275
has comment: http://stackoverflow.com/comment/38919343

http://stackoverflow.com/q/25034661
has body: I have a td in a table. There are multiple rows of data coming from database and every row has a unique id. When i click on the td a dialog box opens which have multiple checkboxes. When i select these values of checkboxex and hit submit these are to be shown in td without page refresh. What i am trying to do is find that td and set the text to it on submit. But my page contains lots of functionality and there are lots of div in it, it is very hard to find its location via finding parent child etc. Is there any way so that i can directly find that td with its unique id of row. Below is my code:
has answer: http://stackoverflow.com/a/25066095
accepted answer: http://stackoverflow.com/a/25066095
possible better answer: http://stackoverflow.com/a/25034749
type: AnsweredQuestion
has title: How to find a td of a table in div to set text in td from checkboxes which is in another nested div ?
has answer: http://stackoverflow.com/a/25034773
type: Question
has comment: http://stackoverflow.com/comment/38935182
tagged with: javascript
has answer: http://stackoverflow.com/a/25034749
score: 0
answer count: 3
upvote count: 1
downvote count: 1
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/24962197
downvote count: 1
type: Answer
upvote count: 0
answers question: http://stackoverflow.com/q/24962080
score: -1
has body: While I cannot offer a proof, JS has no distinction between an integer and a float. The only difference between parseFloat and parseInt is how they interpret things like decimal points. If the input string is a valid integer in regular notation, though (as the first assertion asserts), they will always result in the same numeric value, which in JS means they are the same type as well.

http://stackoverflow.com/q/25061430
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/25063228
has title: How do I display the Y axis on top of the X?
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38988842
type: Question
has comment: http://stackoverflow.com/comment/38987513
has answer: http://stackoverflow.com/a/25063520
accepted answer: http://stackoverflow.com/a/25063228
has body: I am making a application that will show the results of a case study in a tornado chart. In the tornado chart I want to show all of the positive results (display in green) on the top of all the negative results (display in red) instead of the negative and positive results being on the same level. Here is my jsfiddle example. I figured out by the highcharts documentation that I can change the colors by doing: Highcharts.setOptions({ colors: ['#FF0000', '#00FF00'] }); I have not been able to find anything on how to show the Y axis over top of the X. EDITED Here is an example of what I want to accomplish
tagged with: highcharts
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25063520

http://stackoverflow.com/a/25003385
score: 2
upvote count: 2
has body: In the second loop is an error: for (var j = 0; j &lt; row.cells.length; j++){ "j &lt;" was missing. the same problem was in the answer of Gavin: here the edit fiddle: http://jsfiddle.net/h693g/2/
downvote count: 0
answers question: http://stackoverflow.com/q/25003156
type: Answer

http://stackoverflow.com/comment/38762739
score: 0
type: QuestionComment
has text: Can you please explain a little better what you mean? Do you want the image to move with the page as you scroll? Do you want it to stay in one exact spot even if you scroll? Or do you want something different? Also, could you share your HTML and a bit more CSS?
comment on: http://stackoverflow.com/q/24942509
type: Comment

http://stackoverflow.com/comment/38847644
comment on: http://stackoverflow.com/q/24987856
has text: You could bind them with data attribute.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38848976
has text: The "detect if values are the same" feature of JavaScript is called the equality operator or `===`.
score: 0
comment on: http://stackoverflow.com/q/24988544
type: QuestionComment
type: Comment

http://stackoverflow.com/a/25024916
has body: You could try using an ordinal x axis instead of a linear one. The default behavior for ordinal bar charts is to click to select/deselect bars instead of range selection. That's chart.x(d3.scale.ordinal()).xUnits(dc.units.ordinal). If you are using dc 1.7.1 of earlier, you may have to specify the domain by d3.scale.ordinal().domain([’Monday',...])
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25018365
answers question: http://stackoverflow.com/q/25018365
type: Answer
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38969397
has comment: http://stackoverflow.com/comment/50952709
has comment: http://stackoverflow.com/comment/50790238

html5-canvas
tags question: http://stackoverflow.com/q/25036169
tags question: http://stackoverflow.com/q/24994228
tags question: http://stackoverflow.com/q/24977996
tags question: http://stackoverflow.com/q/24969315
tags question: http://stackoverflow.com/q/24950216
tags question: http://stackoverflow.com/q/24910141
tags question: http://stackoverflow.com/q/24958294
tags question: http://stackoverflow.com/q/24926862
tags question: http://stackoverflow.com/q/24919680
tags question: http://stackoverflow.com/q/24996772
tags question: http://stackoverflow.com/q/25016244
tags question: http://stackoverflow.com/q/24911988
tags question: http://stackoverflow.com/q/24982782
tags question: http://stackoverflow.com/q/25035738
tags question: http://stackoverflow.com/q/24998317
tags question: http://stackoverflow.com/q/25022302
tags question: http://stackoverflow.com/q/24942851
tags question: http://stackoverflow.com/q/24977575
tag name: html5-canvas
tags question: http://stackoverflow.com/q/25006310
tags question: http://stackoverflow.com/q/25062629
tags question: http://stackoverflow.com/q/24952361
type: Tag
tags question: http://stackoverflow.com/q/24918712
tags question: http://stackoverflow.com/q/24966393
tags question: http://stackoverflow.com/q/25051336
tags question: http://stackoverflow.com/q/25041559
tags question: http://stackoverflow.com/q/25031955

http://stackoverflow.com/comment/38848997
has text: @KateTheGreat I'm not sure that you can specify the fonts of ` ` elements individually like that...would something like this be useful? - [jsFiddle Demo](http://jsfiddle.net/MTtjL/1/)
type: AnswerComment
comment on: http://stackoverflow.com/a/24988499
score: 0
type: Comment

http://stackoverflow.com/a/24953053
has body: use this : $(".iframe").colorbox({iframe:true, innerWidth: 570, innerHeight: 300, scrolling: true, overlayClose: false});
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24952966
downvote count: 0
has comment: http://stackoverflow.com/comment/38783142
accepted answer of: http://stackoverflow.com/q/24952966
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/a/24922278
has comment: http://stackoverflow.com/comment/38725220
accepted answer of: http://stackoverflow.com/q/24922206
answers question: http://stackoverflow.com/q/24922206
has comment: http://stackoverflow.com/comment/38725501
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38725005
upvote count: 2
has body: You might want to put a second argument in your function like this: JavaScript: function chbg(color, id) { document.getElementById(id).style.backgroundColor = color; } HTML: (Repeat the div's) This will change b element
type: Answer
score: 2
has comment: http://stackoverflow.com/comment/38724916

http://stackoverflow.com/comment/38851354
type: QuestionComment
has text: Is there an event that fires after you move some around?
comment on: http://stackoverflow.com/q/24989909
score: 0
type: Comment

http://stackoverflow.com/q/25015240
score: 0
has answer: http://stackoverflow.com/a/25016009
accepted answer: http://stackoverflow.com/a/25016009
tagged with: http://stackoverflow.com/tag/html
has title: Canvas animation frame rendering: Infinite Loop vs. triggering on mousemover()
tagged with: animation
has body: Ok, this is very theoretical question: I am coding an animation with the HTML5 canvas element. The animation is dependent on the mouse moving (when mouse rests = no animation). For the rendering, I see the following options: Option 1: A loop that keeps constantly redrawing the canvas (wether the mouse is moving or not) Option 2:Triggering the draw function through the mousemove() event (using jQuery) I tend to favor option 2, because the rendering is only proccessed when needed. But I am worried about about one thing: If the mouse moves too fast (and especially on slower machines), the iterations might overlap and mess up the canvas (see my illustration below). So I thought about a workaround: Option 3: Using option 2, but checking on each trigger if there is already a draw iteration being currently executed. If yes, the trigger is ignored. But I can see a few problems here too: As in my illustration, the last frame of a mouse move might be left out (because it overlaps a previous call). Plus, the constant checking might dicrease performance (which is not needed in option 1). So which one of the options is the best? Does anybody have some experience on this? Link to the illustration (can't post images yet): https://i.sstatic.net/WHLDQ.png
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25015326
type: Question
answer count: 2
possible better answer: http://stackoverflow.com/a/25015326
tagged with: javascript

http://stackoverflow.com/comment/38750264
score: 0
comment on: http://stackoverflow.com/a/24936046
type: AnswerComment
type: Comment
has text: So when I use bind(this) then it finds the context of the model and shadow the property which is inside the model and uses the new one. Am I right ?

http://stackoverflow.com/q/24924669
score: 0
answer count: 2
tagged with: submit
tagged with: jquery
tagged with: ajax
has answer: http://stackoverflow.com/a/24924785
has title: How to update variable on button press?
has body: I have here some JavaScript with jQuery and AJAX. On the click of a button, the user should be served with an image of a die that corresponds with a random number from 1 to 6. What's happening here is that the result is being calculated only once (at page load) and does not update whenever I click the button, which is why I'm getting the same roll result every time. How can I achieve the result I desire? $(document).ready(function () { $('.roll').click(function(e){ e.preventDefault(); $.ajax({ type: 'POST', url: '/rolls', data: result, success: function() { $('h1').replaceWith(' Rolled '); $('#die').replaceWith(image) } }) }); result = Math.floor(Math.random() * 6) + 1; image = " "; });
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24924740
tagged with: javascript
tagged with: forms
type: Question

http://stackoverflow.com/a/25011289
score: 0
type: Answer
has body: From your question I presume you are using FA or another icon set, and want to change the class, so a CSS solution wouldn't really help. Unfortunately as Events aren't available with Slidebars yet, I would take control of the API, so you can execute extra code when you want. First of all, you'll need to define your own instance of Slidebars when initiating the plugin. var yourVariable = new $.slidebars() You now dont have to use the standard control classes and can map the Slidebars controls to your own elements. HTML &lt;div class="fixed sb-slide"&gt; &lt;i id="menu-toggle" class="icon"&gt;&lt;/i&gt; &lt;/div&gt; JS var yourVariable = new $.slidebars( { siteClose: false }); // Cache toggle. var toggle = $( '#menu-toggle' ); toggle.on( 'click', function( event ) { // Stop event propagation and behaviour. event.stopPropagation(); event.preventDefault(); // Toggle the left Slidebar yourVariable.slidebars.toggle( 'left' ); // Change icon classes toggle.toggleClass( 'your-open-class your-close-class' ); } ); $( '#sb-site' ).on( 'click', function( event ) { // Stop event propagation and behaviour. event.stopPropagation(); event.preventDefault(); // Make sure left Slidebar is open, close it and change icons. if ( yourVariable.slidebars.active('left') ) { yourVariable.slidebars.close(); toggle.addClass( 'your-close-class' ).removeClass( 'your-open-class' ); } } ); I have also set this up in a fiddle, so you can see it working. http://jsfiddle.net/2mX79/2/ I hope this helps. Thanks, Adam
answers question: http://stackoverflow.com/q/24942058

http://stackoverflow.com/comment/38750592
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24936307
has text: I think this is exact duplicate of a post you linked. No matter how many times I read this. Is it just me?
type: QuestionComment

http://stackoverflow.com/comment/38836213
type: Comment
score: 0
has text: I am getting the impression this is not faulty code, but a browser issue. look like I need a way of making sure the page is loaded properly as subsequent loads just dont seem to fire any jquery as its not 'loading' the page, its just pulling up a cached version. Sure its (hopefully) a common issue
comment on: http://stackoverflow.com/q/24981946
type: QuestionComment

http://stackoverflow.com/q/25010236
accepted answer: http://stackoverflow.com/a/25200175
type: AnsweredQuestion
score: 1
favorite count: 0
type: Question
answer count: 1
has title: jquery validation for select box onchange
has answer: http://stackoverflow.com/a/25200175
has body: i design show/hide div select box using select2 and validate using jquery validation plugin. this worked but when i select empty value(select a color) validation show success (green color) but if i click submit button i see red color. JS: $(document).ready(function () { $(".lstColors").change(function () { $('div.box').hide(); $('div.box.' + $(this).val()).show(); }).change(); $('form').validate({ rules: { firstname: { minlength: 3, maxlength: 15, required: true }, lastname: { minlength: 3, maxlength: 15, required: true } }, highlight: function (element, errorClass, validClass) { if (element.type === "radio") { this.findByName(element.name).addClass(errorClass).removeClass(validClass); } else { $(element).closest('.form-group').removeClass('has-success has-feedback').addClass('has-error has-feedback'); $(element).closest('.form-group').find('i.fa').remove(); $(element).closest('.form-group').append('') } }, unhighlight: function (element, errorClass, validClass) { if (element.type === "radio") { this.findByName(element.name).removeClass(errorClass).addClass(validClass); } else { $(element).closest('.form-group').removeClass('has-error has-feedback').addClass('has-success has-feedback'); $(element).closest('.form-group').find('i.fa').remove(); $(element).closest('.form-group').append(''); } }, errorElement: 'span', errorClass: 'help-block', errorPlacement: function (error, element) { if (element.parent('.input-group').length) { error.insertAfter(element.parent()); } else { error.insertAfter(element); } } }); $('form').on('submit', function () { $(this).addClass('submitted'); }); $("#lstColors").select2({ placeholder: "Select a Color", triggerChange: true, allowClear: true, width: "200px" }).on('change', function () { if ($('form').hasClass('submitted')) $('form').valid(); }); }); HTML: Nome: Favorite Colors: Red Green Blue test You have selected green option so i am here You have selected blue option so i am here Submit Now, i need to show red color after choose empt…
upvote count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
tagged with: jquery-validate

http://stackoverflow.com/comment/38935807
type: Comment
comment on: http://stackoverflow.com/a/25031013
type: AnswerComment
has text: @chiapa i already look into your question and i am working on that.
score: 0

http://stackoverflow.com/comment/38988842
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25061430
score: 0
has text: @wergeld I added a photo for you

http://stackoverflow.com/comment/38903620
comment on: http://stackoverflow.com/a/25016322
has text: alternatively, add `$` at the beginning, to be sure that DOM is ready.
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/a/24960636
score: 0
accepted answer of: http://stackoverflow.com/q/24959867
type: AcceptedAnswer
type: Answer
has comment: http://stackoverflow.com/comment/38797089
has body: First, when you create your text element, give it a class or id so you can easily select it later. Lets say you give it .attr('class', 'bodyText'). Then you can get its length using SVGTextContentElement.getComputedTextLength() You can get this value for your text node by using selection.node() to grab the actual text element from a d3 selection, and then calling the method on the node. Like this: var textLength = d3.select('.bodyText').node().getComputedTextLength(); Then you can use this value when setting your width property.
answers question: http://stackoverflow.com/q/24959867

http://stackoverflow.com/a/24989578
downvote count: 1
answers question: http://stackoverflow.com/q/24988672
score: -1
upvote count: 0
type: Answer
has body: You can create script tag programatically and append in the head tag after page is loaded. Following is the code and DEMO var iframe = document.createElement('iframe'); var html = '&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div class="eccolo"&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;'; document.body.appendChild(iframe); iframe.contentWindow.document.open(); iframe.contentWindow.document.write(html); var script1 = iframe.contentWindow.document.createElement('script'); var script2 = iframe.contentWindow.document.createElement('script'); script2.textContent = '$(window).load(function(){function popo1(){alert("ciaoooo!");}popo1();$(".eccolo").html("&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;xD sygsyusgsuygsus ysg usygsuys");});' var head = iframe.contentWindow.document.querySelector('head'); head.appendChild(script1); script1.onload = function() { head.appendChild(script2); } script1.src = 'http://code.jquery.com/jquery-1.11.0.js'; iframe.contentWindow.document.close(); Hope it helps...

http://stackoverflow.com/q/24924209
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24937077
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24937077
has title: Difficult in debugging Google Drive App
upvote count: 1
type: Question
score: 1
has body: I am build programs by Google Script, and can use its debugger well. Now, I am building my 1st Google Drive App. The normal operation flow is: User select files in Google Drive and then call my App => Selected files are passed to my App as State Parameter => doGet() to create/open Client's HTML => User select options in that HTML and submit => Server receive the submitted form and do somethings. However, debugging Drive App for me is difficult than normal Web Apps and Container-bounded Apps, due to its "State Parameter". I need to publish the Drive App first, and then debug Client's HTML &amp; JScript by Javascript console and Server's GScript by Google Script Editor separately. Is it normal for Web programming? Or have I missed anything? Can I simulate the "State Parameter" for testing, so that I don't need to debug AFTER publish (even using test link) ? N.B. Since above flow is clear enough, I haven't post demo code here.
tagged with: google-apps-script

http://stackoverflow.com/a/24950243
answers question: http://stackoverflow.com/q/24949967
type: Answer
accepted answer of: http://stackoverflow.com/q/24949967
upvote count: 2
has body: In your javascript, document.getElementsByClassName() and document.getElementsByTagName() both return arrays of DOM elements (notice the 's's before "By".) This is different from getElementById(), which returns an element directly, which makes sense since IDs are unique across a valid HTML document, but tags and classes are not. Access the first element from each array and the javascript works: body[0].innerHTML = form[0].innerHTML;
score: 2
type: AcceptedAnswer
downvote count: 0

http://stackoverflow.com/a/25018242
has comment: http://stackoverflow.com/comment/38907218
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/90708975
upvote count: 2
type: Answer
has comment: http://stackoverflow.com/comment/38906668
answers question: http://stackoverflow.com/q/25016622
has body: Just postprocess the HTML using the answer from the other question: http://jsfiddle.net/zbcBq/ document.getElementById('hiThere').addEventListener('click',function () { document.getElementById('myText').style.color = '#ff0000'; var markup = document.body.innerHTML.trim(); markup = markup.replace(/rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)/, rgb2hex); console.log(markup); });

http://stackoverflow.com/comment/38807904
score: 0
has text: Sorry I'm sorta new to JS, haven't done too much with arrays. So just store the entries in an array and take iterations and put them in the boxes, and repeat?
comment on: http://stackoverflow.com/q/24966742
type: Comment
type: QuestionComment

xlink
type: Tag
tags question: http://stackoverflow.com/q/24973856
tag name: xlink
tags question: http://stackoverflow.com/q/24997889

http://stackoverflow.com/q/24911646
score: 0
tagged with: shiny
has answer: http://stackoverflow.com/a/24913820
type: UnansweredQuestion
has title: Google Vis and shiny loading charts
type: Question
has body: I have made a page in shiny that has a side and main panel. The side panel lets you chose the dataset and the main panel has some text on top and then a googlevis chart followed by some text at the bottom. Every time the dataset is changed and the chart reloads, it dissapears for a bit while its loading making the text at the bottom move up the page until the chart finally displays again. Then the text moves back to the bottom. My question is, is there a way to have a placeholder while the chart is loading so you dont get that ugly text moving while the chart loads? Or is there a way to split up the main panel so the chart can reload without bothering the text below?
tagged with: google-visualization
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/r

http://stackoverflow.com/comment/42126172
comment on: http://stackoverflow.com/a/25290917
has text: @BrianLeathem: each file from the glob pattern will be a separate main entry file for browserify, and each entry file will result in separate bundle. If you want to concatenate all of the bundle outputs into a single file, you can use [`gulp-concat`](https://github.com/wearefractal/gulp-concat) and add it to the end of your gulp pipeline. That will be the equivalent of running `browserify <options> > single-file.js` in terminal. Let me know if I answered your question. Cheers!
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25007483
has comment: http://stackoverflow.com/comment/38884408
linked to: http://stackoverflow.com/q/5105143
has body: I keep getting the following error Uncaught SyntaxError: Invalid regular expression: /$_POST['/: Unterminated character class I searched a few threads and they all pointed me to the fact the at I am not properly escaping the string. I loaded a php file into a javascript var as a string , then I search through it for the following, but I have tried escaping to no success. according to List of all characters that should be escaped before put in to RegEx? These are all the characters that need escaping I believe. . \ + * ? [ ^ ] $ ( ) { } = ! &lt; &gt; | : - and here are the code snipets that are failing me. (This is the clean code everything needs escaping) var n = data.search("$_POST['"); n = res.search("'];"); n = data.search("//hurdle{"); n = res.search("}"); If someone could show me how to properly do this, it would be very appreciated. Thank you
answer count: 2
accepted answer: http://stackoverflow.com/a/25007507
downvote count: 0
favorite count: 0
tagged with: regex
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25007527
score: 1
has answer: http://stackoverflow.com/a/25007507
upvote count: 1
type: Question
tagged with: escaping
has title: Escaping a Javascript string, Unterminated character class error
possible better answer: http://stackoverflow.com/a/25007527
tagged with: javascript

http://stackoverflow.com/q/24955076
has title: Jsonp and jquery mobile
upvote count: 1
accepted answer: http://stackoverflow.com/a/24958197
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24955152
score: 0
has answer: http://stackoverflow.com/a/24955152
downvote count: 1
type: Question
has body: I have problems making an JSONP with jquery mobile. I can´t received the data. I put the code: Could someone help me? html: Page One When i execute it says [object,Object] could someone help me about it?
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24958197
tagged with: ajax
favorite count: 0

http://stackoverflow.com/comment/38767593
comment on: http://stackoverflow.com/q/24942969
type: QuestionComment
type: Comment
has text: Why do you pass `data` down your error path?
score: 0

http://stackoverflow.com/a/25047278
accepted answer of: http://stackoverflow.com/q/25047156
answers question: http://stackoverflow.com/q/25047156
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38959876
type: Answer
has body: At the very least, this: row.appendTo('myTable2'); needs to be: row.appendTo('#myTable2'); since you're looking for id=myTable2, not a &lt;myTable2&gt; tag. Though, as noted in Theodore's comment, you really want: $('#myTable2 tbody').append(row);
upvote count: 2
has comment: http://stackoverflow.com/comment/38960147

http://stackoverflow.com/comment/38713478
has text: Unfortunately, that's not what I'm trying to do. I need to change not only the class names present in the DOM, but also the class names that jUI relies on internally. Changing just the class names results in this: http://jsfiddle.net/78GM5/5/ (note that the draggable is broken when you actually click the anchor)
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24916442
type: AnswerComment

http://stackoverflow.com/comment/38911282
type: Comment
has text: Thanks, this solves it for me. I'll accept this when the timer dies out.
comment on: http://stackoverflow.com/a/25021557
type: AnswerComment
score: 0

http://stackoverflow.com/a/24960762
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24960647
type: Answer
has body: $("#identity").click(function(e){ $("#fromfrancetoggle").toggle(); $("#lamiettetoggle").toggle(); $(this).toggleClass('active'); e.preventDefault(); });

http://stackoverflow.com/comment/38798021
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24961343
type: AnswerComment
has text: @RobertRozas It doesn't need to be polished. It's a SO answer. It provides an example of a basic feature of the language similar to what OP was trying to accomplish, not some code that's going to be committed and tested with all edge cases.

http://stackoverflow.com/a/24986135
type: Answer
has comment: http://stackoverflow.com/comment/38844519
has comment: http://stackoverflow.com/comment/38844312
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/24985933
has comment: http://stackoverflow.com/comment/38844731
has comment: http://stackoverflow.com/comment/38845239
has comment: http://stackoverflow.com/comment/38844868
has body: The problem is that your getPuntos() function sets up the promise.done action, but the returned value never gets passed to the rest of your program. As NoxHarmonium said, your getPuntos() method is superfluous and should be combined with _getPuntos(), but you probably want something like the following (as you can see in this jsFiddle): PuntosPromise = function() { this.result = null; this._getPuntos = function() { var deferred = $.Deferred(); setTimeout(function(scope) { scope.result = "It works." deferred.resolve(); }, 500, this); return deferred.promise(); } this.getPuntos = function() { var promise = this._getPuntos(); return promise; } this.getResults = function() { return this.result; }; } $("#tester").click(function() { var test = new PuntosPromise(); $.when(test.getPuntos()).then(function() { alert(test.getResults()); }); }); EDIT: See @Bergi's modifications given below. While this code works, his solution is cleaner.
has comment: http://stackoverflow.com/comment/38845069
has comment: http://stackoverflow.com/comment/38844376
has comment: http://stackoverflow.com/comment/38844437
upvote count: 1

size
type: Tag
tags question: http://stackoverflow.com/q/24931003
tag name: size

http://stackoverflow.com/comment/39034702
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25065548
has text: If you have your data as date-string, why not convert them to timestamps and pass it into the data of the series?

http://stackoverflow.com/comment/38709753
type: AnswerComment
type: Comment
score: 0
comment on: http://stackoverflow.com/a/24913221
has text: Er, what? You want the *server* to find the memory usage of the mobile device? Why would you want/need to do that? You'd have to find the memory usage client-side first and *then* send it to the server. But again, **why?**

http://stackoverflow.com/q/24913940
has comment: http://stackoverflow.com/comment/38708356
has comment: http://stackoverflow.com/comment/38708760
has body: I used the element inspect tool in chrome to inspect the button, the element is start But that "start" is really clickable. Then I open the page source, and search "start", but can't find the "start" word. What's the possible cause that I could find "start" in element inspector, but not in page source? and is there any tool in chrome to know what js function(I guess it called some js function) it called?
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38708666
tagged with: google-chrome
type: Question
has title: how to know what javascript is call when click a button in chrome?
answer count: 1
tagged with: javascript
has comment: http://stackoverflow.com/comment/38708559
has answer: http://stackoverflow.com/a/24914214
score: 0

http://stackoverflow.com/comment/38750466
type: QuestionComment
comment on: http://stackoverflow.com/q/24936280
type: Comment
has text: Is that a accurate copy paste of your Javascript?
score: 0

http://stackoverflow.com/q/24999650
has answer: http://stackoverflow.com/a/24999682
has comment: http://stackoverflow.com/comment/38869806
duplicate of: http://stackoverflow.com/q/5873810
upvote count: 3
downvote count: 1
possible better answer: http://stackoverflow.com/a/24999722
has title: Get very last character of a URL
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24999722
accepted answer: http://stackoverflow.com/a/24999682
type: Question
has answer: http://stackoverflow.com/a/24999721
answer count: 3
tagged with: javascript
tagged with: jquery
favorite count: 0
has body: I have the following URL which I'm fetching: http://domain.com/search/?wpv_paged_preload_reach=1&amp;wpv_view_count=1&amp;wpv_post_id=205499&amp;wpv_post_search=saint%20laurent&amp;wpv_filter_submit&amp;wpv-women-clothing%5B0%5D=all-clothing The following code manages to get the whole URL var url = $(location).attr('href'); My question is, how can I get the last Character of the above URL, so that I can test a condition like this: if (last character in code containers an integer) { do something } Thanks
tagged with: http://stackoverflow.com/tag/html
linked to: http://stackoverflow.com/q/5873810

http://stackoverflow.com/comment/38831492
has text: still mispelled. please dont mark invalid code as an answer.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24979414
type: AnswerComment

http://stackoverflow.com/q/25038225
accepted answer: http://stackoverflow.com/a/25038324
has comment: http://stackoverflow.com/comment/38942028
has comment: http://stackoverflow.com/comment/38942048
has answer: http://stackoverflow.com/a/56783651
has answer: http://stackoverflow.com/a/46883338
upvote count: 18
answer count: 4
favorite count: 0
tagged with: drupal
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38942014
possible better answer: http://stackoverflow.com/a/46883338
has comment: http://stackoverflow.com/comment/38942008
has comment: http://stackoverflow.com/comment/38942040
type: Question
downvote count: 0
score: 18
has body: I tried to use this code below, which adds buttons in slideshow on my site: window.onload = function loadContIcons() { var elem = document.createElement("img"); elem.src = "http://arno.agnian.com/sites/all/themes/agnian/images/up.png"; elem.setAttribute("class", "up_icon"); var id = "views_slideshow_controls_text_next_slideshow-block"; if (id !== 0) { document.getElementById(id).appendChild(elem); } else console.log("aaaaa"); var elem1 = document.createElement("img"); elem1.src = "http://arno.agnian.com/sites/all/themes/agnian/images/down.png"; elem1.setAttribute("class", "down_icon"); var id1 = "views_slideshow_controls_text_previous_slideshow-block"; if (id1 !== 0) { document.getElementById(id1).appendChild(elem1); } else console.log("aaaaa"); } On the front page, where I have slideshow everything works good, but on the other pages the error Cannot read property 'appendChild' of null occurs.
has title: How do I solve this "Cannot read property 'appendChild' of null" error?
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25039652
has answer: http://stackoverflow.com/a/25038324

http://stackoverflow.com/a/24990794
has comment: http://stackoverflow.com/comment/38855530
upvote count: 2
has comment: http://stackoverflow.com/comment/38935720
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38855335
has comment: http://stackoverflow.com/comment/38855674
type: Answer
accepted answer of: http://stackoverflow.com/q/24990118
has comment: http://stackoverflow.com/comment/38855903
has body: The better way to do this is to create a new object for each rectangle. This way you can store each object with its own properties in an array and redraw it in each cycle of your drawloop. You can access all the variables on this object whenever you wish and use it in a much more flexible way. So I would use something like this: function Rectangle(props){ var posX = this.posX = props.x; var posY = this.posY = props.y; this.width = props.width; this.height = props.height; this.fill = props.fill; this.draw = function(){ ctx.fillStyle = this.fill; ctx.fillRect(this.posX, this.posY, this.width, this.height); } } The use of this is demonstrated in this JSFiddle http://jsfiddle.net/hgh2S/ I have left off the drag events and all to make the usecase a bit more clear. You could easily implement it yourself based on this example. Also, note the way I have hooked the button to a listener instead of directly calling JS from your HTML element. This is a much safer way to do this.
downvote count: 0
answers question: http://stackoverflow.com/q/24990118
has comment: http://stackoverflow.com/comment/38855597
has comment: http://stackoverflow.com/comment/38855716
score: 2
has comment: http://stackoverflow.com/comment/38940569
has comment: http://stackoverflow.com/comment/38855350

http://stackoverflow.com/comment/38946417
type: AnswerComment
comment on: http://stackoverflow.com/a/25038181
score: 0
type: Comment
has text: How is the "I can not do it myself, daddy" way to do it?

http://stackoverflow.com/a/24941486
answers question: http://stackoverflow.com/q/24941429
type: Answer
has comment: http://stackoverflow.com/comment/38760622
has comment: http://stackoverflow.com/comment/38760827
has comment: http://stackoverflow.com/comment/38760847
has body: Given support for the dataset property, it’s as easy as: Object.keys(element.dataset).length === 0 That’s not really appropriate, though. data-* attributes aren’t meant to interfere with each other, and they shouldn’t have dynamic names. How about identifying categories in a simpler way? Appstore (Not given support for the dataset property, you can use function hasDataAttributes(element) { for (var i = 0; i < element.attributes.length; i++) { var name = element.attributes[i].name; if (name.substring(0, 5) === 'data-') { return true; } } return false; } .)
score: 0
has comment: http://stackoverflow.com/comment/38760712
upvote count: 1
has comment: http://stackoverflow.com/comment/38760654
downvote count: 1
has comment: http://stackoverflow.com/comment/38760769

http://stackoverflow.com/a/25326595
has comment: http://stackoverflow.com/comment/39566968
answers question: http://stackoverflow.com/q/25009094
score: 0
has body: I have an idea but unproved yet, maybe you can try it. For detail, you only need one template. For master, you need write several named outlet (see: http://emberjs.com/guides/routing/rendering-a-template/) and place each below the corresponding item of master view. When each master item has been clicked, you need pass a param to the detail route in order to let it know what kind of data should be populated. The key part is the renderTemplate hook of route (see: http://emberjs.com/api/classes/Ember.Route.html#method_renderTemplate). You can take advantage of it because it allows you to specify which named outlet should be used to render the template. Or you may load all details' data at once and cache it, then pass an identifier when master item got clicked, in this way you can filter the model in advance and get prepared for later renderTemplate use. This is just an idea and currently don't have spare time to try it, but as your wish, you got the dedicated route, controller and model. I think it is highly doable, let me know it you make any progress.
type: Answer

http://stackoverflow.com/comment/38772886
has text: maybe you need more dropdown or you need only one but change the li elements.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24946707

http://stackoverflow.com/q/25025433
type: UnansweredQuestion
tagged with: google-chrome-extension
has title: Chrome extension reload files when location changes
answer count: 0
upvote count: 1
tagged with: google-chrome
has body: Trying to implement a Chrome extension which embeds right into the page through content_scripts. The challenge I am facing is I am using angularjs with the extension and need to first create the divs and then add the controller names, then initiate the controller function. Eg: var body = document.querySelector('body'); body.setAttribute('ng-controller', 'BodyCtrl'); app.controller('BodyCtrl', function ($scope, $http, PollPage, PageType) { ... }) This works fine on reloading the page and when the site is navigating not through javascript. But some sites use JS to load the dom and change the url to do so, in an angularjs manner which makes it not initial the ... document.querySelector ... code. Trying to find a way to reload the extension, reload the files or reload all these functions upon the url changing. Suggestions? I thought of doing a watch on DOM objects which is ridiculous and inefficient, but I am trying to find other ways to do it. I tried triggering a function that'd do this on location.pathname change: function addContent(){ var body = document.querySelector('body'); body.setAttribute('ng-controller', 'BodyCtrl'); } Which triggers then the page changes due to the JS taking a few ms to change the content in the page.
type: Question
has comment: http://stackoverflow.com/comment/46841534
tagged with: javascript
has comment: http://stackoverflow.com/comment/38944131
downvote count: 0
score: 1
tagged with: jquery
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/38986707
type: Comment
type: QuestionComment
has text: any reason for using javascript links? but from the sounds of things you have some sort of js error occurring when you are dragging / dropping which then stops all following js functions working (including the js links), check your console for an error
comment on: http://stackoverflow.com/q/25061698
score: 0

http://stackoverflow.com/comment/38710955
type: QuestionComment
comment on: http://stackoverflow.com/q/24914868
score: 2
has text: "Come on down and spin the wheel of logins! **Win *every* time!!**" This is a serious security breach waiting to happen. For the love of your data's security PLEASE consider re-structuring your processes.
type: Comment

http://stackoverflow.com/q/24916229
has title: display a new content in the jquery fancybox
tagged with: http://stackoverflow.com/tag/html
tagged with: fancybox
has answer: http://stackoverflow.com/a/31000047
tagged with: popup
has comment: http://stackoverflow.com/comment/38713118
type: Question
has comment: http://stackoverflow.com/comment/38713004
tagged with: javascript
has comment: http://stackoverflow.com/comment/38726944
score: 0
answer count: 1
tagged with: jquery
has body: I have a jQuery fancybox popup that works just fine. Let's say the popup contains a link show another content of this fancybox When you click on that link, the fancybox popup disappears, the whole browser displays http://example.com/foo/bar.html page (makes sense). This solution doesn't work either: You are clicking on the link in the fancybox to apply a new content to this fancybox Any suggestions how to replace the old content with a new content in the same fancybox popup? Thank you. Just added: Seems like I'm on the half of the way with using: $(".fancybox-inner").load("http://example.com/foo/bar.html"); Am I on the right track or it might be done in a better way? Thank you.
type: UnansweredQuestion

http://stackoverflow.com/comment/38713376
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24916342
type: Comment
has text: Added Javascript code

http://stackoverflow.com/q/25011079
tagged with: regex
tagged with: node.js
has body: How to delete all symbols except cyrillic/latin alphabet from string? str = 'детёныш test test ()&amp;^*' console.log(str.replace(/[^а-яА-Яa-zA-Z]/gi," ")) result: дет ныш test test Problem : lost symbol 'ё' in standart а-я range (абвгдеёжзийклмнопрстуфхцчшщъыьэюя)
has answer: http://stackoverflow.com/a/25011386
accepted answer: http://stackoverflow.com/a/25011386
has comment: http://stackoverflow.com/comment/38891127
score: 1
upvote count: 1
type: AnsweredQuestion
type: Question
has comment: http://stackoverflow.com/comment/38891195
linked to: http://stackoverflow.com/q/16418222
answer count: 1
downvote count: 0
tagged with: javascript
favorite count: 0
has title: How to delete all symbols except cyrillic/latin alphabet from string?

http://stackoverflow.com/comment/38710043
has text: Might be helpful: http://stackoverflow.com/a/7898520/602554
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24914513

http://stackoverflow.com/comment/38993705
has text: Instead of using /:id use something like /<something>/:id. And from front end you should use /<something>/232332332. You will ofcourse generate that number dynamically. Unfortunately, I don't know anything about jade.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25052268
score: 1

http://stackoverflow.com/comment/44574957
type: Comment
score: 1
has text: Thanks, but I don't think you understood the question. I'm trying to *trigger* the drag event, not attach a handler to it. In other words, I'm trying to simulate the user starting to drag the element.
type: AnswerComment
comment on: http://stackoverflow.com/a/28066094

http://stackoverflow.com/q/24937060
type: UnansweredQuestion
has title: Where is the bing maps 6.2 documentation?
type: Question
tagged with: javascript
tagged with: bing-maps
score: 0
has body: I am trying to upgrade a piece of code from version 6.2 of Bing maps to version 7.0. I am having trouble because certain methods don't seem to match up between the VEMap class and the Microsoft.Maps.Map class. I have found the documentation for version 7.0 at this link http://msdn.microsoft.com/en-us/library/gg427610.aspx. This is great, and has been a big help. The problem is, I can't seem to find any documentation for version 6.2. I found this link http://msdn.microsoft.com/en-us/library/bb429637.aspx which seems to be documentation for 6.3, but it isn't as detailed, and doesn't give a full list of methods for the VEMap class. One of my main problems is that in the 6.2 version, this code was called: map.Clear(); map.Find(); I didn't write the code, so I'm not sure what these functions were being used for, but I don't see any similarities in the 7.0 version. I also had a problem with the 7.0 version. After creating the map, I tried calling this function: map.getVersion(); But, it doesn't seem to work, even though it's in the documentation as a method for the map class. Any help on these issues would be helpful, Jeremy
has answer: http://stackoverflow.com/a/24937457
answer count: 1

http://stackoverflow.com/a/25046414
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/39037948
upvote count: 1
type: Answer
accepted answer of: http://stackoverflow.com/q/25042430
answers question: http://stackoverflow.com/q/25042430
has body: You don't need to convert the tree to a store, since there's already a store in it: store: Stores.GroupingTreeStore, // &lt;= here So you can probably just use it in your combo. It will be something like this: Ext.define('My.Combo', { extend: 'Ext.form.field.Combo' ,store: Stores.GroupingTreeStore // the same // Then you also require a displayField, and probably a // valueField for the combo to work ,displayField: '...' ,valueField: '...' // To mimic the behaviour of a raw HTML select... ,editable: false // Plus you've got a whole lot of options to customize // it to your tastes! // ... }); Take care, however, sharing store instances between components like this (and like was previously done in your code) is not a good idea in my opinion (here's why).
score: 1
has comment: http://stackoverflow.com/comment/38959334

http://stackoverflow.com/q/25056507
tagged with: angularjs
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38977130
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38977237
upvote count: 3
has comment: http://stackoverflow.com/comment/38979215
tagged with: http://stackoverflow.com/tag/json
downvote count: 1
type: Question
score: 2
linked to: http://stackoverflow.com/q/25039006
has answer: http://stackoverflow.com/a/25058322
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38977089
duplicate of: http://stackoverflow.com/q/25039006
has comment: http://stackoverflow.com/comment/38979157
answer count: 1
has body: I have a 20mb json file should be exported into excel. When i run the below code in firefox it supports perfectly. but when i run this code, the chrome instantly crashes.. how to solve this problem ?>>>> JSON to CSV Exporter JSON to CSV Exporter Status: {{status}} Click the button below to export JSON to CSV format <!-- button type="button" ng-csv="getArray" filename="test.csv">Click me to export JSON above plugins : ng-CSV
linked to: http://stackoverflow.com/q/13567509
favorite count: 0
linked to: http://stackoverflow.com/q/20756164
has title: Chrome Crashes When I export large amount of json data file (20MB) but it works perfectly in firefox..?

http://stackoverflow.com/a/25061777
answers question: http://stackoverflow.com/q/25061641
upvote count: 1
has body: You should try to put return false; in the else statement. Since it stops the propagation of the event it should do what you want.
type: Answer
downvote count: 0
score: 1

http://stackoverflow.com/q/25009743
score: 1
has comment: http://stackoverflow.com/comment/38889572
has answer: http://stackoverflow.com/a/25009876
has comment: http://stackoverflow.com/comment/38888637
has comment: http://stackoverflow.com/comment/38890038
has comment: http://stackoverflow.com/comment/38889643
answer count: 2
has title: How to create a filter control using jquery?
possible better answer: http://stackoverflow.com/a/25009876
downvote count: 0
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25010542
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: css
accepted answer: http://stackoverflow.com/a/25010542
upvote count: 1
has body: I am trying to create a filter control, however it doesn't work properly yet. All All Admins Clients Agents The css code: .panel-filter-wrapper { display: inline-block; } .panel-filter { display: inline-block; cursor: pointer; position: relative; color: #999; } .panel-filter .panel-selected-filter { padding: 2px 19px 2px 10px; border: 1px solid transparent; position: relative; z-index: 1; } .panel-filter:hover, .panel-filter.active { color: #444; } .panel-filter:hover .panel-selected-filter, .panel-filter.active .panel-selected-filter { border: 1px solid #ccc; background: #fff; } .panel-filter:hover .caret, .panel-filter.active .caret { display: inline-block; } .panel-filter.active .panel-selected-filter { border-bottom-width: 0; } .panel-filter.active ul { display: block; } .panel-filter ul { list-style: none; display: none; position: absolute; border: 1px solid #ccc; top: 24px; left: 0; margin: 0; min-width: 100%; z-index: 0; background: #fff; font-size: 13px; border-radius: 2px; -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); border: 1px solid rgba(0, 0, 0, 0.1); } .panel-filter li { padding: 5px 15px; white-space: nowrap; color: #333; } .panel-filter li:first-child { border-top: none; } .panel-filter li:hover { background-color: #f2f4f8 !important; color: #181a1c; } .panel-filter li.selected { font-weight: bold; } .panel-filter .caret { display: none; position: absolute; right: 5px; top: 9px; } .caret { display: inline-block; width: 0; height: 0; vertical-align: top; border-bottom: 4px solid transparent; border-top: 4px solid transparent; border-right: 4px solid transparent; border-left: 4px solid black; content: ""; } .caret, .caret-down { border-bottom: 4px solid transparent; border-top: 4px solid black; border-right: 4px solid transparent; border-left: 4px solid transparent; } The code example is on JSfiffle. The promlem is that the jquery does not handle the click event and the items list does not display. The cont…
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/25039478
accepted answer: http://stackoverflow.com/a/25039517
type: Question
has comment: http://stackoverflow.com/comment/38944605
downvote count: 0
tagged with: javascript
has body: I'm trying to learn javascript Regex and I've hit a problem. I'm trying to validate with the following rules. Allow only: Numbers 0-9 ( ) + - (space) I have come up with the regex below to handle this: /[0-9\)\(\+\- ]+/i The following matches but shouldn't do because it contains a @ symbol: +0@122 0012 I'm using the below to test: (Returns true) /[0-9\)\(\+\- ]+/i.test("+0@122 0012") Thanks.
has answer: http://stackoverflow.com/a/25039517
answer count: 1
favorite count: 0
score: 6
tagged with: regex
upvote count: 6
has comment: http://stackoverflow.com/comment/38944460
has title: Basic Javascript Regex
type: AnsweredQuestion

http://stackoverflow.com/q/24973965
answer count: 2
has body: I'm trying to send some emails using nodemailer via this snippet of code putted into my server.js server.js var smtpTransport = mailer.createTransport("SMTP", { service: "gmail", auth: { user: "abc@gmail.com", pass: "pass" } }); var mail = { from: "Contact <abc@gmail.com>", to: "abc@gmail.com", Subject: "Test sujet", text: "test text", html: "Test text" } smtpTransport.sendMail(mail, function(err, res){ console.log(err, "Message sent: "); smtpTransport.close(); }) But, when I node that server.js I get this error message: { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } 'Message sent: ' EDIT : Refering to this, I've also tried to check my ssl connection openssl s_client -connect smtp.gmail.com:465 (it's working). How do I please to fix it ?
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38825640
tagged with: nodemailer
has answer: http://stackoverflow.com/a/24977434
has comment: http://stackoverflow.com/comment/38825572
tagged with: node.js
type: AnsweredQuestion
score: 2
upvote count: 2
accepted answer: http://stackoverflow.com/a/24977434
linked to: http://stackoverflow.com/q/14654736
has comment: http://stackoverflow.com/comment/38825704
has title: Sending emails using nodemailer
has comment: http://stackoverflow.com/comment/38826584
type: Question
possible better answer: http://stackoverflow.com/a/25006930
has answer: http://stackoverflow.com/a/25006930
tagged with: javascript
has comment: http://stackoverflow.com/comment/38825540

http://stackoverflow.com/comment/38880811
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24991769
has text: You could at least show the inputs and outputs for which the methods are failing. Realize that of course the more numbers you multiply the more likely you will encounter integer overflow. If your numbers get too large to be exactly representable the math breaks down.
score: 0

http://stackoverflow.com/a/25050404
score: 0
has body: JavaScript statements are executed line by line. However, with effects, the next line of code can be run even though the effect is not finished. This can create errors. For removing those errors we use call back functions Call back function are those function which will be executed when the event fires up.This are used in many javascript function like addEventListener() etc.It is also known as call back pattern. Check this link to understand and learn about it
answers question: http://stackoverflow.com/q/25050267
type: Answer

http://stackoverflow.com/comment/38940004
score: 1
has text: Works just fine for me -> **http://jsfiddle.net/T4nkF/**, but why would you do such a thing? Would you be any chance be using an older version of IE ?
comment on: http://stackoverflow.com/q/25037269
type: Comment
type: QuestionComment

visual-studio-2013
tags question: http://stackoverflow.com/q/24913853
tags question: http://stackoverflow.com/q/24959911
tags question: http://stackoverflow.com/q/24961762
type: Tag
tags question: http://stackoverflow.com/q/25031782
tag name: visual-studio-2013

http://stackoverflow.com/a/24993641
type: Answer
score: 0
has body: Change the push line to selected.push([$(this).val(), $(this).text()]); ...so we have the option value and text held separately, not concatenated as one string. Then, to create the new select (you don't say if you want to create a new one or populate an existing one - I'll assume the latter): var other_sel = $('#other_select').empty(); $.each(selected, function(i, arr) { $('&lt;option /', {value: arr[0], text: arr[1]}).appendTo(other_sel); });
answers question: http://stackoverflow.com/q/24993561

http://stackoverflow.com/comment/38814587
comment on: http://stackoverflow.com/q/24970416
score: 0
type: Comment
type: QuestionComment
has text: Why not use something like Famo.us to handle physics? I believe they only currently support circular collisions, but https://github.com/DrClick/FamousBird uses rectangular collisions. Check out the source, Luke.

http://stackoverflow.com/a/24955524
has comment: http://stackoverflow.com/comment/38786499
type: Answer
has body: please see here jsbin.com/zataro/2/edit?html,output Läghenhetsnr {{summary.abbData.apartment}} Edit Save
has comment: http://stackoverflow.com/comment/38786554
accepted answer of: http://stackoverflow.com/q/24955193
has comment: http://stackoverflow.com/comment/38786460
answers question: http://stackoverflow.com/q/24955193
score: 0
has comment: http://stackoverflow.com/comment/38786780
type: AcceptedAnswer

http://stackoverflow.com/comment/38905453
type: Comment
has text: Ok, check the lat/lon values and ensure they are not strings. If they are wrap them with parseFloat to convert them to numbers. This is a common gotcha where the location value becomes invalid but doesn't throw an error.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25010382

http://stackoverflow.com/comment/38919241
comment on: http://stackoverflow.com/q/25025668
type: Comment
score: 0
type: QuestionComment
has text: In your `setTimeout` code snippet you didn't put in a delay time: `}(array,i), 3000);`

http://stackoverflow.com/comment/38908564
comment on: http://stackoverflow.com/q/25019245
has text: Despite I have no suffix in my Dispatcher, any other petition to the server works in this state, why this dont? Is there any other way to call an URL and send an array without using AJAX?
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38942639
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25038113
has text: you would have an if statement above the other if statements and just assign the div name to a var for example you would then just use the var instead of $('#DA') would become $(mydivvar). You would default the mydivvar like var mydivvar = '#DA'; and in your if statement just over assign it.
type: Comment

http://stackoverflow.com/q/24926405
tagged with: regex
has body: I'm creating a Google Analytics Dashboard. In there is an AJAX function as below. This AJAX function is used to pass the query string to the JSON webservice. function setJsonSer() { $.ajax({ url: "/APIWebService.asmx/AnalyticsDataShowWithPost", type: 'POST', data:{Email:'email@website.com',Password:'password',URL:getVaria()}, success: function (data) { alert("success alert "+'sucess'); var sTitle = $(data).find('string').text(); alert("sTitle Alert "+ sTitle); alert(data); }, error: function (xhr, textStatus, errorThrown) { alert('error in simple method'); alert(textStatus); alert(errorThrown); } }); $.ajax({ url: "/APIWebService.asmx/GetMessage", type: 'POST', data:{Email:'email@website.com',Password:'password',URL:getVaria()}, success: function (data) { //alert('sucess - getMessage'); var sTitle = $(data).find('string').text(); //alert(sTitle); alert(data); }, error: function (xhr, textStatus, errorThrown) { alert('error in simple method'); //alert(textStatus); //alert(errorThrown); } }); } This getVaria() function is an another external JavaScript file &amp; the above code snipet is in the Google Analytics Dashboards UI. I have properly linked both files. So no errors in there. In the setJsonSer() function I have alert the sTitle and I got the output with an error. The error code is 400. Error {"error":{"errors":[{"domain":"global","reason":"invalidParameter","message":"Invalid value ' 20140724 '. Values must match the following regular expression: '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)'","locationType":"parameter","location":"end-date"},{"domain":"global","reason":"invalidParameter","message":"Invalid value ' 20140701 '. Values must match the following regular expression: '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo)'","locationType":"parameter","location":"start-date"}],"code":400,"message":"Invalid value ' 20140724 '. Values must match the following regular expression: '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAg…
favorite count: 0
accepted answer: http://stackoverflow.com/a/24926582
upvote count: 1
has title: Error in Google Analytics AJAX Function On JSON Responce
type: Question
tagged with: google-analytics
type: AnsweredQuestion
score: 1
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/24926582
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/q/25005869
linked to: http://stackoverflow.com/q/16410140
has answer: http://stackoverflow.com/a/25005947
has comment: http://stackoverflow.com/comment/38881827
has comment: http://stackoverflow.com/comment/38881441
tagged with: global-variables
type: Question
has title: why is if(x) not the same as if(window.x)?
has body: Why this: if(x) alert('Available'); gives: ReferenceError: x is not defined while this works: if(window.x) alert('Available'); Isn't saying: var x = ""; equivalent to: x = ""; equivalent to: window.x = ""; as long as outside a function, as the whole code is surrounded with a with(window)? To make it clearer: I do know the difference between global vs member variables, but I want to know why retrieving an undeclared variable gives a ReferenceError like x; while window.x gives undefined? Shouldn't they both give undefined?
duplicate of: http://stackoverflow.com/q/16410140
tagged with: javascript
score: 4
has comment: http://stackoverflow.com/comment/38881463
upvote count: 4
accepted answer: http://stackoverflow.com/a/25005908
answer count: 2
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38881544
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25005908
possible better answer: http://stackoverflow.com/a/25005947

http://stackoverflow.com/comment/38748924
type: AnswerComment
has text: I really appreciate all of the hard work though. Thanks.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24918736

chaining
tags question: http://stackoverflow.com/q/24977141
type: Tag
tags question: http://stackoverflow.com/q/25060621
tag name: chaining

http://stackoverflow.com/comment/39011364
type: AnswerComment
score: 0
type: Comment
has text: i didnt get the reason for the downvote?? whoever downvote's must provide a reason for doing so...
comment on: http://stackoverflow.com/a/25063667

http://stackoverflow.com/a/24934081
has body: Wrote a simple example to demonstrate how you can enable/disable select element based on whether or not your checkbox is checked. html: A B A B javascript: $(function(){ $("input").on('change', function(){ $("select").prop('disabled', $(this).prop('checked')); }); }); DEMO Hope this helps!
score: 0
answers question: http://stackoverflow.com/q/24933912
type: Answer

http://stackoverflow.com/comment/38792502
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24958553
has text: Are you sure you need to bind the event for each iteration of `each`? That looks a little suspect, and is probably what I would tackle.
type: Comment

http://stackoverflow.com/comment/38932001
type: Comment
comment on: http://stackoverflow.com/a/25032234
score: 0
type: AnswerComment
has text: Yes this really doesn't make sense to me? Howcome you are giving the `container` a height of 1000px? What are you exactly trying to do? You want it responsive but then you say it needs to be height of contents?

http://stackoverflow.com/a/24957276
has comment: http://stackoverflow.com/comment/135927265
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24957115
has body: Just use json_decode() method and then you can use it like an array. You can use it like $data = json_decode($your_stringify_json); var_dump($data['grid']);

http://stackoverflow.com/comment/38724258
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24921829
has text: Thanks for your reply, but how would this open up my server to the user/client loading any server files?

http://stackoverflow.com/comment/46441223
comment on: http://stackoverflow.com/q/24965834
score: 0
has text: Hi, I have this version 'kinda working' also, seems that I am struggling on the 5th option. Anyway, I also need to make this work with a form post, i.e. you can come in pre-filtered from a form. Simply put, any help from anyone. Nothing I am doing is working to mimic the on change functionc all.
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/70179578
has text: @GôTô I have yes, to no avail I'm afraid. Could be that I have done something wrong but after a lot of trial and error I've decided to go with internal svg, works like a charm and less hassle, it's for an SPA anyways.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24998433

http://stackoverflow.com/comment/38900808
comment on: http://stackoverflow.com/a/25015862
score: 0
has text: Dunno, who told you that? I do see you are including jquery twice (once from the fullcalendar plugin, once for the bootstrap included version), that could cause problems. I'd move the fullcalendar js to the bottom as well, AFTER the jquery and bootstrap.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38750169
comment on: http://stackoverflow.com/a/24935585
type: Comment
has text: If OP wanted to learn then they would not have asked this question. OP is asking for teh codez. The purpose of the site is not to teach the basics to people who are unable to read the basic tutorials themselves, and has never been. You cannot really help here, because a good answer to this question would be a whole book (and even more, depending on the OP's current knowledge).
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38983739
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25060186
has text: Thank you, will be reading it. Is it possible to write it with plain javascript without making use of those library
score: 0

http://stackoverflow.com/comment/38988030
has text: In my karma config file, I load jQuery as the first file in the "files" section and jQuery works. It loads. But for some reason angular still uses jQuery Lite as the default element wrapper.
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24960459
score: 0

http://stackoverflow.com/comment/38792533
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24958776
has text: Your `success` function, seems wrong to me...
score: 0

http://stackoverflow.com/a/25052277
has body: I was able to recreate your error in jsfiddle by using their underscore library backbone loader. It wasn't an issue with your code. The following fiddle shows your same error: http://jsfiddle.net/32tsA/ While this one works fine: http://jsfiddle.net/BympL/ The issue was with how you had the fiddle set up in my estimation. I did make some minor changes to fix up capitalization and some best practices with Backbone: var Bookmodel = Backbone.Model.extend({ defaults: { name:'temp', auth:'meee', keyword:'nonee' } }); var Booklist = Backbone.Collection.extend({ model: Bookmodel }); var Bookview = Backbone.View.extend({ tagName:'div', className: 'bookContainer', template: _.template( $('#bookTemplate').html()), events:{ 'click .delete':'deleteBook' }, render : function(){ this.$el.html(this.template(this.model.toJSON())); return this; }, deleteBook: function(){ this.model.destroy(); this.remove(); } }); var one=new Bookmodel({name:'ankur 1',auth:'asdf 1',keyword:'asdfkasdf 1'}); var two=new Bookmodel({name:'ankur 2',auth:'asdf 2',keyword:'asdfkasdf 2'}); var bookcoll = [one,two]; var mybooks = new Booklist(bookcoll); var Library = Backbone.View.extend({ render:function(){ this.collection.each(function (item){ var k= new Bookview({model:item}); this.$el.append(k.render().el); },this); }, }); var xyz = new Library({collection: mybooks, el: "#book_list"}); xyz.render(); I named the classes with capital case, removed the initialization of the models from your view (views should be told their models not create their models), and abstracted the el declaration from the Library declaration (so you can reuse the view in a different place).
score: 0
has comment: http://stackoverflow.com/comment/38969747
answers question: http://stackoverflow.com/q/25051640
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38969585
has comment: http://stackoverflow.com/comment/38970155
accepted answer of: http://stackoverflow.com/q/25051640
type: Answer
has comment: http://stackoverflow.com/comment/38969323
has comment: http://stackoverflow.com/comment/38969437
has comment: http://stackoverflow.com/comment/38970337

http://stackoverflow.com/a/24981307
has body: Don't divide by 100 when setting max and min: var max=Math.max.apply(this,v); var min=Math.min.apply(this,v); Output: 84.7560975609757 84.90853658536585 0 79.57317073170726 92.9878048780489 100 75.76219512195132 30.487804878048845 64.32926829268297 88.26219512195112
score: 5
upvote count: 5
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24981197
type: Answer
answers question: http://stackoverflow.com/q/24981197

http://stackoverflow.com/q/24924573
tagged with: javascript
upvote count: 3
has title: Angular: Convert curl to Angular $http POST request
answer count: 1
downvote count: 0
has body: I have this curl line: curl -X POST -H "content-type: application/json" -H "AUTH_TOKEN: vLC4grMuKbtbamJL3L6x" localhost:8080/v1/segments?appkey=c2439fb30a1cad03e9e02bd733ef2ad5 -d '{"segment" : {"segment_name" : "ャロットケーキが好き", "segment_type":"static"}}' Now that curl directly hits the API. I'd like to be able to do a $http POST after the save and redirection back to route 'return region.$save((function() {': 'use strict'; angular.module('otherLevelsApp').controller('GeoRegionCreateCtrl', [ '$scope', '$location', 'GeoRegion', 'Hours', '$http', function($scope, $location, GeoRegion, Hours, $http) { console.log('new region controller'); $scope.app_id = (/apps\/(\d+)/.exec($location.absUrl())[1]); $scope.newGeoRegion = true; $scope.geoRegionId = ''; $scope.hours = Hours; console.log('$scope.hours', $scope.hours); $scope.geoRegion = { app_id: $scope.app_id, geoRegion_id: '', latitude: 37.7879938, longitude: -122.40743739, name: '', address: '', radius: 500, customer_id: $scope.customer_id }; _.delay((function() { return $scope.setupGoogleMap(); }), 500); window.test_scope = $scope; return $scope.updateOrAddGeoRegion = function() { var region; $scope.loading = true; console.log('creating new region with ', $scope); region = new GeoRegion($scope.geoRegion); console.log('region', region); return region.$save((function() { return $location.path("/"); }), function(response) { if (response.data.errors) { $scope.errors = response.data.errors; } else { $scope.errors = { "Error": ["There was a problem connecting with the server. Please try again later."] }; } return $scope.loading = false; }); }; } ]); Do you know how I can format it correctly in a $http POST? In particular, do I need to refactor the success and error into the $http code? Ie. Success redirects to return $location.path("/") or...? I imagine it's something along these lines, but unsure how to finish it off: $http({ method: 'POST', url: '', data: '', headers: {'Content-Type': 'application/JSON'} }); Though I am readi…
favorite count: 0
tagged with: ajax
tagged with: angularjs
type: UnansweredQuestion
tagged with: curl
has answer: http://stackoverflow.com/a/24925114
type: Question
score: 3

http://stackoverflow.com/comment/38830278
has text: @TimPogue Around line 169 - 172 in glminer.js and work-manager.js line 153 - 155 logs the nonce to the console.
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24978688

http://stackoverflow.com/a/24941446
has body: i have created jsfiddle example for you using your code:- $(document).ready(function(){ $(".dropdown_head").on('click',function(){ $(".dropdown").slideToggle("slow"); }); }) you were using . instead of , in this $(".dropdown_head").on('click',function() line. click to see working example:- http://jsfiddle.net/Xuu3K/8/
type: Answer
answers question: http://stackoverflow.com/q/24941323
score: 0

http://stackoverflow.com/comment/38961761
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/25024570
type: Comment
has text: You could check the `scene` option in the three.js exporter. It might break your existing pipeline though

http://stackoverflow.com/q/25067635
score: 0
has comment: http://stackoverflow.com/comment/38998279
answer count: 1
tagged with: javascript
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has comment: http://stackoverflow.com/comment/38998381
has title: Javascript loop refuses to do a function
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38998105
accepted answer: http://stackoverflow.com/a/25067697
has comment: http://stackoverflow.com/comment/38998108
has comment: http://stackoverflow.com/comment/38998191
has comment: http://stackoverflow.com/comment/38998268
has comment: http://stackoverflow.com/comment/38998302
type: Question
has answer: http://stackoverflow.com/a/25067697
has body: My javascript changes the innerHTML, but refuses to add the delay to it. My goal is to make a menu that moves the list items right after each other, but this only works for the first two list items. I used innerHTML so I can see if it touches them. I'm not sure whats not working. I did x[0], x[1].. and so on and it worked. Also another question :D, How can I select all elements with TagName in a certain ID? JS: var x = document.getElementsByTagName("LI"); var delay = 0; for (i=0; i<=x.length; i++){ x[i].style.padding = "0 0 0px 20px"; x[i].style.transition = "1s " + delay +"s !important" x[i].innerHTML = "Changed"; delay += "0.1"; } HTML: HOME ABOUT PHOTOGRAPHY PROJECTS CONTACT `

http://stackoverflow.com/comment/38972372
type: AnswerComment
has text: Thanks Yury. It's working as i expected and yes it is tricky code. By the way i am not a jsp guy and not able to change jsp file so better to do with jquery/javascript.
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25054035

http://stackoverflow.com/a/24932879
score: 3
has body: This code should works: $( "body" ).scroll(function() { $('html, body').animate({ scrollTop: $("#target-element").offset().top }, 1000); });
type: AcceptedAnswer
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24932837
upvote count: 3
accepted answer of: http://stackoverflow.com/q/24932837

http://stackoverflow.com/q/25043630
type: Question
tagged with: overriding
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38952556
tagged with: http-status-codes
type: UnansweredQuestion
tagged with: http-status-code-404
has comment: http://stackoverflow.com/comment/38952679
has body: Any way to replace 404 page via JavaScript? I don't want to have default 500 or 502 page (if server is down) of let's take as an example: shopify or zenddesk (just an example, never tried those companies). Is it possible to do it or I must use their default status pages?
answer count: 0
has title: How to override/replace 404,500,502 http status page via JavaScript

http://stackoverflow.com/a/24990462
has comment: http://stackoverflow.com/comment/38853858
type: Answer
has comment: http://stackoverflow.com/comment/38853623
answers question: http://stackoverflow.com/q/24989909
has body: As commenters have suggested, you need to use localStorage to store and retrieve the state, and save that state after the ss-drop-complete event. Here is the entire JS I used in this updated jsFiddle: $(function () { // retrieve from localStorage if there is a saved state var saved = localStorage.getItem('arrangement'); if (saved) { populateArrangement($('.container').parent(), JSON.parse(saved)); } $(".container").shapeshift({ minColumns: 3 }).on('ss-drop-complete', function () { // get the new arrangement and serialise it to localStorage as a string var rows = getArrangement(); localStorage.setItem('arrangement', JSON.stringify(rows)); }); // return the data needed to reconstruct the collections as an array of arrays function getArrangement() { var rows = []; $('.container').each(function () { var elementsInRow = []; $(this).find('.ss-active-child').each(function () { elementsInRow.push({ value: parseInt($(this).text(), 10), colspan: $(this).data('ss-colspan') || 1 }); }); rows.push(elementsInRow); }); return rows; } // use the arrangement to populate the DOM correctly function populateArrangement(container, newArrangement) { $(container).find('.container').remove(); $.each(newArrangement, function (index, row) { var $container = $('&lt;div class="container"&gt;&lt;/div&gt;'); $container.appendTo(container); $.each(row, function (index, element) { var $div = $('&lt;div&gt;&lt;/div&gt;'); $div.text(element.value); if (element.colspan &gt; 1) $div.attr('data-ss-colspan', element.colspan); $container.append($div); }); }); } });
score: 0
has comment: http://stackoverflow.com/comment/38853954

http://stackoverflow.com/comment/39339871
type: AnswerComment
score: 0
has text: I hate .NET projects that end having many NameOfTheModuleController inside the same folder. Same for views. I try to always use Areas where I can put each controller inside a different folder.
type: Comment
comment on: http://stackoverflow.com/a/25137822

http://stackoverflow.com/q/24990704
has comment: http://stackoverflow.com/comment/38852807
favorite count: 0
has comment: http://stackoverflow.com/comment/38852825
has comment: http://stackoverflow.com/comment/38852711
upvote count: 2
has comment: http://stackoverflow.com/comment/38852740
possible better answer: http://stackoverflow.com/a/24990933
has answer: http://stackoverflow.com/a/24990933
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38852704
has answer: http://stackoverflow.com/a/24990780
linked to: http://stackoverflow.com/q/24955295
has title: jQuery not working outside jsFiddle
downvote count: 2
type: Question
has body: I have another question asked, a user answered it perfectly and his code is exactly what I need, tested and working on jsFiddle. But now as soon as I copy past it all outside jsFiddle it just doesnt work. My jQuery is very poor. jsFiddle: http://jsfiddle.net/C9kF3/ The script is below and also in jsFiddle above: jQuery("a[data-toggle]").on("click", function (e) { e.preventDefault(); // prevent navigating var target = $(this).data('toggle'); $('.people &gt; div').hide(); $('.people ' + target).fadeIn(); }); I copy pasted it exactly as it is in that fiddle, didn't change a thing. No errors showing in console, the script just doesn't work. I linked to latest jquery library: code.jquery.com/jquery.min.js.
has comment: http://stackoverflow.com/comment/38852991
has comment: http://stackoverflow.com/comment/38853128
tagged with: javascript
has comment: http://stackoverflow.com/comment/38852760
has comment: http://stackoverflow.com/comment/38852715
accepted answer: http://stackoverflow.com/a/24990780
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/comment/38896320
score: 0
comment on: http://stackoverflow.com/a/25011821
type: AnswerComment
type: Comment
has text: Did try that and still no success. The js file does not appear in the result window. Here is a simple js file from Dynamicdrive website just a text effect: http://www.dynamicdrive.com/dynamicindex10/topmsg.js when I put this into the code you give on the link, then Update and Run the js does not appear after 6 seconds as it's stated over there?

http://stackoverflow.com/a/24965942
downvote count: 1
has comment: http://stackoverflow.com/comment/38806395
type: Answer
has comment: http://stackoverflow.com/comment/38806543
has comment: http://stackoverflow.com/comment/38806355
has body: Conceptually, this is most easily achieved using nested loops; var a = [[1, 2, 'x'], ['a', 'b'], ['+', '-', 'y', 'z']]; // input array function transform(a) { var i, j, // two loops = two variables to iterate with foundSomething, // a flag so we know to stop b = []; // output array i = 0; do { // loop for i foundSomething = false; b[i] = []; for (j = 0; j &lt; a.length; ++j) { // loop for j if (i in a[j]) { // something exists at this level of i foundSomething = true; b[i].push(a[j][i]); } else { // nothing here b[i].push(''); // insert empty string } } ++i; } while (foundSomething); b.length = b.length - 1; // snip empty end return b; } transform(a); // [[1, "a", "+"], [2, "b", "-"], ["x", "", "y"], ["", "", "z"]] Sorting required? a.sort(function (a, b) {return a.length &lt; b.length;}); // bigger arrays first transform(a); // [["+", 1, "a"], ["-", 2, "b"], ["y", "x", ""], ["z", "", ""]] If you're always doing this sort, you can further optimise transform i.e. because you know that a[x].length &gt;= a[y].length for all x &lt; y, you don't need to flag whether you found something
answers question: http://stackoverflow.com/q/24965829
score: 0
upvote count: 1

http://stackoverflow.com/q/24919397
score: 0
answer count: 2
has body: this is my sample code. I'm tryin to call the method calculateCoordinates(), which is inside a javascript on a .ascx file tried OnClick but it won't work and now i'm trying OnClientClick and is not working either. //button &lt;asp:Button CssClass="button" ID="CalcCoord_Btn" runat="server" Text="Calcular Coordenadas" OnClientClick="javascript: calculateCoordinates();"/&gt; //also tried &lt;asp:Button CssClass="button" ID="CalcCoord_Btn" runat="server" Text="Calcular Coordenadas" OnClientClick="calculateCoordinates();"/&gt; &lt;asp:Button CssClass="button" ID="CalcCoord_Btn" runat="server" Text="Calcular Coordenadas" OnClientClick="javascript: calculateCoordinates(); return false"/&gt; //.ascx javascript &lt;script type="text/javascript"&gt; function calculateCoordinates() { alert("calculateCoordinates"); var AddressLn1 = document.getElementById("AddressLine1"); var AddressLn2 = document.getElementById("AddressLine2"); var State = document.getElementById("State"); var Town = document.getElementById("City"); var Postcode = document.getElementById("ZipCode"); var Country = document.getElementById("State"); var address = AddressLn1.value + ', '; address += AddressLn2.value + ', '; address += Town.value + ', '; address += Postcode.value + ', '; address += Country.value; // Make REST call to get geocoded information (that is, the coordinates for the address) // This will use your call back procedure and return result in JSON format var geocodeRequest = "http://dev.virtualearth.net/REST/v1/Locations?query=" + encodeURI(address) + "&amp;output=json&amp;jsonp=GeocodeCallback&amp;key=" + credentials; CallRestService(geocodeRequest); //return false; } function CallRestService(request) { alert("CallRestService"); var script = document.createElement("script"); script.setAttribute("type", "text/javascript"); script.setAttribute("src", request); document.body.appendChild(script); } function GeocodeCallback(result) { alert("GeocodeCallback"); var Lat = document.getElementById("hdnfl…
has comment: http://stackoverflow.com/comment/38719298
has comment: http://stackoverflow.com/comment/38719717
has comment: http://stackoverflow.com/comment/38719134
has comment: http://stackoverflow.com/comment/38719508
has comment: http://stackoverflow.com/comment/38719474
has comment: http://stackoverflow.com/comment/38719395
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38719355
has answer: http://stackoverflow.com/a/24936734
tagged with: ascx
type: Question
tagged with: c#
has title: Callin ascx.cs function from .ascx
tagged with: javascript
has answer: http://stackoverflow.com/a/24936669
has comment: http://stackoverflow.com/comment/38719537

http://stackoverflow.com/comment/38862350
has text: Are you making call to same site or its a cross site call?
comment on: http://stackoverflow.com/a/24995776
type: Comment
score: 0
type: AnswerComment

http://stackoverflow.com/q/24952450
type: Question
tagged with: javascript
has answer: http://stackoverflow.com/a/24956138
score: 0
has body: Animating canvas (line) up and down based on the variable value. Here I have added variable name position. Default my line will be in bottom of the cylinder. When I enter the value as 20 it has move up and vice verca if I enter the value as 15 it has to come down like that 0 - 100. So what I tried was I created a variable inside a new function call function animatecurve() { var position = 0; alert("position " + position); var bottomcylin = $('#canvas').position().top + $('#canvas').outerHeight(true); alert("cylinder bottom" + bottomcylin); if (position1 &gt; 0) { alert("inside position" + position1); $('#myCanvas').animate({top:"-=10px",}, 300); } else { $('#myCanvas').animate({top:"0px",}, 300); } } Here I have found outerheight of the cylinder. It should not go beyond the cylinder if i enter the value 30 in the position my curve has to move towards top of the cylinder. Fiddle link Please guide me. Regards M
tagged with: canvas
answer count: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24956138
tagged with: css
type: AnsweredQuestion
has title: animate canvas up and down based on cylinder height and variable value which i enter in the code

http://stackoverflow.com/comment/38798852
type: QuestionComment
has text: what do you mean your server code is returning javascript??? and why are you even calling the server just to move an html element??
comment on: http://stackoverflow.com/q/24961968
score: 0
type: Comment

http://stackoverflow.com/a/24994302
score: 1
upvote count: 1
has body: You can use data- prefix. http://jsfiddle.net/37pAZ/1/ $(function(){ alert($('li').attr('data-value')) }) &lt;li data-value="CAD"&gt;&lt;/li&gt;
downvote count: 0
answers question: http://stackoverflow.com/q/24994257
has comment: http://stackoverflow.com/comment/38859313
type: Answer

http://stackoverflow.com/a/34659744
answers question: http://stackoverflow.com/q/25047463
has body: A (in my opinion) nice functional way using underscore.js: var sum = function(t, n) { return t + n; }; _.mapObject( _.groupBy(data, 'platformId'), function(values, platformId) { return { payout: _.reduce(_.pluck(values, 'payout'), sum, 0), numOfPeople: _.reduce(_.pluck(values, 'numOfPeople'), sum, 0) }; } );
has comment: http://stackoverflow.com/comment/126417681
type: Answer
score: 5
upvote count: 5
downvote count: 0

http://stackoverflow.com/comment/38744046
comment on: http://stackoverflow.com/q/24932922
type: QuestionComment
type: Comment
has text: "I can run javascript without it displaying to the end user" - are you *sure*?
score: 0

http://stackoverflow.com/a/24960473
answers question: http://stackoverflow.com/q/24960205
type: Answer
has body: Just an another idea to achive what you want: #{{person.id}} {{person.name}} or if you would like to filter by some default value when the input box is empty: #{{person.id}} {{person.name}}
downvote count: 0
has comment: http://stackoverflow.com/comment/38795925
score: 1
upvote count: 1

http://stackoverflow.com/comment/38838046
type: Comment
comment on: http://stackoverflow.com/a/24982563
has text: @MakisMouzakitis Then your question isn't clear to me. It says: *"When you drag and drop a word near or over another word they become like one draggable".* This is what my example does. So, now you're saying you want to rearrange the words instead of combining them?
score: 0
type: AnswerComment

http://stackoverflow.com/q/24926209
has comment: http://stackoverflow.com/comment/38731736
has comment: http://stackoverflow.com/comment/38731976
has body: I am trying to build a Tree Chart dynamically based on a JSON file. The basic code goes like this : var arrayFinalChartData = [{ "1": "2", "id": "4d344e35-d8b1-49ec-c564-759639816704", "parentid": "rootDiv" }, { "3": "4", "id": "951de378-b191-498e-b31f-7250e6a7ef1f", "parentid": "rootDiv" }, { "OS": "WINDOW", "id": "15d332c3-613d-4aee-8d17-b731c682f242", "parentid": "951de378-b191-498e-b31f-7250e6a7ef1f" }]; $('#loadChart').click(function () { //console.log("arrayFinalChartData:" + (JSON.stringify(arrayFinalChartData)); // build chart $(arrayFinalChartData).each(function (i, obj) { //console.log(arrayFinalChartData[i].id); //console.log(arrayFinalChartData[i].parentid); //Retrieve the innerHTML itemStringDetails = JSON.stringify(obj); var mySubString = ""; for (n = 0; n &lt; 3; n++) { var partString = itemStringDetails.split(',')[n]; console.log("partString :" + partString); if ((partString.indexOf('id', 0) == -1) &amp;&amp; (partString.indexOf('parentid', 0) == -1)) { var mySubString = partString; console.log("mySubString :" + mySubString); }; }; itemHTML = mySubString.replace("{", ''); console.log("itemHTML:" + itemHTML); $('#buildTree').append('div').addClass("newDIV").attr('id', arrayFinalChartData[i].id).html(itemHTML).data("parentid", arrayFinalChartData[i].parentid); //console.log(this.parentid); }); }); The full HTML and JS available at: JS Bin Note: Each div has an ID and ParentID. The hierarchy to follow the ParentID. All Div's must retain the Attributes as in JSON so that when we save, we get the same Json.Please note that "1":"2"..."5":"6" happen to be the innerHTML of the respective Div. The content could be - "OS":"window". "version":"XP" etc...It will be a Chart of the network devices
type: Question
has comment: http://stackoverflow.com/comment/38731782
has comment: http://stackoverflow.com/comment/38731634
has answer: http://stackoverflow.com/a/24927228
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24926492
score: 0
has answer: http://stackoverflow.com/a/24926940
tagged with: element
answer count: 3
has title: Adding DIV dynamically from JSON
type: UnansweredQuestion
tagged with: tree
tagged with: dynamic
has comment: http://stackoverflow.com/comment/38731908

http://stackoverflow.com/q/24963929
tagged with: javascript
has title: sending json obj to polymer element
answer count: 1
downvote count: 0
favorite count: 0
has body: I have no idea why is this happening! i want to send an object to polymer element and then use it. im using something like this for the element this is a post thumb {{post.title}} {{post.body}} and after HTML import, i'm calling it like this: it's weird cause when i use {{post}} it'll bring back the whole {"title":"post title 1","body":"post body"} but when i use {{post.title}} polymer simply returns nothing! what's wrong here!? :/
type: AnsweredQuestion
score: 1
tagged with: http://stackoverflow.com/tag/json
has answer: http://stackoverflow.com/a/24964258
upvote count: 1
type: Question
tagged with: polymer
accepted answer: http://stackoverflow.com/a/24964258

http://stackoverflow.com/q/24991911
type: UnansweredQuestion
has title: Access html elements created by js in other js functions
has body: I am trying to access html elements that I create in one js function in another function. I have this code EDIT after comments: here is a jsfiddle http://jsfiddle.net/8uTxM/ &lt;/button&gt;" +"&lt;button value='1' type='button' class='as' id='c2' onclick='cA(this);'&gt;" in this function function cA (element){ var x = element.value; if (x === allQuestions[questionNumber].correctAnswer) { element.setAttribute.style.backgroundColor = "green"; ++score; } } I am trying to make the button green when it is clicked. However, I get the error: Cannot set property 'backgroundColor' of undefined I assume this has something to do with timing, but I cannot figure out why. Especially since the element.value bit works (the++score works fine, every right question adds +1 to the score variable)
type: Question
linked to: http://stackoverflow.com/q/70579
has answer: http://stackoverflow.com/a/24992070
has comment: http://stackoverflow.com/comment/38855233
answer count: 2
has answer: http://stackoverflow.com/a/24992138
tagged with: javascript
score: 0
has comment: http://stackoverflow.com/comment/38855242
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38856131

http://stackoverflow.com/q/24919781
tagged with: drop-down-menu
has title: Cascading dropdowns: detecting a change made by code
tagged with: jquery
has comment: http://stackoverflow.com/comment/38719923
has comment: http://stackoverflow.com/comment/38719868
tagged with: http://stackoverflow.com/tag/html
has body: While creating cascading dropdowns I ran into a problem. Right now, the first dropdown works: When I select something from the first dropdown the second dropdown changes appropriately. However, I need to trigger another function when the second dropdown changes. I'm able create another .change function that triggers when the user changes the value in the second dropdown. But, the problem is that the change triggered by the user selecting the first dropdown is not detected. In other words, the change made by the code is not detected. How could I detect both types of changes: changes made by code and changes made by a user? Or, how can I get the first item from the second dropdown's list so that I can pass it to the common function shared by both .change functions. Here is the JavaScript function I'm using to detect changes in the first dropdown and populate the second dropdown. $(function () { $('#Country_ID').change(function () { debugger; var id = $("#Country_ID :selected").val(); if (id != "") { $.ajax({ type: "GET", contentType: "application/json; charset=utf-8", url: '@Url.Action("CityList", "DropDown")', data: { "mCountry": id }, dataType: "json", beforeSend: function () { //alert(id); }, success: function (data) { var items = ""; $.each(data, function (i, city) { items += " " + city.Text + " "; }); $('#City_ID').html(items); }, error: function (result) { alert('Service call failed: ' + result.status + ' Type :' + result.statusText); } }); } else { var items = ' Select '; $('#City_ID').html(items); } @*I think I need to get the first value of the second dropdown here. Then, pass the value to a function shared by the second `.change` function*@ }); }); $(function () { $('#Second_Dropdown').change(function () { @*call common function, passing selected value }); }); I'm very new to Javascript so the more detail the better.
accepted answer: http://stackoverflow.com/a/24919940
type: AnsweredQuestion
type: Question
tagged with: asp.net-mvc
has comment: http://stackoverflow.com/comment/38720372
tagged with: javascript
has comment: http://stackoverflow.com/comment/38719924
score: 0
has answer: http://stackoverflow.com/a/24919940
answer count: 1

http://stackoverflow.com/comment/38913856
type: Comment
type: QuestionComment
has text: thanks all for the helpful advice
comment on: http://stackoverflow.com/q/25022497
score: 0

http://stackoverflow.com/a/24929146
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/138575997
accepted answer of: http://stackoverflow.com/q/24928846
answers question: http://stackoverflow.com/q/24928846
upvote count: 159
type: Answer
score: 158
has comment: http://stackoverflow.com/comment/131074237
has comment: http://stackoverflow.com/comment/38742143
downvote count: 1
has comment: http://stackoverflow.com/comment/38738556
has body: You need to use Promises for this. They are available in ES6 but can be polyfilled quite easily: function x() { return new Promise((resolve, reject) =&gt; { setTimeout(() =&gt; { resolve('done!'); }); }); } x().then((done) =&gt; { console.log(done); // --&gt; 'done!' }); With async/await in ES2017 it becomes nicer if inside an async function: async function() { const result = await x(); console.log(result); // --&gt; 'done!'; }

http://stackoverflow.com/q/24911341
favorite count: 0
has answer: http://stackoverflow.com/a/24911620
has title: How can I add an object to an object?
answer count: 4
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38703632
has comment: http://stackoverflow.com/comment/38703268
tagged with: object
score: -5
has comment: http://stackoverflow.com/comment/38703283
has body: var fillets = {}; function fillet_change(thumb, cid, sku, width, selected_matte) { switch(selected_matte) { case "fillet_matte_layer_bottom": moulding_matte_canvas_width[i] = $("#opening_" + i).width(); moulding_matte_canvas_height[i] = $("#opening_" + i).height(); index = 2; break; case "fillet_matte_layer_middle": moulding_matte_canvas_width[i] = $("#opening_" + i).width() + 10; moulding_matte_canvas_height[i] = $("#opening_" + i).height() + 10; index = 1; break; case "fillet_matte_layer_top": if (mattes_default_selected == true) { moulding_matte_canvas_width[i] = $("#opening_" + i).width() + 22; moulding_matte_canvas_height[i] = $("#opening_" + i).height() + 22; } else { moulding_matte_canvas_width[i] = $("#opening_" + i).width(); moulding_matte_canvas_height[i] = $("#opening_" + i).height(); } index = 0; break; } var fillet = { index: index, imgsrc: thumb, width: width, cid: cid, sku: sku }; fillets[index] = fillet; } However I am getting an error : Uncaught TypeError: Cannot set property '2' of undefined So my question is how can I add the fillet object to another object or an array (doesn’t matter)?
downvote count: 5
has comment: http://stackoverflow.com/comment/38703222
has answer: http://stackoverflow.com/a/24911506
has comment: http://stackoverflow.com/comment/38703314
has answer: http://stackoverflow.com/a/24912080
type: Question
has comment: http://stackoverflow.com/comment/38703345
upvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38703249
has answer: http://stackoverflow.com/a/24911876

http://stackoverflow.com/q/25013413
has comment: http://stackoverflow.com/comment/38895671
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38897372
possible better answer: http://stackoverflow.com/a/25013551
type: Question
has comment: http://stackoverflow.com/comment/38895675
answer count: 2
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38905311
has comment: http://stackoverflow.com/comment/38895727
score: 0
tagged with: http://stackoverflow.com/tag/html
has answer: http://stackoverflow.com/a/25013551
has answer: http://stackoverflow.com/a/25013458
has comment: http://stackoverflow.com/comment/38897340
accepted answer: http://stackoverflow.com/a/25013458
has title: Change td class on click with javascript doesn't work
linked to: http://stackoverflow.com/q/9688636
has body: tried to apply this answer to make change the class of the cells in my table on click, yet it doesn't work :( $('td.link').click(function() { $('td.button_active').removeClass('button_active'); $('td.link').addClass('button'); $(this).removeClass('button'); $(this).addClass('button_active') }) My example code in jsfiddle is here.. Could someone take a short look and point what to change? I am trying to make font red and change background image of clicked cell, other cells leaving with (or returning to) grey font and default backround image. Thank you in advance! Valdas
tagged with: css

http://stackoverflow.com/q/24974335
has title: Pseudo elements is to far from my DIV
possible better answer: http://stackoverflow.com/a/24974518
has body: I'm doing cookie bar for website WE USE COOKIES We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we will assume that you are happy to receive all cookies from this website. We use cookies to ensure that we give you the best experience on our website. OKAY GOT IT I've managed how to add icon via CSS lef to the paragraph, however I can't keep it left to cookie-content element. Could someone give me hint what I'm doing wrong? I believe it's easy for skilled CSS guy :) Here is a live example (the (I) circle must be located near to content): http://jsfiddle.net/dpastov/kU9F6/
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24974447
accepted answer: http://stackoverflow.com/a/24974447
type: Question
has answer: http://stackoverflow.com/a/24974518
tagged with: cookies
score: 0
answer count: 2
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38957304
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25045751
has text: Depends what you are doing, if you have a user account system then for each user you can create a session via the node server and when they login you add a flag to the session saying they are logged in. Then on secure endpoints you add middleware which checks that they have a session with the correct flag.
type: Comment

http://stackoverflow.com/a/25032178
has body: The answer is Content Scripts; see the documentation and the architecture overview. There are several ways to inject a content script: you're already using one of them, using chrome.tabs.executeScript. This is called programmatic injection, and allows you to run a content script at arbitrary time. The other way is to register a content script in the manifest file. It will then always* be injected in matching pages. A simple example for your needs: "content_scripts": [ { "matches": ["*://*/*"], "js": ["redder.js"], "run_at": "document_end" } ], where redder.js is: document.body.style.backgroundColor="red"; * Note that it will only be injected if a page is (re)loaded after fully loading the extension. It will not inject into tabs existing at the moment of enabling the extension. In fact, in your particular case you don't even have to use javascript. You can inject CSS instead: "content_scripts": [ { "matches": ["*://*/*"], "css": ["redder.css"], "run_at": "document_end" } ], where redder.css is: body { backgroundColor: red !important; }
score: 2
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25022327
answers question: http://stackoverflow.com/q/25022327
upvote count: 2
type: Answer

http://stackoverflow.com/q/25016118
has title: change elgg php function to javascript function
has body: change elgg_get_friendly_time to javascript I strucked in this $params = array('time' =&gt; $time); and return elgg_echo("friendlytime:justnow"); &lt;?php function elgg_get_friendly_time($time) { // return a time string to short circuit normal time formatting $params = array('time' =&gt; $time); $result = elgg_trigger_plugin_hook('format', 'friendly:time', $params, NULL); if ($result) { return $result; } $diff = time() - (int)$time; $minute = 60; $hour = $minute * 60; $day = $hour * 24; if ($diff &lt; $minute) { return elgg_echo("friendlytime:justnow"); } else if ($diff &lt; $hour) { $diff = round($diff / $minute); if ($diff == 0) { $diff = 1; } if ($diff &gt; 1) { return elgg_echo("friendlytime:minutes", array($diff)); } else { return elgg_echo("friendlytime:minutes:singular", array($diff)); } } else if ($diff &lt; $day) { $diff = round($diff / $hour); if ($diff == 0) { $diff = 1; } if ($diff &gt; 1) { return elgg_echo("friendlytime:hours", array($diff)); } else { return elgg_echo("friendlytime:hours:singular", array($diff)); } } else { $diff = round($diff / $day); if ($diff == 0) { $diff = 1; } if ($diff &gt; 1) { return elgg_echo("friendlytime:days", array(diff)); } else { return elgg_echo("friendlytime:days:singular", array($diff)); } } } ?&gt;
type: Question
has answer: http://stackoverflow.com/a/25016618
tagged with: javascript
has comment: http://stackoverflow.com/comment/38900781
score: 0
tagged with: elgg
tagged with: function
answer count: 1
tagged with: time
type: UnansweredQuestion
tagged with: php

http://stackoverflow.com/q/24948429
has comment: http://stackoverflow.com/comment/38774224
has answer: http://stackoverflow.com/a/24948572
tagged with: css
score: 1
has comment: http://stackoverflow.com/comment/38774289
has comment: http://stackoverflow.com/comment/38773980
type: Question
type: AnsweredQuestion
tagged with: javascript
upvote count: 1
answer count: 1
accepted answer: http://stackoverflow.com/a/24948572
downvote count: 0
has body: This is for switch between grid and list views to display content. How to add fade-in and fade-out transitions or Opacity while switching between grid and list views. Here is Fiddle: http://jsfiddle.net/9B4Lp/3/ (demo, without transition) JS from Fiddle: jQuery(document).ready(function () { var $box=jQuery(".post"), $bar=jQuery("a.bar_view"); $dat=jQuery("a.dat_view"); $dat.click(function () { $box.removeClass("bar"); jQuery(this).addClass("active"); $bar.removeClass("active"); jQuery.cookie("dat_style", 0); return false }); $bar.click(function () { $box.addClass("bar"); jQuery(this).addClass("active"); $dat.removeClass("active"); jQuery.cookie("dat_style", 1); return false }); if(jQuery.cookie("dat_style")==0) { $box.removeClass( "bar"); $dat.addClass("active") } else { $box.addClass("bar"); $bar.addClass("active") } }); I tried: when i add .fadeOut(1000) to here $box.removeClass("bar").fadeOut(1000); And .fadeIn(1000) to here $box.addClass("bar").fadeIn(1000); it's only fade-In the Grid view, then List view invisible while fade-Out. See this Fiddle: http://jsfiddle.net/Qba5n/ (problem demo) Please suggest How to fade-in and fade-out transitions between grid/list while switching? Note: Please don't change HTML, don't provide any other HTML/plugin links. Thanks :)
has comment: http://stackoverflow.com/comment/38774097
has title: How Fade-in and fade-out transitions between grid/list views?
tagged with: jquery
favorite count: 0

http://stackoverflow.com/a/25009058
answers question: http://stackoverflow.com/q/25009023
has comment: http://stackoverflow.com/comment/38888179
has body: You're not concatenating with a String but with an Object. Specifically an HTMLInputElement object. If you want the url from the text input, you need to concatenate with url.value.
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38887709

http://stackoverflow.com/q/24920546
upvote count: 1
tagged with: ruby-on-rails
type: Question
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24943486
score: 1
tagged with: ember-data
answer count: 2
linked to: http://stackoverflow.com/q/22547584
downvote count: 0
tagged with: javascript
tagged with: polymorphism
accepted answer: http://stackoverflow.com/a/24943486
favorite count: 0
tagged with: ember.js
possible better answer: http://stackoverflow.com/a/26433401
has answer: http://stackoverflow.com/a/26433401
has title: Ember create a polymorphic record
has body: I am trying to create a record for a model that has a polymorphic relationship. Here is the model: App.SupportedTransportationMethod = DS.Model.extend({ resource: DS.belongsTo('resource', { polymorphic: true }), transportationMethod: DS.belongsTo('transportationMethod') }); And the model I'm trying to create the record with: App.Contact = DS.Model.extend({ supportedTransportationMethods: DS.hasMany('supportedTransportationMethod', { async: true }), companyName: DS.attr('string') }); And here I am trying to create a record: supportedTransportationMethod = this.store.createRecord('supportedTransportationMethod', { transportationMethod: transportationMethod, resource: contact }); But I get an assertion error: Uncaught Error: Assertion Failed: You can only add a 'resource' record to this relationship I have a jsbin showing this. If you click one of the checkboxes then you'll get the error. I am trying to create the record down in the CheckboxItemController. http://jsbin.com/qebis/6/ Any ideas how I am to accomplish this? I looked at this SO but that doesn't fly well with dynamically creating where you have no idea what the id will be. Nor does pushing feel right. UPDATE: If I use the ember-data prod version, it allows the creation (because the assertion is code is removed from the prod version). So I'm wondering if this is a bug in the assertion code? Ember.assert("You can only add a '" + type + "' record to this relationship", !value || value instanceof typeClass); It does however create it with the type set to the current model type even if it is extending from a base model. Not sure yet if that is a good thing or not... UPDATE 2: Here is another jsbin to show the effects of the previous update. http://jsbin.com/qebis/7/edit

http://stackoverflow.com/q/24943482
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38776955
tagged with: google-maps-api-3
has body: I am trying to find nearby places and calculate the distance from current place to the nearby places and then i want to display all the places in a table sorted increasing order of distance from current place .Right now i have succeeded in Find Nearby places Find Distance from current place to each nearby place Display each such place and distance in the order as it is received as response from google I have added the data as json array and added it to console I want to sort this array display the sorted array instead of the direct result as in step3.Can anyone please help me with it??? DEMO JQuery Code for calculating distance and append to table with id Display function createMarker(obj) { // prepare new Marker object var mark = new google.maps.Marker({ position: obj.geometry.location, map: map, title: obj.name }); alert(obj.name); var lat=document.getElementById('lat').value; var long=document.getElementById('lng').value; // alert(lat); //alert(long); var p1 = new google.maps.LatLng(lat,long); var p2 = new google.maps.LatLng(obj.geometry.location.lat(),obj.geometry.location.lng()); google.maps.LatLng.prototype.distanceFrom = function(latlng) { var lat = [this.lat(), latlng.lat()] var lng = [this.lng(), latlng.lng()] var R = 6378137; var dLat = (lat[1]-lat[0]) * Math.PI / 180; var dLng = (lng[1]-lng[0]) * Math.PI / 180; var a = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos(lat[0] * Math.PI / 180 ) * Math.cos(lat[1] * Math.PI / 180 ) * Math.sin(dLng/2) * Math.sin(dLng/2); var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a)); var d = R * c; return Math.round(d); } // var loc1 = new GLatLng(lat, long); //var loc2 = new GLatLng(obj.geometry.location.lat(), obj.geometry.location.lng()); var dist = p2.distanceFrom(p1); //alert(dist/1000+'m'); var distn=dist/1000; var dost=distn+(distn &lt;1 ? "m" : "km") $('#Display').append('&lt;tr&gt;&lt;td&gt;'+obj.name+'&lt;/td&gt;&lt;td&gt;'+dost+'&lt;/td&gt;&lt;/tr&gt;'); datas.push({ app:obj.name,message:distn}); //alert(google.…
answer count: 1
downvote count: 0
has comment: http://stackoverflow.com/comment/38773780
has comment: http://stackoverflow.com/comment/38773870
favorite count: 0
has comment: http://stackoverflow.com/comment/38774247
tagged with: google-places-api
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38773469
has answer: http://stackoverflow.com/a/24955826
has title: Google place Api find nearby place with distance between current place and nearby place with sorting
score: 1
tagged with: http://stackoverflow.com/tag/json
upvote count: 1
type: Question

http://stackoverflow.com/comment/38845391
comment on: http://stackoverflow.com/a/24924155
has text: Updatred answer to add `.calledWIth()` and `.calledWithMatch()`
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38752981
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24936242
has text: I have example 0 (my initial code) at the very top of the question - it is exactly the same as example 1 (the one you reference as the first "working" example), but has 2 points, so I think I compare correctly.
type: Comment

http://stackoverflow.com/comment/38782659
type: Comment
comment on: http://stackoverflow.com/q/24952682
type: QuestionComment
has text: I came here from the learning center as I was having a problem using n-th child. I still cannot get the nth child example to work. But the eq() example is working fine. What is the difference?
score: 0

http://stackoverflow.com/comment/38883583
comment on: http://stackoverflow.com/q/25007026
type: Comment
type: QuestionComment
has text: Upvoted comment for the multiple meanings ]:)
score: 1

http://stackoverflow.com/comment/38987424
type: Comment
has text: In cross domai `jsonp` is used: ``dataType: "jsonp"``
comment on: http://stackoverflow.com/q/25062135
score: 0
type: QuestionComment

http://stackoverflow.com/a/24968487
type: Answer
has comment: http://stackoverflow.com/comment/38967258
has comment: http://stackoverflow.com/comment/38966515
has comment: http://stackoverflow.com/comment/38929604
has comment: http://stackoverflow.com/comment/38929773
has body: What you need is to assign in Smarty selected page. For example: $smarty-&gt;assign('selected_page', 'tour/category.php?id=4'); In PHP you could use for this $_SERVER['REQUEST_URI'] variable, probably something like this: $smarty-&gt;assign('selected_page', substr($_SERVER['REQUEST_URI'],1)); should work fine. And then in Smarty: &lt;div id='cssmenu'&gt; &lt;ul&gt; &lt;li {if $selected_page eq 'tour/'}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/'&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'tour/category.php?id='}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/category.php?id=4'&gt;&lt;span&gt;Photos&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'tour/category.php?id=5'}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/category.php?id=5'&gt;&lt;span&gt;Videos&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'tour/category.php?id=59'}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/category.php?id=59'&gt;&lt;span&gt;Webcam&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'tour/category.php?id=58'}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/category.php?id=58'&gt;&lt;span&gt;Archives&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'tour/pages.php?id=donate'}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/pages.php?id=donate'&gt;&lt;span&gt;Donate&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'tour/pages.php?id=join'}class='active'{/if}&gt;&lt;a href='http://www.example.com/tour/pages.php?id=join'&gt;&lt;span style="color:#EF355C; font-size:20px"&gt;JOIN NOW&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;li {if $selected_page eq 'members/'}class='active'{/if}&gt;&lt;a href='http://www.example.com/members/'&gt;&lt;span style="font-size:18px"&gt;Member Login&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;img src="/tour/images/locky.png"height="22px" width="22px"&gt;&lt;/span&gt;&lt;/a&g…
score: 0
answers question: http://stackoverflow.com/q/24963506
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24963506

http://stackoverflow.com/q/25040861
has body: I want to load "more posts" dynamicly when user scrolls down the page to the last post. - this part is already done... Thing is user can of course scroll back and forth, or just scroll again and again... This would cause multiple ajax requests when not needed yet. How do I check if the same ajax call is not already running?
has comment: http://stackoverflow.com/comment/38947284
has comment: http://stackoverflow.com/comment/38947395
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/25041032
has title: Do not send Ajax request until same previous Ajax request is done
type: Question
has comment: http://stackoverflow.com/comment/38947190
score: 0
linked to: http://stackoverflow.com/q/23962117
has answer: http://stackoverflow.com/a/25041032
answer count: 1
has comment: http://stackoverflow.com/comment/38947489
has comment: http://stackoverflow.com/comment/38947219
has comment: http://stackoverflow.com/comment/38947305
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38947646
tagged with: ajax
has comment: http://stackoverflow.com/comment/38947397
has comment: http://stackoverflow.com/comment/38947531
has comment: http://stackoverflow.com/comment/38947421

http://stackoverflow.com/comment/38996578
type: QuestionComment
comment on: http://stackoverflow.com/q/25040792
score: 0
type: Comment
has text: Can you show your entire queries? We need to see what we are up against here

http://stackoverflow.com/comment/39079341
type: Comment
has text: Essentially, I just want to have different images (as in your HTML) to be able to perform this cycle function with different sets of images, all on one page. I have tried using this same script four times over and simply swapping out VCRImage, but they all seem to draw from the last script regardless of the names.
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25006215

http://stackoverflow.com/a/25034119
score: 1
has body: you can use AB['p_r'] = response[0].result; OR AB["p_r"] = response[0].result; OR AB.p_r = response[0].result;
downvote count: 0
answers question: http://stackoverflow.com/q/25033680
type: Answer
upvote count: 1

http://stackoverflow.com/q/25023761
has comment: http://stackoverflow.com/comment/38915667
has answer: http://stackoverflow.com/a/25024060
has title: undefined is not an object windows safari
type: UnansweredQuestion
downvote count: 2
tagged with: safari
has body: I have a div with a class named Playbtn. When I run the page in Safari on Windows I get an error saying btn is undefined (btn is a global variable, if that makes a difference). var btn = document.getElementById('toggle'); ... if (btn.className == 'Playbtn') { btn.className = 'Pausebtn'; } Html &lt;div id="toggle" class="PlayBtn" onclick="PlayPause()"&gt;&lt;/div&gt; The application runs perfectly in all other browser so why is this error happening?
has comment: http://stackoverflow.com/comment/38915986
type: Question
upvote count: 0
score: -2
answer count: 1
has comment: http://stackoverflow.com/comment/38915722
has comment: http://stackoverflow.com/comment/38916378
tagged with: javascript
favorite count: 0

http://stackoverflow.com/q/25054253
score: 4
type: Question
upvote count: 4
answer count: 1
accepted answer: http://stackoverflow.com/a/25070199
downvote count: 0
tagged with: javascript
favorite count: 0
has title: Dojo build css and custom javascript
has answer: http://stackoverflow.com/a/25070199
tagged with: dojo-build
has body: I've set up a single html page that uses three dojo widgets and I'm trying to create a custom build from it using dojo 1.7.5. The build succeeds leaving me with a dojo.js that includes the files I need using this build file: var dependencies = { action: "release", selectorEngine: "acme", stripConsole: "none", cssOptimize: "comments.keepLines", layers: [ { name: "dojo.js", dependencies: [ "dijit.form.ValidationTextBox", "dijit.form.DropDownButton", "dijit.form.Button", "dijit.form.Form", "dijit._base", "dijit._Container", "dijit._HasDropDown", "dijit.form.ComboButton", "dijit.form.ToggleButton", "dijit.form._ToggleButtonMixin", "dojo.parser", "dojo.date.stamp", "dojo._firebug.firebug" ] }, { name: "../test/test.js", dependencies: [ "test.test" ] } ], prefixes: [ [ "dijit", "../dijit" ], [ "dojox", "../dojox" ], [ "ourpeople", "../ourpeople" ] ] }; The questions I can't seem to find an answer to: I'm using cssOptimize, I was expecting a single css file in which all the used css files were imported. However I can't find such a file. Is this the way dojo compresses it's css or are my expectations wrong? If so where can I find it in my release folder? My test.js contains a function test1() if I call it from my built js it states test1 is not defined. I call that function directly without dojo. I'm assuming that building custom js only works if it is a dojo class using declare? Final question, I needed to include several dojo files in the build manually such as dojo._firebug.firebug since after my initial build it was still using xhr calls to get those files. After including the files manually I still see xhr calls from dojo to specific resources: dojo/nls/dojo_ROOT and dijit/form/nls/validate.js. Those files are created during the build process and therefore can't be included in the dependencies in the build profile. Anyone any thoughts on this matter since I'm looking to distribute dojo in a single file. I'm fairly new to the dojo build system and (especially) so perhap…
tagged with: dojo
type: AnsweredQuestion

http://stackoverflow.com/comment/38901466
score: 0
type: Comment
has text: Ah yes, i'm sorry. Are you still getting errors after you fixed it?
comment on: http://stackoverflow.com/a/25013891
type: AnswerComment

http://stackoverflow.com/comment/38792835
comment on: http://stackoverflow.com/q/24958960
has text: The second one is an object, an array can't have characters as indices, only objects can
score: 4
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24937632
downvote count: 0
answers question: http://stackoverflow.com/q/24926146
type: Answer
score: 1
has body: This is not a firewall issue. I am using linemanjs which is hitting the api via proxy and currently proxy is not supported in node mailer. Nodemailer does not support proxies and currently there is no plan to add any support for these, sorry. Reference - Nodemailer Issue With Proxy As a fix I installed nodemailer module on my clientapp(lineman app) and sending data to another app and receive token on the basis of which I am sending email via nodemailer.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24926146
type: AcceptedAnswer

http://stackoverflow.com/comment/38729611
comment on: http://stackoverflow.com/q/24924859
type: QuestionComment
has text: Thanks for the answer : I have comment all other cases but I show you more things
score: 0
type: Comment

http://stackoverflow.com/comment/38798749
type: Comment
comment on: http://stackoverflow.com/a/24960307
type: AnswerComment
has text: My code is still not working when I run it anywhere besides JS fiddle. So I must have misunderstood what you said was incorrect about my original JQuery script. Are you saying to add "$(document).ready(function(){" as my first line of JS?
score: 0

http://stackoverflow.com/q/24984303
tagged with: javascript
has answer: http://stackoverflow.com/a/25053200
score: 0
has title: how to serve a video using video.js coming from diff domain?
answer count: 1
tagged with: video.js
type: UnansweredQuestion
tagged with: video
has body: I have a site coming x.com and would like to serve a video from b.com using video.js but I keep getting an security box error from browser: access denied is it possible to serve a video from diff domain using video.js ? Thanks for reading, Sean.
type: Question

scope
tags question: http://stackoverflow.com/q/24919154
tags question: http://stackoverflow.com/q/24978505
tags question: http://stackoverflow.com/q/24956979
tags question: http://stackoverflow.com/q/24975899
tag name: scope
tags question: http://stackoverflow.com/q/24924465
tags question: http://stackoverflow.com/q/25061219
tags question: http://stackoverflow.com/q/25024889
type: Tag
tags question: http://stackoverflow.com/q/24965332
tags question: http://stackoverflow.com/q/24966538
tags question: http://stackoverflow.com/q/24967342
tags question: http://stackoverflow.com/q/25059742
tags question: http://stackoverflow.com/q/25049422
tags question: http://stackoverflow.com/q/24911982

http://stackoverflow.com/comment/90734044
type: AnswerComment
score: 0
type: Comment
has text: Don't just post a code snipped. Explain it a bit so it is better to understand.
comment on: http://stackoverflow.com/a/51891073

http://stackoverflow.com/a/24954178
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24954115
has body: call below jquery on page load : $(document).ready(function(){ // do initial check and make show / hide if($('#cbCheckedStatus7').is(':checked')){ // check if checkbox checked $('#spBlueCheckbox').show(); } // add change handler $('#cbCheckedStatus7').on('change', function () { $('#spBlueCheckbox').slideToggle(this.checked); }); });
type: Answer
score: 2
upvote count: 2
accepted answer of: http://stackoverflow.com/q/24954115

remote-debugging
tag name: remote-debugging
type: Tag
tags question: http://stackoverflow.com/q/25035338

http://stackoverflow.com/a/25043302
has comment: http://stackoverflow.com/comment/38964678
has comment: http://stackoverflow.com/comment/38953113
has comment: http://stackoverflow.com/comment/38953350
has comment: http://stackoverflow.com/comment/38952775
has comment: http://stackoverflow.com/comment/38955442
downvote count: 0
has comment: http://stackoverflow.com/comment/38952830
has body: First off: I urge you to stop using jsPDF if it doesn't support Unicode. It's mid 2014, and the lack of support should have meant the death of the project two years ago. But that's just my personal conviction and not part of the answer you're looking for. If jsPDF only supports ANSI (a 255 character block, rather than ASCII's 127 character block), then you can simply do a regex replace for everything above \xFF: "lolテスト".replace(/[\u0100-\uFFFF]/g,''); // gives us "lol" If you only want to get rid of quotation marks (but leave in potentially jsPDF breaking unicode), you can use the pattern for "just quotation marks" based on where they live in the unicode map: string.replace(/[\u2018-\u201F\u275B-\u275E]/g, '') will catch ['‘','’','‚','‛','“','”','„','‟','❛','❜','❝','❞'], although of course what you probably want to do is replace them with the corresponding safe character instead. Good news: just make a replacement array for the list just presented, and work with that. 2017 edit: ES6 introduced a new pattern for unicode strings in the form of the \u{...} pattern, which can do "any number of hexdigits" inside the curly braces, so a full Unicode 9 compatible regexp would now be: // we can't use these in a regexp directly, unfortunately start = `\u{100}`; end = `\u{10FFF0}`; searchPattern = new RegExp(`[${start}-${end}]`,`g`); c = `lolテスト`.replace(searchPattern, ``);
has comment: http://stackoverflow.com/comment/38955322
has comment: http://stackoverflow.com/comment/38953674
type: Answer
score: 11
upvote count: 11
has comment: http://stackoverflow.com/comment/38952958
answers question: http://stackoverflow.com/q/25043024

http://stackoverflow.com/comment/38713644
has text: Seems like a bug to me, I would try to make a issue in a github.
type: QuestionComment
comment on: http://stackoverflow.com/q/24916215
score: 0
type: Comment

http://stackoverflow.com/comment/38799775
type: Comment
comment on: http://stackoverflow.com/q/24962042
type: QuestionComment
has text: i updated the post with the console log. i sort of gutted all the other stuff from the model to figure out this problem first.
score: 0

http://stackoverflow.com/a/25005107
has body: Use HTML5 data attributes. 15 The parameter this that you're passing to the function refers to the button that is being clicked. Then you get the value of the attribute like this: function tip(button){ var tip= button.getAttribute("data-tip"); ... } I leave the rest for you.
type: Answer
answers question: http://stackoverflow.com/q/25004823
upvote count: 5
score: 5
downvote count: 0

http://stackoverflow.com/comment/38960592
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25047685
has text: Not sure what you mean by "link" in your PS..?

http://stackoverflow.com/a/25060879
score: 1
answers question: http://stackoverflow.com/q/25060176
downvote count: 0
has body: I think the problem is that images are loaded after scrollbar is initialized, and scrollbar does not detect container size changes by default. If you read documentation carefully, you can see next: Demo showing how autoReinitialise can also be used so that content with images in it displays correctly in jScrollPane So, try autoReinitialise option. If it won't help - update your question with example of your iframe on jsFiddle.net
type: Answer
has comment: http://stackoverflow.com/comment/38986420
upvote count: 1

http://stackoverflow.com/a/24986040
has comment: http://stackoverflow.com/comment/38844932
has comment: http://stackoverflow.com/comment/38844607
has comment: http://stackoverflow.com/comment/38844646
has body: You can't post to a file path as url, you need to post to a url supported by your localhost server. You can use relative paths like: /check/register_form.php Or full path like : http://localhost/bootSite/check/register_form.php
type: Answer
score: 0
answers question: http://stackoverflow.com/q/24985981
has comment: http://stackoverflow.com/comment/38844711
has comment: http://stackoverflow.com/comment/38844970

http://stackoverflow.com/comment/38968550
has text: Most browsers *start* loading the images in the order they find them. But they are not waiting until the load of the first picture finished but they start the load of the next one. So basically you can say browsers load all images at the same time, because you can't really see that progress of parsing the HTML.
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25051905
score: 2

http://stackoverflow.com/q/24914679
has body: I am trying to call a webmethod I created. The problem I'm having is that the ajax call never calls my webmethod; this is strange to me because I have another webmethod located in the same file with the same return type and parameters that is able to be referenced fine in the "url" definition of the ajax call. My aspx document consists of the following: File name CS.aspx <%@ Page Language="C#" AutoEventWireup="true" CodeFile="CS.aspx.cs" Inherits="_Default" %> Application ID: <asp:TextBox ID="txtUserName" runat="server"></asp:TextBox> Application Name: <asp:TextBox ID="app_name" runat="server"></asp:TextBox> My web method looks like the following with the filename CS.aspx.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Configuration; using System.Data; using System.Web.Script.Serialization; public partial class _Default : System.Web.UI.Page { [System.Web.Services.WebMethod] public static string getAppId(string appName) { return "this is a string"; } } I've put a breakpoint at the return statement, just to make sure that the method is even called, while in debug mode, and have had no luck.
accepted answer: http://stackoverflow.com/a/24915114
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38710308
tagged with: webmethod
type: Question
tagged with: c#
answer count: 2
possible better answer: http://stackoverflow.com/a/24915199
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24915199
tagged with: ajax
score: 0
has answer: http://stackoverflow.com/a/24915114
has comment: http://stackoverflow.com/comment/38710237
has comment: http://stackoverflow.com/comment/38712571
has title: C# Webmethod unable to be called with JQuery AJAX

http://stackoverflow.com/comment/38973740
comment on: http://stackoverflow.com/a/25042165
has text: parse just turns it back to a [object object]
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38949113
type: QuestionComment
comment on: http://stackoverflow.com/q/25041901
has text: Out of curiosity, did you check if the necessary `jQuery` libraries are loaded? If so, is the `tabs` plugin initiated?
score: 0
type: Comment

http://stackoverflow.com/comment/38967820
comment on: http://stackoverflow.com/a/25051240
type: Comment
type: AnswerComment
has text: But confusing to use such a non-idiom. I changed it to the normal syntax in my answer.
score: 0

http://stackoverflow.com/a/24993594
type: Answer
has body: Would something like this be of use? A GIF player in JavaScript
answers question: http://stackoverflow.com/q/24993547
has comment: http://stackoverflow.com/comment/38861683
score: 0
has comment: http://stackoverflow.com/comment/38858817

http://stackoverflow.com/q/24960936
linked to: http://stackoverflow.com/q/1732348
score: 0
answer count: 3
has body: So I have a badly formatted div with a bunch of inline CSS with , , and other old school tags. There are 2 text strings I need to grab and place those into a separate div higher up on the page. Specifically, In the HTML below I need to grab the text after the word "CONDITION:" But I don't want the HTML. The actual text is different on all pages but the HTML is the same. ONE NICE MICHELIN ENERGY MXV4 S8 215/55/17 93V CONDITION : Approximate tread: 8-9/32 About 80-90% of tread life left
has title: search for multiple text strings in a div and remove html characters
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24961458
has answer: http://stackoverflow.com/a/24961445
tagged with: search
type: Question
has answer: http://stackoverflow.com/a/24961218
tagged with: find
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/comment/38770413
comment on: http://stackoverflow.com/q/24943746
score: 0
type: Comment
type: QuestionComment
has text: @VivinPaliath Yes, the redundant if checks for certain. Also, I am curious as to how others might organize such code in a more meaningful way that what I have here.

http://stackoverflow.com/q/24991833
accepted answer: http://stackoverflow.com/a/24991958
linked to: http://stackoverflow.com/q/10792408
tagged with: javascript
has answer: http://stackoverflow.com/a/24992019
possible better answer: http://stackoverflow.com/a/24991964
has comment: http://stackoverflow.com/comment/38854967
score: 0
answer count: 3
linked to: http://stackoverflow.com/q/11398356
has answer: http://stackoverflow.com/a/24991958
has comment: http://stackoverflow.com/comment/38855240
has body: I have 3 php files: view.php, edit.php and edit2.php. view.php is where I view the content of my database. I use edit.php to enter new data and it's a small window that in which I type in a content I want to include in my db. Then, I pass all of the data to edit2.php which doesn't display anything but only has implemented MySQL queries. Now I would like to have something like this: I'm on view.php. I click a button, edit.php opens as a new, small window. I enter the data, click SUBMIT button, everything is sent to edit2.php but at the same time the window is closed and view.php is refreshed. I would be thankful if you could help. Thanks in advance.
tagged with: php
has comment: http://stackoverflow.com/comment/38854991
type: AnsweredQuestion
tagged with: mysql
has answer: http://stackoverflow.com/a/24991964
type: Question
has title: PHP refresh parent window after closing a child window

http://stackoverflow.com/q/25024772
has comment: http://stackoverflow.com/comment/38917517
favorite count: 0
has comment: http://stackoverflow.com/comment/38918867
upvote count: 0
has comment: http://stackoverflow.com/comment/38917502
has comment: http://stackoverflow.com/comment/38917481
type: UnansweredQuestion
downvote count: 1
has title: Anonymous function appears to override another?
has comment: http://stackoverflow.com/comment/38917564
score: -1
has answer: http://stackoverflow.com/a/25024943
type: Question
has body: With this code: function printStuff(thing1, thing2) { console.log(thing1 + ', ' + thing2); }; function callWith() { theFunc = arguments[0]; theArgs = [].slice.call(arguments, 1); return function() { theFunc.apply(this, theArgs); }; }; x = callWith(printStuff, "apples", "cheese"); y = callWith(printStuff, "monkeys", "bananas"); x(); y(); ...why is it that x and y seem to hold the same function? How do I get the desired behavior (i.e., store two different functions which always run printStuff with the parameters they were given when created)?
tagged with: anonymous-function
answer count: 1
tagged with: javascript

http://stackoverflow.com/a/24950889
has body: Thanks for the input. The problem was actually the event not firing rather than a problem with the animation.
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24938899

http://stackoverflow.com/q/25058267
has answer: http://stackoverflow.com/a/25058399
favorite count: 0
possible better answer: http://stackoverflow.com/a/25058441
has comment: http://stackoverflow.com/comment/38979830
has answer: http://stackoverflow.com/a/25058441
accepted answer: http://stackoverflow.com/a/25058484
has answer: http://stackoverflow.com/a/25058417
upvote count: 2
answer count: 5
tagged with: php
has body: i have an sql with 2 columns, latitude and longitude. I am able to print out the entries of these two columns like: $result = mysqli_query($con,"SELECT * FROM events"); while ($row = mysqli_fetch_array($result)) { echo $row['latitude']; echo $row['longitude']; } I also have a JS function, where i need a while to add as many JS lines as the sql query returns. Here is the JS: var myMarkers = {"markers": [ {"latitude": "47.47256859162068", "longitude":"19.055979251861572", "icon": "marker.png", "baloon_text": 'This is Budapest'}, ] }; So i'd need something like: "latitude": $latitude[i] and "longitude": $longitude[i] all these in a for or a while Is there a way that i could pass the content of the two sql rows to a js function, to be able to get all the line with the correct values?
score: 2
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/25058484
has comment: http://stackoverflow.com/comment/38979969
type: Question
has title: array to js function from sql row
has answer: http://stackoverflow.com/a/25058411
downvote count: 0
tagged with: javascript

http://stackoverflow.com/comment/39008995
score: 0
type: Comment
has text: I am not using ng-change because jQuery Mobile itself is listening for the change event (it is framework code). There is always the option to do it "the angular way" but unfortunately jQuery Mobile is not doing it this way.
comment on: http://stackoverflow.com/a/25062319
type: AnswerComment

http://stackoverflow.com/comment/38971702
type: Comment
comment on: http://stackoverflow.com/a/25017526
has text: Did you consider showing each subapp as they are finished loading? This way your time to screen would be reduced.
type: AnswerComment
score: 0

http://stackoverflow.com/q/25006885
type: AnsweredQuestion
type: Question
tagged with: forms
has body: I am working with jQuery and $.post(). I have the following code: $('#form #buttonQuery').click(function () { var post = $.post(url, info,process, 'json'); } From within the function, how can I refer to the form's action or name? I tried $(this).action, but it doesn't work. Thanks
has answer: http://stackoverflow.com/a/25006905
tagged with: post
score: 0
answer count: 1
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38883520
accepted answer: http://stackoverflow.com/a/25006905
has title: jQuery reference to the form that triggered the call

http://stackoverflow.com/q/25001482
has comment: http://stackoverflow.com/comment/38873653
has comment: http://stackoverflow.com/comment/38873568
tagged with: angularjs
type: UnansweredQuestion
answer count: 0
has comment: http://stackoverflow.com/comment/38873726
tagged with: angularjs-scope
has body: I have a directive which is a toggle button to change the theme of the page. The code for the directive is... app.directive('twoOptionThemeSwitch', function () { return { scope: {}, restrict: 'A', replace: 'true', templateUrl: 'app/themes/partials/twoOptionThemeSwitch.html', controller: 'twoOptionThemeSwitch', link: function (scope, elem, attrs) { elem.bind('click', scope.switchTheme); } }; }); The controller for this is... app.controller('twoOptionThemeSwitch', function ($scope, $rootScope) { $rootScope.$on('switchTheme', function (event, theme) { $scope.selectedTheme = theme; $scope.inverseButton = theme == 'theme-dark'; }); $scope.switchTheme = function () { if ($scope.selectedTheme == 'theme-bright') { $rootScope.$broadcast('switchTheme', 'theme-dark'); } else { $rootScope.$broadcast('switchTheme', 'theme-bright'); } } $rootScope.$broadcast('switchTheme', 'theme-bright'); }); and here is the markup... Bright Dark When I call the $broadcast from the controller during initialization it set the classes correctly. However when I click the button the classes do not change but when debugging I noticed that $on is fired correctly so I know the scope variables are getting set.
type: Question
tagged with: angularjs-directive
has comment: http://stackoverflow.com/comment/38874591
tagged with: javascript
linked to: http://stackoverflow.com/q/16066170
score: 0
duplicate of: http://stackoverflow.com/q/16066170
has title: Why is ng-class not working on my directive when I change a scope variable by using broadcast?

http://stackoverflow.com/q/24932493
tagged with: javascript
has title: synchronising two divs scroll is not smooth in iOS
has comment: http://stackoverflow.com/comment/38743228
answer count: 2
linked to: http://stackoverflow.com/q/17722497
upvote count: 7
possible better answer: http://stackoverflow.com/a/24935429
favorite count: 0
accepted answer: http://stackoverflow.com/a/25548719
tagged with: css
has comment: http://stackoverflow.com/comment/38743595
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38743190
downvote count: 0
has answer: http://stackoverflow.com/a/24935429
score: 7
has answer: http://stackoverflow.com/a/25548719
type: Question
has body: --> Please goto Edit part of this Question I want to synchronise scroll bar of two divs and this is how I am doing it var div1 = document.getElementById('element1'), div2 = document.getElementById('element2'); div1.addEventListener('touchmove', scrolled, false); div2.addEventListener('touchmove', scrolled, false); function getscrollTop(node) { return node.pageYOffset || node.scrollTop; } function scrolled() { var node = this, scrollTop = getscrollTop(node); var percentage = scrollTop / (node.scrollHeight - node.clientHeight); var other = document.getElementById({ "element1": "element2", "element2": "element1" }[node.id]); other.scrollTop = percentage * (other.scrollHeight - other.clientHeight); }; Fiddle -> used scroll instead touchmove But the problem is it is flickering in low end devices and would like to make it smooth in event low end devices. Edit I have used below code to smoothen the scrolling var children = document.querySelectorAll('.scrolldiv'); var getscrollTop = function(node) { return node.pageYOffset || node.scrollTop; }, toInt = function(n) { return Math.round(Number(n)); }; window.setInterval(function() { var scrollTop = getscrollTop(children[0]); var percentage = scrollTop / (children[0].scrollHeight - children[0].clientHeight); var oscrollTop = percentage * (children[1].scrollHeight - children[1].clientHeight); // console.log(1); children[1].scrollTop = toInt(oscrollTop); }, 2); It is smoother in Desktop browsers but in iOS browser, when setting second DIv's scroll it is jerking, jerking in the sense setting scrollTop once scrolling is completed, not while scrolling.

http://stackoverflow.com/a/24915841
type: Answer
answers question: http://stackoverflow.com/q/24912069
score: 2
downvote count: 0
upvote count: 2
has body: It might be that AlchemyAPI returns multiple CORS headers like this: Access-Control-Allow-Origin: * Access-Control-Allow-Origin: * Which is actually interpreted in the browser like this: Access-Control-Allow-Origin: *, * Which is invalid per the standard, and improperly interpreted by the browser. That aside, you probably shouldn't be hitting AlchemyAPI directly. Instead, you should be using a web server to proxy the API calls, and hitting that server with AJAX. By putting the AJAX call to the API client-side, you're giving out your key to any person or device that uses it, and now, you've given it to anyone that views this question on Stack Exchange.

wordpress
tags question: http://stackoverflow.com/q/25026786
tags question: http://stackoverflow.com/q/25001445
tags question: http://stackoverflow.com/q/25002797
tags question: http://stackoverflow.com/q/24942248
tags question: http://stackoverflow.com/q/24939644
tags question: http://stackoverflow.com/q/25045745
tags question: http://stackoverflow.com/q/24938399
tags question: http://stackoverflow.com/q/24963278
tags question: http://stackoverflow.com/q/25067266
tags question: http://stackoverflow.com/q/24925778
tags question: http://stackoverflow.com/q/24941315
tags question: http://stackoverflow.com/q/24991922
tags question: http://stackoverflow.com/q/24972863
tags question: http://stackoverflow.com/q/24963783
tags question: http://stackoverflow.com/q/24935878
tags question: http://stackoverflow.com/q/24923708
tags question: http://stackoverflow.com/q/24980734
tags question: http://stackoverflow.com/q/25008246
tags question: http://stackoverflow.com/q/25034455
tags question: http://stackoverflow.com/q/24943848
tags question: http://stackoverflow.com/q/24994766
tags question: http://stackoverflow.com/q/24915200
tags question: http://stackoverflow.com/q/25038444
tags question: http://stackoverflow.com/q/24922515
tags question: http://stackoverflow.com/q/25013092
tag name: wordpress
tags question: http://stackoverflow.com/q/24955160
tags question: http://stackoverflow.com/q/25032253
tags question: http://stackoverflow.com/q/25066326
tags question: http://stackoverflow.com/q/24933134
tags question: http://stackoverflow.com/q/24927537
tags question: http://stackoverflow.com/q/24968469
tags question: http://stackoverflow.com/q/24916850
tags question: http://stackoverflow.com/q/24929864
tags question: http://stackoverflow.com/q/24959759
tags question: http://stackoverflow.com/q/24923495
tags question: http://stackoverflow.com/q/25004264
tags question: http://stackoverflow.com/q/24971398
tags question: http://stackoverflow.com/q/24950325
tags question: http://stackoverflow.com/q/24953991
tags question: http://stackoverflow.com/q/24921621
tags question: http://stackoverflow.com/q/25001554
type: Tag
tags question: http://stackoverflow.com/q/24990020
tags question: http://stackoverflow.com/q/25040571

http://stackoverflow.com/q/24910301
score: 0
answer count: 1
tagged with: javascript
tagged with: asp.net
has answer: http://stackoverflow.com/a/24911010
type: UnansweredQuestion
tagged with: mysql
has title: Issues when installing Visual Web Developer 2010?
type: Question
tagged with: c#
tagged with: visual-studio-2010
has body: Here is what I am getting: So a long story short I had some problems with php while working on a ASP.net project and decided to reinstall everything. I may or may not have uninstalled something I shouldn't have but installing Apache, MySQL and php was no problem. I have no idea what to do, I've restarted, downloaded again, checked windows updates and so on... Here's the log: === Verbose logging started: 2014-07-22 11:14:38 Build type: SHIP UNICODE 5.00.7601.00 Calling process: C:\Program Files\Microsoft\Web Platform Installer\WebPlatformInstaller.exe === MSI (c) (9C:6C) [11:14:38:538]: Resetting cached policy values MSI (c) (9C:6C) [11:14:38:538]: Machine policy value 'Debug' is 0 MSI (c) (9C:6C) [11:14:38:538]: ******* RunEngine: ******* Product: C:\Users\Dan\AppData\Local\Microsoft\Web Platform Installer\installers\WebToolsExtensionPublishingVWD2010_Only_1_3_BaseLocale\7CFB53AC7131C4817EEF67DF2800633004BF680C\WebPublishVWD2010Tools.msi ******* Action: ******* CommandLine: ********** MSI (c) (9C:6C) [11:14:38:540]: Client-side and UI is none or basic: Running entire install on the server. MSI (c) (9C:6C) [11:14:38:540]: Grabbed execution mutex. MSI (c) (9C:6C) [11:14:38:546]: Cloaking enabled. MSI (c) (9C:6C) [11:14:38:546]: Attempting to enable all disabled privileges before calling Install on Server MSI (c) (9C:6C) [11:14:38:554]: Incrementing counter to disable shutdown. Counter after increment: 0 MSI (s) (B8:58) [11:14:38:569]: Running installation inside multi-package transaction C:\Users\Dan\AppData\Local\Microsoft\Web Platform Installer\installers\WebToolsExtensionPublishingVWD2010_Only_1_3_BaseLocale\7CFB53AC7131C4817EEF67DF2800633004BF680C\WebPublishVWD2010Tools.msi MSI (s) (B8:58) [11:14:38:569]: Grabbed execution mutex. MSI (s) (B8:DC) [11:14:38:571]: Resetting cached policy values MSI (s) (B8:DC) [11:14:38:571]: Machine policy value 'Debug' is 0 MSI (s) (B8:DC) [11:14:38:571]: ******* RunEngine: ******* Product: C:\Users\Dan\AppData\Local\Microsoft\Web …

http://stackoverflow.com/a/25049438
answers question: http://stackoverflow.com/q/25049380
score: 0
has body: Skip it using the slash echo ' User Pass user View-Only ';
type: Answer

http://stackoverflow.com/comment/38922766
score: 0
type: Comment
type: QuestionComment
has text: Dont use ng-if to solve that problem. It's not the tool for the job. http://plnkr.co/edit/mU0P7Bp1mFidWWfIUyX2?p=preview I put together a simple example using ng-class.
comment on: http://stackoverflow.com/q/25027547

http://stackoverflow.com/comment/38822781
has text: @FrankvanPuffelen yes i had that previously and it does exactly the same thing, but i see you gave an answer which looks like it might well solve my issue.
comment on: http://stackoverflow.com/q/24956126
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25029863
score: 0
has comment: http://stackoverflow.com/comment/38926703
type: Answer
answers question: http://stackoverflow.com/q/25029801
has body: If you are looking for an array of arrays, then use .map() like var array = table.find('tr').map(function (i) { var $tds = $(this).find('td'); return $tds.eq(0).text(), $tds.eq(1).text() }).get(); Demo: Fiddle

http://stackoverflow.com/comment/38972366
type: Comment
comment on: http://stackoverflow.com/a/25054048
score: 0
type: AnswerComment
has text: What an obvious answer, lol! Can't believe I didn't try with removing the width from the css. Tnx a lot!

http://stackoverflow.com/comment/38921945
comment on: http://stackoverflow.com/q/25027104
score: 0
type: Comment
type: QuestionComment
has text: to add to this senario. there is an apply button that make a call to this code. I dont know if im am suppose to edit that form button code also to make it work correctly. Here is the code for the apply button

http://stackoverflow.com/a/25046488
upvote count: 17
has body: Try this I learned this from @nmaier when I was mucking around with converting to ico: Well i dont really understand what array buffer is but it does what we need: function previewFile(file) { var reader = new FileReader(); reader.onloadend = function () { console.log(reader.result); //this is an ArrayBuffer } reader.readAsArrayBuffer(file); } notice how i just changed your readAsDataURL to readAsArrayBuffer. Here is the example @nmaier gave me: https://stackoverflow.com/a/24253997/1828637 it has a fiddle if you want to take this and make a file out of it i would think you would use file-output-stream in the onloadend
has comment: http://stackoverflow.com/comment/63229846
score: 17
has comment: http://stackoverflow.com/comment/63228379
answers question: http://stackoverflow.com/q/25046301
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/128305765

http://stackoverflow.com/q/24957032
has answer: http://stackoverflow.com/a/24985988
accepted answer: http://stackoverflow.com/a/24985988
answer count: 1
downvote count: 0
favorite count: 0
type: AnsweredQuestion
score: 7
upvote count: 7
type: Question
has title: Simple JSZip - Create Zip File From Existing Images
tagged with: javascript
tagged with: jszip
has body: I'm having a hard time finding easy documentation for JSZip that doesn't involve Base64 or NodeJS. Basically, I have a directory, in which is test.html and a folder called "images". Inside that folder is a bunch of images. I would like to make a zip file out of that folder. Can anyone help me with some very simple "hello world" type code for this? The documentation on http://stuk.github.io/jszip/ includes things like adding an image from Base64 data or adding a text file that you create in JavaScript. I want to create a .zip file from existing files. Perhaps the only support for adding images to .zip files with JSZip involves adding them via Base64 data? I don't see that anywhere in the documentation, nor an image-url-to-base64 function, though I did find one elsewhere on StackOverflow. Any advice?

http://stackoverflow.com/a/51877800
type: Answer
answers question: http://stackoverflow.com/q/25059641
upvote count: 2
score: 2
has body: I know this post in from a few years ago, but this was the closest to a problem I am having. I just want to post my answer in case someone else ends up here one day. For some reason the check variable "dias" is being passed as a string. That's why replacing it with a number allows the script to run. dias = parseInt(dias); //use this before the variable needs to be read I cant say why it is passing a string after being ++ but this will fix it
downvote count: 0

http://stackoverflow.com/a/24992324
score: 1
answers question: http://stackoverflow.com/q/24992196
upvote count: 1
type: AcceptedAnswer
type: Answer
has body: try this :- $(document).scroll(function() { var cutoff = $(window).scrollTop(); $('span').removeClass('top').each(function() { if ($(this).offset().top &gt; cutoff) { $(this).addClass('top'); return false; // stops the iteration after the first one on screen } }); }); Demo
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24992196

http://stackoverflow.com/comment/38852197
score: 0
type: QuestionComment
type: Comment
has text: @JimEvans but if there is a way to get the new tab handle for example exploring(enumerating) the opened windows in operating systems and send that handle to driver.switchTo().window(winHandle).
comment on: http://stackoverflow.com/q/24979984

http://stackoverflow.com/comment/38810066
type: Comment
has text: @Jongware Added it as Option 2, with due credit to you. Thank you for suggesting this, it enriches the answer.
comment on: http://stackoverflow.com/a/24966297
score: 0
type: AnswerComment

http://stackoverflow.com/q/24959323
has answer: http://stackoverflow.com/a/68582055
tagged with: javascript
upvote count: 13
linked to: http://stackoverflow.com/q/822119
tagged with: unminify
tagged with: minify
favorite count: 0
has answer: http://stackoverflow.com/a/24960143
type: UnansweredQuestion
downvote count: 2
score: 11
tagged with: visual-studio
has body: I am able to Un minify CSS using Visual studio shortcut (Ctrl + K + D). Same trick not working for JS files. How can I un minify JS using Visual Studio like (Ctrl + K + D) short cut. I know there are lot of tools on web but i am searching for Visual Studio.
has title: un minify JS (javascript) code using visual studio?
type: Question
answer count: 2

http://stackoverflow.com/a/25033565
has body: jQuery example: $('#column1').hover(function() { $(this).css('background-image', 'url("one.png")'); $(this).css('opacity', '0.2'); }, mouseOutHandler); $('#column2').hover(function() { $(this).css('background-image', 'url("two.png")'); $(this).css('opacity', '0.2'); }, mouseOutHandler); $('#column3').hover(function() { $(this).css('background-image', 'url("three.png")'); $(this).css('opacity', '0.2'); }, mouseOutHandler); function mouseOutHandler() { $(this).css('background-image', 'inherit'); $(this).css('opacity', 'inherit'); } jQuery API Documentation of the .hover() function: http://api.jquery.com/hover/ First function of .hover() is the mouse enter event function, same as :hover would do in CSS. Second function is the mouse leave event function, which puts the applied CSS back to normal.
has comment: http://stackoverflow.com/comment/38933990
has comment: http://stackoverflow.com/comment/38934124
answers question: http://stackoverflow.com/q/25033433
has comment: http://stackoverflow.com/comment/38933908
has comment: http://stackoverflow.com/comment/38933749
score: 0
has comment: http://stackoverflow.com/comment/38935175
has comment: http://stackoverflow.com/comment/38934018
type: Answer

http://stackoverflow.com/comment/38813993
type: QuestionComment
has text: float: left works perfectly. Thank you!
score: 0
comment on: http://stackoverflow.com/q/24969840
type: Comment

http://stackoverflow.com/comment/38755858
comment on: http://stackoverflow.com/a/24937843
type: AnswerComment
type: Comment
score: 0
has text: @David you do not get response from google, so it fails and never continues. To test change url to one that gives proper AJAX response.

http://stackoverflow.com/a/25063196
answers question: http://stackoverflow.com/q/25063169
has comment: http://stackoverflow.com/comment/38989364
downvote count: 0
type: Answer
score: 1
upvote count: 1
has body: JSON requires double-quotes around keys and commas for all but the last item. ... clicks: "0" ... should be... ... "clicks": "0", ... Note: even integer "keys" need to have double-quotes. So 0: "..." should be "0":"..." Check out JSONLint in the future to double-check your JSON. Also, JSON is not JSONP (source). You specify dataType: "JSONP", but you may just want dataType: "json". If so, as Barmar mentioned, you don't need to call $.parseJSON at all since data will already be a JSON object.

http://stackoverflow.com/comment/38910897
has text: Wait, which file? My HTML is in a templates folder and everything else is in a static folder.
type: Comment
comment on: http://stackoverflow.com/a/25020466
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38714393
type: Comment
type: QuestionComment
has text: The good option is 'server-side'. see the question:http://stackoverflow.com/questions/5697605/limit-the-size-of-an-file-upload-html-input
score: 0
comment on: http://stackoverflow.com/q/24916935

http://stackoverflow.com/comment/38764723
type: Comment
has text: It doesn't work here, which is why this answer is getting down voted
comment on: http://stackoverflow.com/a/24942864
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38939302
type: QuestionComment
has text: How will the random number be based on the original?
type: Comment
comment on: http://stackoverflow.com/q/25036787
score: 0

http://stackoverflow.com/comment/38909490
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25007947
has text: Do not do it by hand when you can have the canvas (hence the GPU) do it for you 20 times faster. In fact there is, since a few month, a new feature not so well known, supported on Chrome and FF, which allows to define a blending mode as globalCompositeOperation. ( look here : http://dev.w3.org/fxtf/compositing-1/#canvascompositingandblending )
type: Comment

http://stackoverflow.com/q/25009258
has comment: http://stackoverflow.com/comment/38887901
type: Question
has answer: http://stackoverflow.com/a/25009535
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/25009288
score: 0
possible better answer: http://stackoverflow.com/a/25009307
answer count: 3
has answer: http://stackoverflow.com/a/25009307
has title: Json Object to Div Html
has body: Here is my Json data [Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object, Object] 0: Object From_Id: 5 Message: " ↵ did you have dinner???" Started_Date: "2014-07-29 11:29:41" To_Id: 5 Upadted_Date: "2014-07-29 03:29:41" __proto__: Object 1: Object From_Id: 5 Message: "ya i did what about you??? ↵ " Started_Date: "2014-07-29 11:51:41" To_Id: 1 Upadted_Date: "2014-07-29 03:51:41" __proto__: Object 2: Object 3: Object 4: Object 5: Object 6: Object 7: Object 8: Object 9: Object 10: Object 11: Object length: 12 __proto__: Array[0] I want to add each message from object to div message_data one after other....i have used the code below...so that message_data div contains all the messages.... var obj = eval(data); console.log(obj); $.each(obj, function (index,Object) { var Id = Object.Message; $('#message_data').html(Id).toString(); }); But it is displaying only the last object message.. how do i fix this??? Note: Iam using this inside timer function so i can not use append ,, which keeps adding same contents after timer seconds...
has comment: http://stackoverflow.com/comment/38887731
tagged with: php
type: AnsweredQuestion
tagged with: object
has answer: http://stackoverflow.com/a/25009288
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/comment/38939454
has text: A schema like you show is fine, but I don't understand why you have `ObjectId` in your example format.
score: 0
comment on: http://stackoverflow.com/q/25030577
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38972017
comment on: http://stackoverflow.com/a/25053929
has text: ohh yep it should be /^-?\d+(\.\d+)?$/
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24953535
tagged with: javascript
answer count: 2
upvote count: 1
possible better answer: http://stackoverflow.com/a/24954081
favorite count: 0
has body: I make an ajax call to a php file has the following code $arr = array('oldid' =&gt; 18258, 'newid' =&gt; 98765); echo json_encode($arr); then in JS .. $.get("/admin/getdata.php", { "otherdata": $("#mydata").val() }).done(function (data) { console.log(data); // prints {"oldid":"18258","newid":"98765"} console.log(data.oldid); // prints undefined console.log(data.newid); // prints undefined }); is json_encode not right for when I want to access keys in js like data.oldid??
has title: How to convert php array to javascript's varname.arrkey form?
tagged with: php
type: AnsweredQuestion
downvote count: 0
score: 1
accepted answer: http://stackoverflow.com/a/24953568
has answer: http://stackoverflow.com/a/24954081
type: Question
has answer: http://stackoverflow.com/a/24953568
has comment: http://stackoverflow.com/comment/38782829

http://stackoverflow.com/q/24942499
tagged with: safari
tagged with: mobile-safari
type: Question
answer count: 1
downvote count: 0
tagged with: javascript
tagged with: jquery
has title: Reset Bootstrap 3 Carousel on page load
has body: Has anybody ever run into Bootstrap's carousel not resetting on page load. It seems to be acting weird in Safari on both the desktop and iPads. On desktops, the slide/tab you leave on is still active if you press the back button and return to the previous page. On iPads, the slide/tab you leave on is no longer marked as active when you press the back button to return. This is really the larger problem here. Is there a way to force data-slide-to='1' to always be active on page load. $('.carousel.graph').carousel({ pause: true, interval: false }); $(window).on('load', function () { var initial = $('table.picker td').attr('data-slide-to', 0); initial.addClass('active'); }); This did not work. EDIT Here's my HTML as well... Slide 1 Slide 2 Slide 3 Slide 4 Slide 5 My problem is that active is not being reapplied to the TD with data-slide-to="0". I can tell because when a "picker TD" is active it has a different background color. When I press the back arrow on iPads, all the "picker TDs" have the same background color.
favorite count: 0
score: 2
has answer: http://stackoverflow.com/a/24942549
upvote count: 2
tagged with: twitter-bootstrap
type: UnansweredQuestion

http://stackoverflow.com/a/24981251
upvote count: 1
accepted answer of: http://stackoverflow.com/q/24981069
has comment: http://stackoverflow.com/comment/38835576
answers question: http://stackoverflow.com/q/24981069
score: 1
has body: You can opt to change the contents of your button, or simply toggle a class on it and let css change the visual display. Apply a common class to the elements for event binding selector simplification. I would add a data attribute containing the course identifier that is needed to make next request for student data. function drawRow(rowData) { var button='&lt;anyElement data-courseId="'+ rowData.id +'" class="data-button"&gt;+&lt;/anyElement&gt;'; var row = $("&lt;tr /&gt;") row.append('&lt;td&gt;'+button+'&lt;/td&gt;');/* no need to wrap html in "$()" */ /* append other cells*/ /* do append to DOM after row created , makes for less DOM insertions*/ $("#dataTable").append(row); } Then within your ready handler add an event handler for the buttons. Within an event handler this refers to current instance. $("#dataTable").on('click', '.data-button',function(){ /* text change method */ $(this).text(function( _ , currText){ return currText === '+' ? '-' : '+'; }); /* class change */ $(this).toggleClass('active'); /* get data */ var id= $(this).data('courseId'); /* make api call based on id*/ })
has comment: http://stackoverflow.com/comment/38835070
has comment: http://stackoverflow.com/comment/38835536
has comment: http://stackoverflow.com/comment/38835526
has comment: http://stackoverflow.com/comment/38835544
has comment: http://stackoverflow.com/comment/38835503
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38835139
has comment: http://stackoverflow.com/comment/38835601
type: Answer
has comment: http://stackoverflow.com/comment/38835264
has comment: http://stackoverflow.com/comment/38835830

http://stackoverflow.com/q/25033917
has answer: http://stackoverflow.com/a/48090824
upvote count: 4
answer count: 4
score: 3
has answer: http://stackoverflow.com/a/25034126
has answer: http://stackoverflow.com/a/25034072
has comment: http://stackoverflow.com/comment/38934048
favorite count: 0
type: Question
tagged with: datepicker
tagged with: http://stackoverflow.com/tag/html
has title: Native Date Picker in Html
downvote count: 1
tagged with: javascript
type: UnansweredQuestion
tagged with: jquery
has body: I used Datepicker plugin for getting Calendar in HTML. But my boss ordered me not to t use any jquery plugins for date picker. He is saying that I must use native code only for date picker. It should work without Javascript also. Is it possible to create native calendar in html ? I know html5 supports native date picker; but that is not supported by all browsers. Can i get native date picker as following style..?
has answer: http://stackoverflow.com/a/25034039

http://stackoverflow.com/comment/38719321
comment on: http://stackoverflow.com/q/24919470
type: QuestionComment
has text: @DontVoteMeDown -- Post that as an answer.
score: 0
type: Comment

http://stackoverflow.com/comment/38813172
has text: unless other operations are needed to process _extension_ images, that can be added using an additional expression in the src, and the type attribute can be removed
type: Comment
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24969113

http://stackoverflow.com/comment/38962317
type: Comment
has text: Yes. If there's no other way then jQuery would have to do it.
comment on: http://stackoverflow.com/a/25048376
score: 0
type: AnswerComment

http://stackoverflow.com/q/24952759
has body: I'm trying to create a collection of objects in my js code, and there are 2 ways that seem both logical. I'm wondering if there's a 'best practise', and why. I couldn't find too much about it, though it seems a fundamental question. Let's say they're color objects. The hue values are fictional. $ is jQuery. Option 1: Identifier as property This I call 'the database way'; each object looks like a table row and contains all fields that belong to that row. colors = [ {name: "red", hex: "ff0000", hue: 34}, {name: "blue", hex: "0000ff", hue: 100} ] add color: colors.push({name: "purple", hex: "ff00ff", hue: 100}); get color(s) by specifying name: redObjs = $.grep(colors, function(c){return (c.name === "red");}); //array with 1 element //easier way? hexOfRex = redObj[0].hex; get color name(s) by specifying hue: hueObjs = $.grep(colors, function(c){return (c.hue === 100);}); //array with 2 elements (color objects) hueNames = hueObjs.map(function(c){return c.name;}); //array with 2 elements (strings) Option 2: Identifier as key Here, part of the information (nl the identifier) is not stored in the color object. colors = { red: {hex: "ff0000", hue: 34}, blue: {hex: "0000ff", hue: 100} } add color: colors["purple"] = {hex: "ff00ff", hue: 100}; get color by specifying name: redObj = colors["red"]; hexOfRed = redObj.hex //or directly colors["red"].hex; get color name(s) by specifying hue: hueNames = []; for (c in colors) {if (colors[c].hue === 100) hueNames.push(c);} //array with 2 elements (strings) I can think of some (dis)advantages for each, like Option 1 advantages: Uniformity and database-likeness. An array, and not an object, seems a more natural structure to store objects that are so alike. Option 2 advantages: Ease and shortness of retrieving information, at least, if name is known. No duplicate color names possible. But that doesn't really help me pick. Are there any other arguments to consider? Is one right out 'wrong' or considered bad practise, and why? Does it mat…
has comment: http://stackoverflow.com/comment/38781699
has comment: http://stackoverflow.com/comment/38781565
type: Question
tagged with: object
has comment: http://stackoverflow.com/comment/38783619
answer count: 2
tagged with: arrays
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24953881
upvote count: 1
has title: How to store like objects in javascript
favorite count: 0
has answer: http://stackoverflow.com/a/24953881
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24952861
accepted answer: http://stackoverflow.com/a/24952861
score: 1

http://stackoverflow.com/a/47851541
answers question: http://stackoverflow.com/q/25026308
score: 0
has body: As tutorial says you should see socket.io started. You need to make sure that you access all your static files from the proper directory. Have you checked final code of that tutorial? Once the game server is running, open the index.html file within the browser. Refresh the page and you should see a message in the console stating that you're now connected to the socket server.
type: Answer

http://stackoverflow.com/q/25000004
accepted answer: http://stackoverflow.com/a/25000163
favorite count: 0
tagged with: angularjs
has title: Calling functions in HTML
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38870239
type: AnsweredQuestion
has body: I'm trying to get a function to call in html and I cant seem to figure it out. I'm using angularJS and I've tried using both onClick = "function();" and ng-click = "function();" Here is my code: HTML: Search JS: function moveToLoc() { siteId = document.getElementById('input').value; alert(siteId); map.panTo(siteId); tableAttrs.hide = !tableAttrs.hide; } In the console I get the error: Uncaught ReferenceError: moveToLoc is not defined What am I doing wrong???
has comment: http://stackoverflow.com/comment/38870671
has comment: http://stackoverflow.com/comment/38873734
upvote count: 1
downvote count: 1
type: Question
has answer: http://stackoverflow.com/a/25000163
has answer: http://stackoverflow.com/a/25000453
tagged with: javascript
has comment: http://stackoverflow.com/comment/38870561
possible better answer: http://stackoverflow.com/a/25000453
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38870196
tagged with: function

http://stackoverflow.com/a/24945511
has comment: http://stackoverflow.com/comment/38794877
has comment: http://stackoverflow.com/comment/41353990
has body: I posted the answer which shows how one can use rowspan attribute to fill the grid which is close to what you do. The demo from the answer you cellattr, but one can use setCell too to set rowspan too. I made the demo to demonstrate this. It displays the following grid originally after one clicks on the button "Click me to add new row" I use addRowData to add the row and use setCell to set new values for rowspan attributes of some previous rows. So one sees the following picture I disable the button "Click me to add new row" because what I wrote is very rough code. I used just fixed values of rowid instead of analyzing the data and evaluating all required values full dynamically. Nevertheless the demo shows clear that one can fill such grids dynamically. Inside of click event handler I used just the following calles $("#list").jqGrid("addRowData", "100", { country: "USA", state: "California",... }, "last"); $("#list").jqGrid("setCell", "60", "state", "", "", {rowspan: "5"}); $("#list").jqGrid("setCell", "10", "country", "", "", {rowspan: "10"}); UPDATED: One can add any HTML fragment (like &lt;button&gt;) in the same way. One more demo add buttons in the grid
has comment: http://stackoverflow.com/comment/38791456
downvote count: 0
has comment: http://stackoverflow.com/comment/41356646
has comment: http://stackoverflow.com/comment/41478274
answers question: http://stackoverflow.com/q/24944242
type: Answer
has comment: http://stackoverflow.com/comment/41355846
has comment: http://stackoverflow.com/comment/38795630
score: 1
has comment: http://stackoverflow.com/comment/38792946
upvote count: 1

http://stackoverflow.com/a/49820657
upvote count: 0
type: Answer
score: -1
has body: I do the initialization like this: dataObject_m1.initSystem= function() { // QML calls when ready console.log( "ModulData_1.js func initSystem()"); dataObject_m1.statisticsSystem= Qt.createQmlObject("import QtQuick 2.5; ListModel{}", dataObject_m1.parent, "dynamic_source" ); dataObject_m1.statisticsSystem.objectName = "ModelSystem"; dataObject_m1.statisticsSystem.append( { name: qsTr("System"), number: "", val: ""}); dataObject_m1.statisticsSystem.append( { name: "S3500", number: "", val: ""}); dataObject_m1.statisticsSystem.append( { name: "S3550", number: "", val: ""}); dataObject_m1.statisticsSystem.append( { name: "S3551", number: "", val: ""}); dataObject_m1.statisticsSystem.append( { name: "S9999", number: "", val: ""}); } And to update Data: var updateSystem = function ( numberMap , valMap) { console.log ("ModuleData_1.js: updateSystem" ); for (var num in (numberMap )) { var j = dataObject_m1.idMap[num]; dataObject_m1.statisticsSystem.set( j, { val : Map[num]}); console.log ("number(" + numberMap[val]+ ") [" + String(j) + "]= numbeMap["+val+"]" ) } for (var valx in (valMap)) { var k = dataObject_m1.idMap[valx]; dataObject_m1.statisticsSystem.set( k, { bad : valMap[valx]}); console.log ("val(" + valMap[valx]+ ") [" + String(k) + "]= valMap["+valx+"]" ) } } Access fuction to model: var statisticsModelSystem= function() { console.log ("ModulData_1.js: get statisticsModelSystem" ); if ( typeof(dataObject_m1.statisticsSystem) !== 'object') console.error(" statisticsSystem is undefined ") return dataObject_m1.statisticsSystem; }
downvote count: 1
answers question: http://stackoverflow.com/q/25029180

http://stackoverflow.com/comment/38785712
comment on: http://stackoverflow.com/a/24954947
has text: What is the `prog_id` parameter for? How does it differ from the callback function? Anyway, you can have as many parameters as you want, using normal URL syntax: `http://path/to/script?param=value&param=value&param=value...`
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24942788
upvote count: 1
type: UnansweredQuestion
tagged with: jsf-2
has body: Here is my issue. I have a dynamic page that loads ads initially when the page loads. As the page is interacted with, the gpt targeting changes and I need to submit a new request to gpt with the new values. I cannot use googletag.pubads().refresh() as the request does not have the right targeting. I need for the ad request to request completely new ads as if it was loaded with the page.
answer count: 0
downvote count: 0
tagged with: javascript
score: 1
favorite count: 0
has title: Need to send new request to gpt after jsf render
type: Question
tagged with: google-dfp

http://stackoverflow.com/a/24945841
downvote count: 0
has comment: http://stackoverflow.com/comment/38769039
has comment: http://stackoverflow.com/comment/38769049
answers question: http://stackoverflow.com/q/24945769
accepted answer of: http://stackoverflow.com/q/24945769
type: AcceptedAnswer
has body: What you want to do is the following: $('.total p span').each(function(){ $(this).html( $(this).closest(".info").find('.price p span').html() * $(this).closest(".info").find('.ticket input').val()); }); The way you had it changed the inner html for all of these span tags on each iteration - with the result that ALL got updated with the sum calculated for the LAST element.
type: Answer
score: 3
has comment: http://stackoverflow.com/comment/38769104
upvote count: 3

http://stackoverflow.com/q/24985623
accepted answer: http://stackoverflow.com/a/24985714
tagged with: angularjs
answer count: 2
possible better answer: http://stackoverflow.com/a/26805451
has answer: http://stackoverflow.com/a/26805451
score: 0
has answer: http://stackoverflow.com/a/24985714
has title: How to pass functions from factory into controller angularJS
type: AnsweredQuestion
tagged with: javascript
type: Question
has body: Right now I have this JS bin: http://jsbin.com/uhabed/64/ in which you can hopefully see the infite scroll loading of more images. These images are added when the page bottom is reached by the scroll bar on line 13 of the javascript: angular.module('infinitescroll', []).directive('onScrolled', function () { return function (scope, elm, attr) { var el = elm[0]; elm.bind('scroll', function () { if (el.scrollTop + el.offsetHeight &gt;= el.scrollHeight) { scope.$apply(attr.onScrolled); } }); }; }).controller("scrollCtrl", function($scope, getStuff){ $scope.data = getStuff; $scope.loaddata = function(){ var length = $scope.data.length; for(var i = length; i &lt; length + 10; i ++){ $scope.data.push(i); } }; $scope.loaddata(); }).factory('getStuff',function($http) { var images_list = ["www.google.com","www.facebook.com","www.supercuber.com","www.snappiesticker.com"]; images_list.addStuff = function(){ $http.get("http://jsbin.com/yehag/2").success(function(data){ var returned_list = JSON.parse(data.javascript); console.log(returned_list); for (var i=0;i&lt;8;i++){ images_list.push(returned_list[i].name); } }); }; console.log(images_list); return images_list; }); I want to replace line 13 with $scope.loaddata = images_list.addStuff(); from the factory below. basically to use the $http function and add the data from that instead. images_list is already being returned properly seeing as the first 4 items in the output are the ones defined in the factory on line 21. However, the optomistic $scope.loaddata = images_list.addStuff(); doesn't seem to be working. How can I pass this function up into the $scope.loaddata?

http://stackoverflow.com/q/24967119
favorite count: 0
linked to: http://stackoverflow.com/q/9894339
has comment: http://stackoverflow.com/comment/38808626
has body: I created this pop-up box on my website: with the following code: &lt;div class="modal custom fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;&lt;span class="sr-only"&gt;Close&lt;/span&gt;&lt;/button&gt; &lt;h4 class="modal-title" id="myModalLabel"&gt;Upload a Meme&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="input-group"&gt; &lt;input type="text" class="form-control" placeholder="Url: http://" id="urlInput"&gt; &lt;input type="text" class="form-control" placeholder="Title" id="titleInput"&gt; &lt;input id="saveComments" type="text" class="form-control" placeholder="Comments"&gt; &lt;input type="text" class="form-control" placeholder="Tags" id="tagInput"&gt; &lt;/div&gt; &lt;br&gt; &lt;h4&gt;&amp;nbsp;Rate It:&lt;/h4&gt; &lt;div class="rating pull-left"&gt; &lt;input type="radio" id="stars5" name="rating" value="5" /&gt;&lt;label for="stars5" title="Rocks!"&gt;5 stars&lt;/label&gt; &lt;input type="radio" id="stars4" name="rating" value="4" /&gt;&lt;label for="stars4" title="Pretty good"&gt;4 stars&lt;/label&gt; &lt;input type="radio" id="stars3" name="rating" value="3" /&gt;&lt;label for="stars3" title="Meh"&gt;3 stars&lt;/label&gt; &lt;input type="radio" id="stars2" name="rating" value="2" /&gt;&lt;label for="stars2" title="Kinda bad"&gt;2 stars&lt;/label&gt; &lt;input type="radio" id="stars1" name="rating" value="1" /&gt;&lt;label for="stars1" title="Sucks big time"&gt;1 star&lt;/label&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default cancel" data-dismiss="modal"&gt;Cancel&lt;/button&gt; &lt;button type="button" class="btn btn-default submit" id="saveSubmit"&gt;&lt;b&gt;Submit&lt;/b&gt;&lt;/button&gt; &lt;/div&gt;…
tagged with: twitter-bootstrap
has comment: http://stackoverflow.com/comment/38808561
has comment: http://stackoverflow.com/comment/38808631
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38808690
type: Question
has comment: http://stackoverflow.com/comment/38808669
has comment: http://stackoverflow.com/comment/38808765
score: 5
has answer: http://stackoverflow.com/a/24967235
has title: How to disable clicking out of pop-up to exit?
upvote count: 5
downvote count: 0
tagged with: javascript
has comment: http://stackoverflow.com/comment/38808544
accepted answer: http://stackoverflow.com/a/24967235
duplicate of: http://stackoverflow.com/q/9894339
answer count: 1

http://stackoverflow.com/comment/38712767
type: Comment
comment on: http://stackoverflow.com/a/24916109
score: 0
type: AnswerComment
has text: Is there a way to get the MAC address through Java, then save it to a php variable??

http://stackoverflow.com/comment/39441213
type: Comment
type: QuestionComment
has text: THx for the answer, but what do I have to change?
comment on: http://stackoverflow.com/q/25064139
score: 0

http://stackoverflow.com/comment/38957910
has text: This is the 'json' string you're feeding to the charting api? Or a console log of your json object? There looks to be missing opening curly braces.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25046031

http://stackoverflow.com/comment/38936484
comment on: http://stackoverflow.com/q/25035195
has text: Or `.toArray()`? But seriously, don't use jQuery for data manipulation, it's meant for the DOM.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/65027151
comment on: http://stackoverflow.com/a/25034254
score: 0
type: AnswerComment
type: Comment
has text: Another question regarding your code: The xref part seems not to work for me. A lot of the char[xrefstmPositions[int] + offset + 1 + firstObject.length + length] are just undefined. Here is a test pdf I'm using: https://www.dropbox.com/s/cwfa4dzcoqkuje6/form4.pdf?dl=0 (Maybe useful for other people to test with as well)

http://stackoverflow.com/a/24953759
type: Answer
has body: Have a look at this JSFiddle: http://jsfiddle.net/M8SPH/ Be sure to add your app_id, page_id and page_access_token. Basically, you got forgot that you have to add a body parameter and URL encode the actual parameters in it: FB.api( '/', 'POST', { access_token: pageAccessToken, 'batch': [ { 'method': 'POST', 'relative_url': pageId+'/photos', 'access_token': pageAccessToken, 'body': "message=Test Upload Photos 1...&amp;url=https://hn85599112.files.wordpress.com/2014/07/girl-photo.jpeg" }, { 'method': 'POST', 'relative_url': pageId+'/photos', 'access_token': pageAccessToken, 'body': "message=Test Upload Photos 2...&amp;url=http://www.paopaoche.net/up/2012-5/20125523231510353173.jpg" } ] }, function(response) { console.log(JSON.stringify(response)); } ); See https://developers.facebook.com/docs/graph-api/making-multiple-requests#multiple_methods
has comment: http://stackoverflow.com/comment/38926161
answers question: http://stackoverflow.com/q/24952380
score: 0

http://stackoverflow.com/a/25060367
answers question: http://stackoverflow.com/q/25060306
has body: Ah. Me being stupid and forgetting how concatenating works. I needed to end the string with the same type of quotes and then use the plus symbol to concatenate the variable. I then used the same quotes again to finish open and close the remainder of the string. var $small = '600px'; enquire.register("screen and (max-width:" + $small + ")", { });
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25060306
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/25058656
favorite count: 0
has comment: http://stackoverflow.com/comment/38981348
type: UnansweredQuestion
has title: RESTful API testing in a browser
has body: I'm writing RESTful application, along with a documentation. Because the documentation is written as a web page, I'd like to have REST services testing embedded in the docs. I use Jasmine for testing and have been looking for some simplification of testing REST calls. Frisby looks like the thing I need, but it is run inside Node.js, not a browser. Do you know of any library that would resemble Frisby testing, but in browser environment? For what it's worth, I found SuperTest, which runs on portable superagent, but I don't know if it's usable with Jasmine (they are strongly Mocha-related). UPDATE: Nope, supertest doesn't (yet) work in the browser :(
tagged with: supertest
downvote count: 0
has comment: http://stackoverflow.com/comment/38980854
has answer: http://stackoverflow.com/a/25122430
score: 1
has comment: http://stackoverflow.com/comment/39017491
type: Question
has comment: http://stackoverflow.com/comment/38981437
has comment: http://stackoverflow.com/comment/39001170
answer count: 1
tagged with: javascript
tagged with: jasmine
has comment: http://stackoverflow.com/comment/38981650
has comment: http://stackoverflow.com/comment/39001282
tagged with: rest
upvote count: 1
has comment: http://stackoverflow.com/comment/38981074

http://stackoverflow.com/comment/38790720
has text: @johncorser Are you sure? In the first line of your question you said that the json object is returned at `localhost:9000/api/query`. Anyways, please verify what is the URL being called in the console.
comment on: http://stackoverflow.com/a/24957770
score: 1
type: AnswerComment
type: Comment

http://stackoverflow.com/q/25058915
has comment: http://stackoverflow.com/comment/38987209
tagged with: javascript
has title: How to access store from other controller in ExtJS 4.2.2
tagged with: extjs
score: 0
tagged with: symfony
has comment: http://stackoverflow.com/comment/38987679
answer count: 0
type: UnansweredQuestion
tagged with: php
has body: I'm developing an application which is build in ExtJS 4.2.2 with symfony2 backend. Now I have following problem : Lets say that I have 2 mvc's in my frontend - One for managing users and other for managing their data. Now when user want to delete row of data I have to set his name in that deleted record so it can be archived and other users would know who made the deletion. The question is how can I access to currently logged in user data from my DataController. I've tried this: This is part of code in my DataController, it's responsible for archiving deleted record //sel[0] is selected record //console.log({{ app.user.username }}); //I tought it could work somehow :) but it did not sel[0].set('deleted_at', new Date()); //setting date of deletion //get user store //var usrStore = Ext.getStore('common_user.user_store'); var usrStore = Ext.data.StoreManager.lookup('common_user.user_store') console.log(usrStore); //in both cases ruterns undefined //sel[0].set('deleted_by', ); //here i want to save user name in column named "deleted_by" sel[0].save(); sel[0].commit(); grid.getStore().sync(); grid.getStore().reload(); //reload grid grid.getStore().remove(sel[0]); //remove from grid This is how I've configured User store proxy proxy: { type: 'rest', url: Routing.generate('webit_sencha_get',{store: 'common_user.user_store'}), appendId: false, batchActions: true, reader: { type: 'json', root: 'data' }, writer: { type: 'json', root: 'data', encode: true, writeAllFields: true } } Maybe I should load User grid on init of my data controller ? But still, I don't know how to. Ext.define('Data.controller', { extend: Ext.app.Controller, init: function() { this.control({ ... 'data_grid': { afterrender: this.onDataGridRender }, 'archive_grid': { afterrender: this.onDataArchiveGridRender }, 'common_user_grid': { afterrender: this.onUserGridRender // ???? } }); }, ... So the question is how can I access (if it's possible) name of currently logged in user from other controller I'll be t…
has comment: http://stackoverflow.com/comment/38984251
type: Question

http://stackoverflow.com/q/25005279
type: Question
tagged with: uglifyjs
has answer: http://stackoverflow.com/a/25005714
accepted answer: http://stackoverflow.com/a/25005714
tagged with: source-maps
tagged with: javascript
answer count: 2
has answer: http://stackoverflow.com/a/25969915
upvote count: 1
tagged with: gulp
favorite count: 0
possible better answer: http://stackoverflow.com/a/25969915
has body: I'm using gulp with gulp-uglify, gulp-concat and gulp-sourcemaps to minify/concatenate my js files and produce source maps. When I open chrome dev-tool in the sources tab, I can see the minified file along a "source" directory with all the original files - as expected. But when I try to debug or get an error in the console, then the references are to the minified file (for example, error traces in the console, point to a line in the minified file...). Is this how source-maps works? or I did something wrong? My gulp js conf - gulpfile
type: AnsweredQuestion
downvote count: 0
has title: Do source maps work when debugging?
score: 1
tagged with: google-chrome

asp.net-mvc-4
tags question: http://stackoverflow.com/q/24997246
tags question: http://stackoverflow.com/q/25062294
tags question: http://stackoverflow.com/q/25021865
tags question: http://stackoverflow.com/q/25031442
tags question: http://stackoverflow.com/q/24983566
tags question: http://stackoverflow.com/q/25039374
tag name: asp.net-mvc-4
tags question: http://stackoverflow.com/q/24936212
tags question: http://stackoverflow.com/q/24920408
tags question: http://stackoverflow.com/q/25028367
type: Tag
tags question: http://stackoverflow.com/q/25068216
tags question: http://stackoverflow.com/q/25005512
tags question: http://stackoverflow.com/q/25052891
tags question: http://stackoverflow.com/q/25015948
tags question: http://stackoverflow.com/q/25037332
tags question: http://stackoverflow.com/q/24981098
tags question: http://stackoverflow.com/q/24923228
tags question: http://stackoverflow.com/q/24932912
tags question: http://stackoverflow.com/q/25031440
tags question: http://stackoverflow.com/q/25040212
tags question: http://stackoverflow.com/q/24996692
tags question: http://stackoverflow.com/q/24932767
tags question: http://stackoverflow.com/q/24955384
tags question: http://stackoverflow.com/q/24980513
tags question: http://stackoverflow.com/q/25058129
tags question: http://stackoverflow.com/q/25067678
tags question: http://stackoverflow.com/q/25068431

http://stackoverflow.com/comment/58575331
comment on: http://stackoverflow.com/q/24974048
type: Comment
has text: did you get any solution ? I have the same problem, trying to connect Qt cleint to node Js Server, i'm getting the same warning, even if i don't want to use ssl.
type: QuestionComment
score: 0

http://stackoverflow.com/comment/38893172
type: AnswerComment
has text: Sure now delete my comments and excuse for incovenience
type: Comment
comment on: http://stackoverflow.com/a/25011979
score: 0

http://stackoverflow.com/comment/38719242
type: QuestionComment
has text: Here is a jsBin of your code, it indeed works http://jsbin.com/devote/1/edit?js,console
score: 0
type: Comment
comment on: http://stackoverflow.com/q/24919307

http://stackoverflow.com/a/36814450
accepted answer of: http://stackoverflow.com/q/25060602
upvote count: 1
type: AcceptedAnswer
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25060602
has body: Circling back to this, I was able to fix it by injecting $window: .run(function($ionicPlatform, $window ) { Then I was able to get/set by using: $window.localStorage.setItem( 'name', 'Ian' ); $window.localStorage.getItem( 'name' ); // Ian

http://stackoverflow.com/a/24946186
score: 3
upvote count: 3
has body: This: $(".filter-icon") &mdash; is a jQuery function call. The returned value is in fact not an array, but it does have a length property. The length of the result of that function call is a count of the number of elements in the DOM that matched the selector. The point of that code is to check whether there are any elements in a DOM that have the class "filter-icon". It's not that uncommon in JavaScript programming to run into things that appear to be arrays, but which really aren't. Happily, many of the built-in functions for real arrays are fairly loose about what they'll accept, so you can quite often use native array functions to do interesting things with objects that just sort-of pretend to be real arrays.
answers question: http://stackoverflow.com/q/24946169
accepted answer of: http://stackoverflow.com/q/24946169
type: AcceptedAnswer
downvote count: 0
type: Answer

http://stackoverflow.com/comment/38715087
has text: Perfect. Thank you. The resolution was just to move the script within the onYouTubeIframeAPIReady function which is called by the Youtube API after it's fully loaded. Can't believe I didn't think of that before.
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24916463

http://stackoverflow.com/a/24998702
has comment: http://stackoverflow.com/comment/38867622
has comment: http://stackoverflow.com/comment/83026923
has comment: http://stackoverflow.com/comment/38867830
has comment: http://stackoverflow.com/comment/38867645
type: Answer
answers question: http://stackoverflow.com/q/24998624
upvote count: 3
score: -3
has comment: http://stackoverflow.com/comment/38867673
has comment: http://stackoverflow.com/comment/38867818
downvote count: 6
has body: Not the best method, use an array instead. This is just an alternative method. http://www.w3schools.com/jsref/jsref_getday.asp var date = new Date(); var day = date.getDay(); You should really use google before you post here. Since other people posted the array method I'll show you an alternative way using a switch statement. switch(day) { case 0: day = "Sunday"; break; case 1: day = "Monday"; break; ... rest of cases default: // do something break; } The above works, however, the array is the better alternative. You may also use if() statements however a switch statement would be much cleaner then several if's.

http://stackoverflow.com/q/25031227
tagged with: plugins
has comment: http://stackoverflow.com/comment/38939354
has comment: http://stackoverflow.com/comment/38940424
type: Question
tagged with: flash
tagged with: air
has body: The requirement in our project is to download a file from a web application without showing the open/save dialog box confirmation in the browser. This seems to be impossible in a web application but can be achieved inside an AIR application. Is is possible to make the the web application send an URL to the AIR application? Please help.
tagged with: javascript
has answer: http://stackoverflow.com/a/25031293
has comment: http://stackoverflow.com/comment/38989635
score: 0
has title: Is it possible to send data from a web app to an adobe air application?
has comment: http://stackoverflow.com/comment/39020146
answer count: 1
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38929104

http://stackoverflow.com/comment/38729994
comment on: http://stackoverflow.com/q/24922313
type: QuestionComment
has text: Have you considered using [data method](http://api.jquery.com/data/)? Store image data and shrink image on dragstart. Retrieve data and restore image on dragend.
score: 0
type: Comment

source-maps
type: Tag
tag name: source-maps
tags question: http://stackoverflow.com/q/25023178
tags question: http://stackoverflow.com/q/25005279

http://stackoverflow.com/comment/38712556
type: Comment
score: 0
type: AnswerComment
has text: However, I want multiple people to be able to use it at once. I just want the script to stop executing when the user leaves the page from which the AJAX request was sent. Plus, the script takes a long time to finish sometimes, and can even not respond. So for that reason I'd rather not put a lock on, but just kill the execution of the script.
comment on: http://stackoverflow.com/a/24915948

django-templates
tags question: http://stackoverflow.com/q/25056028
tags question: http://stackoverflow.com/q/24975978
tag name: django-templates
type: Tag
tags question: http://stackoverflow.com/q/24923134

http://stackoverflow.com/q/25039786
type: Question
score: 0
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38945406
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38945291
has body: I have an ajax function in my script that works fine in all browsers except ie9 and below. I've read elsewhere on Stackoverflow (jQuery.getJSON not working properly in IE8 with gdata json-c. Why?) that this could be a cross domain issue but if it was that surely my code would fail in all browsers? Can anybody provide me with some advice? function GetLocation(location) { var result; $.ajax({ url: "http://maps.googleapis.com/maps/api/geocode/json?address=" + location + "&amp;components=country:UK&amp;sensor=false&amp;callback=?", async: false, data: 'json', dataType: 'text json', success: function (data) { result = data; }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status); alert(thrownError); } }); return result; }
tagged with: ajax
has comment: http://stackoverflow.com/comment/38945028
linked to: http://stackoverflow.com/q/6318996
linked to: http://stackoverflow.com/q/2921745
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38945960
duplicate of: http://stackoverflow.com/q/2921745
has title: AJAX request returning error code 0 in ie9 and below?
has comment: http://stackoverflow.com/comment/38945172
has comment: http://stackoverflow.com/comment/38946581

http://stackoverflow.com/a/24974511
type: Answer
answers question: http://stackoverflow.com/q/24974308
has body: You need to use a Javascript date parsing library such as moment.js, or XDate if you want to leverage your current Javascript skills with the Date() object.
score: 0

http://stackoverflow.com/q/25021715
type: Question
has body: I have a force directed graph in D3 that renders correctly on load from a web socket. I am tasked with adding or removing links and nodes to and from this graph depending on subsequent web socket messages. The problem I am having is that when I pan or zoom the graph a transform gets applied. I don't know how to apply that transform to the newly added links or nodes. As a result the links that get added are dependent on the original cx cy positions of the source and destination nodes. Here is the code in it's entirety. Hopefully someone can clue me in as to how to apply the transform to the newly added links. Code Edited for brevity as requested: var DataPlane = (function() { //This method gets called when a link is either added or removed from the svg via web socket. var remapDataPlane = function(data) { var dpData = $.parseJSON(data); ... if (dpData.addedLinks.length > 0) { //get the svg var parentSvg = d3.select("#app_dataPlane svg").select("g") var svg = parentSvg.select("g"); //this portion gets the transform that has been applied to the svg group element. var trans = svg.attr("transform"); //get a list of switches from svg var svgSwitches = d3.selectAll(".switch"); //Process unidirectional and bidirectional links -- BEGIN var bidLinks = []; var uniLinks = []; var pairs = []; var idx = 0; function hasMatchingNode(element, index, array) { return (element.src.dpid !== this.src.dpid && element.src.dpid === this.dst.dpid && element.dst.dpid === this.src.dpid); } function parseLinks(element, index, array) { var node = array.filter(hasMatchingNode, element); if (node.length > 0) { var match = array.indexOf(node.pop()); array.splice(match, 1); } else { uniLinks.push(element); array.splice(index, 1); } } dpData.addedLinks.map(parseLinks); if (dpData.addedLinks != undefined) { dpData.addedLinks.forEach(function(item) { item["nature"] = "bidirectional"; }); uniLinks.forEach(function(item) { item["nature"] = "unidirectional"; }); //Links are added in pairs to represent bid…
tagged with: javascript
score: 0
tagged with: d3.js
type: UnansweredQuestion
has title: Appending a line to a force directed graph and applying a transform using D3
answer count: 0
has comment: http://stackoverflow.com/comment/38914544
has comment: http://stackoverflow.com/comment/38913719

http://stackoverflow.com/comment/38966566
comment on: http://stackoverflow.com/q/25051004
has text: If `String` isn't an `Object`, then why does `String.prototype.__proto__ === Object.prototype` give `true`?
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24954524
tagged with: javascript
has body: I'm so so sorry asking this very repetitive question again, yet as I searched the previous answers I could not find any solutions. In the code below, my browser returns :Uncaught TypeError: Cannot set property 'innerHTML' of undefined as I click an the generated links. Would you be kind to help me out? Thank you very much in advance. Document <?php for ($i=0 ; $i < 9 ; $i++) { echo "{$i} "; } ?>
duplicate of: http://stackoverflow.com/q/1451009
score: 0
has title: Uncaught TypeError: Cannot set property 'innerHTML' of undefined
answer count: 1
has answer: http://stackoverflow.com/a/24954595
tagged with: php
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24954595
type: Question
linked to: http://stackoverflow.com/q/1451009
has comment: http://stackoverflow.com/comment/38784637

http://stackoverflow.com/comment/38951527
has text: this doesn't quite work... add a few more sets of h3 follows by content and it only applies to the first and last. I need it to do ALL the h3 sets
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25028878
score: 0

http://stackoverflow.com/a/25039413
has comment: http://stackoverflow.com/comment/38944451
has comment: http://stackoverflow.com/comment/38944395
answers question: http://stackoverflow.com/q/25039308
score: 0
has comment: http://stackoverflow.com/comment/38944485
has comment: http://stackoverflow.com/comment/38944808
type: Answer
has body: Your request is asynchronous, so you should handle it with callback: function getListname(listId, callback) { var query = 'SELECT name FROM Lists WHERE id=(?)'; $scope.db.transaction( function (transaction) { transaction.executeSql(query, [listId], function (tx, results) { // console.log("Result: "+results.rows.item(0).name); // works! callback(results.rows.item(0).name); // returns nothing or not to the sender } ); } ); }

eclipse
tag name: eclipse
tags question: http://stackoverflow.com/q/25067186
tags question: http://stackoverflow.com/q/25040701
tags question: http://stackoverflow.com/q/25040294
tags question: http://stackoverflow.com/q/24978218
tags question: http://stackoverflow.com/q/24949612
tags question: http://stackoverflow.com/q/25054542
type: Tag

http://stackoverflow.com/comment/38955909
type: Comment
has text: @CatznDogz I think I understand your problem. Well, I would try to create a global boolean variable and use it inside the draw. It will be initially `false` (not saving the frame). Whenever I wanted a frame saved I would change this bool to `true`. I know its a hack but may work for you.
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25022602

http://stackoverflow.com/comment/38770722
has text: I figured it was asked somewhere else. A quick search did not yield an answer, however. I suppose my search terms were not correct. Delete away!
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24946711

http://stackoverflow.com/q/24935049
type: Question
has body: I have this timer that counts down from 10 minutes to 0. What I need it to do now is alert('you've finished') when it gets to 0? I tried adding if (mins == 0 alert('hi')); to the Decrement() function but nothing gets picked up. SAGGY START THE TIMER GO! ###### Copyright BibBoy &#174 2014 #ImYourMum
tagged with: javascript
has comment: http://stackoverflow.com/comment/38748114
accepted answer: http://stackoverflow.com/a/24935207
answer count: 1
favorite count: 0
has title: How do I execute some code when timer gets to 0?
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/2064186
score: 0
has comment: http://stackoverflow.com/comment/38748130
has comment: http://stackoverflow.com/comment/38748044
upvote count: 1
has answer: http://stackoverflow.com/a/24935207
downvote count: 1

http://stackoverflow.com/comment/38806422
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24965333
has text: Heh, bad communication day. By your "first answer" I meant the one at the bottom that you referred to in that way. AJAX isn't involved in this transition. Think of it simply as a link click or a window.location. So normal convention would be that they can cancel it by hitting Escape (which I can catch) or by hitting the browser's X/cancel button (which I don't know how to catch). So I was looking for a way to simply catch ALL unload terminations.
score: 0

http://stackoverflow.com/comment/38707580
score: 0
type: AnswerComment
type: Comment
has text: (I added a third row to my table for clarity) I don't understand what you mean by the normal order. My tabindexes are 18, 19, 20. Thank you!
comment on: http://stackoverflow.com/a/24913327

http://stackoverflow.com/comment/38828340
has text: @Kirk: I'd only do so if you can't edit this `promise` function, as it's much more consistent to use one at a time. In that case, I've edited my answer to add a link to a possible solution.
type: Comment
score: 1
comment on: http://stackoverflow.com/a/24977580
type: AnswerComment

http://stackoverflow.com/q/25058553
has comment: http://stackoverflow.com/comment/38981453
has body: My requirement is very simple yet very seems to be complicated !! I am using C# code and java-script. I want to use an alert message with confirm / cancel button and i want to track the user click from code behind say if he has pressed confirm button of alert message or say if he has clicked on cancel button of alert message. say from c# code behind page i have called confirmDuplicateCustomerCreation function confirmDuplicateCustomerCreation() { confirm('Customer with same details already exists. Do you want to continue?') } protected void Button1_Click(object sender, EventArgs e) { ScriptManager.RegisterStartupScript( this, this.GetType(), Guid.NewGuid().ToString(), @" ", false); Label1.Text = Convert.ToString(CustomerDuplicateFlag.Value); } <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /> <asp:HiddenField ID="CustomerDuplicateFlag" runat="server /> then is there any way to track whether the user has clicked on confirm or cancel.... ??
score: -1
has comment: http://stackoverflow.com/comment/38981997
tagged with: alert
has comment: http://stackoverflow.com/comment/38983027
linked to: http://stackoverflow.com/q/7155939
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38981028
tagged with: c#
has comment: http://stackoverflow.com/comment/38984354
tagged with: javascript
has title: how to track confirm cancel event of alert in code behind in C#
has comment: http://stackoverflow.com/comment/38982931
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38980899
has comment: http://stackoverflow.com/comment/38981549
has comment: http://stackoverflow.com/comment/38986046
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38981666
has comment: http://stackoverflow.com/comment/38981931
has answer: http://stackoverflow.com/a/25062012
has comment: http://stackoverflow.com/comment/38982320
type: UnansweredQuestion

http://stackoverflow.com/comment/39171154
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25029827
has text: wow!! finally i complete this rubberband selection. three.js have great math work in it. Thanks all.

http://stackoverflow.com/comment/38863443
score: 7
has text: Because that's how `.match()` is supposed to work with sub-matches. The first element in the returned array is the string that matched the whole regex, which in your case happens to be the whole input.
comment on: http://stackoverflow.com/q/24996467
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38904576
has text: I have never tried this, but having looked at parts of Sammy before, I do not believe there is any way to do what you want. Sammy is based off of JQuery, which has no concept of observables, and so, without a computed, you cannot change the address of the URL.
comment on: http://stackoverflow.com/q/25017283
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38960840
comment on: http://stackoverflow.com/a/25047671
type: AnswerComment
has text: I have edited my answer.. jQuery is loading fine but the problem is that dialog disappears as soon as it loads.. whether i am expecting that it should close only when i click close button
type: Comment
score: 0

http://stackoverflow.com/a/24928014
answers question: http://stackoverflow.com/q/24919975
type: Answer
has body: Everything is OK, as far the write stream is concerned. When you delete the file you are in effect removing an entry in the directory, but the original inode is not deleted, and your app that has it open keeps writing to the disk, only you don't have a pointer to it (a dir entry), so can't see. You will notice that free disk space keeps decreasing, which tells you that things are indeed written. When the app closes the file it is then removed (since no references are left pointing to it), at which point the free disk space will increase again. The standard practice for you are trying to do is to send a signal (SIGHUP or SIGUSR1 to the app), and in the signal handler have the app close and re-open the file. This is called "log rotation". There are many node packages that do this for you, or you can do this yourself for the practice :-)
has comment: http://stackoverflow.com/comment/38754448
upvote count: 1
score: 1
has comment: http://stackoverflow.com/comment/38747775
downvote count: 0

http://stackoverflow.com/comment/39123235
comment on: http://stackoverflow.com/a/25095879
score: 0
type: AnswerComment
type: Comment
has text: I have found another issue with my code. One of my tabs is a map. I also have the internet check here. When there is no internet on start up, my two webviews and map do not appear and I add labels and refresh buttons. The webviews now will load after a connection is established and the refrsh is clicked after integrating your code..BUT if I refresh the map page FIRST and then try and refrsh either page with a webview, the app crashes. If I refresh the webview first, all is OK. Any ideas?

http://stackoverflow.com/comment/139700389
has text: so i'm not the only one to use 'swag' in their logs
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25041174

http://stackoverflow.com/comment/38762521
comment on: http://stackoverflow.com/a/24941796
score: 0
type: AnswerComment
type: Comment
has text: Then yes, you will need some JS validation, which should be called from within the form event handler; my previous code should work for you; just make sure fieldcheck returns a Boolean corresponding to the inputs. Once the form is submitted I would add Coldfusion.navigate( "feedbackact.cfm?type=feedback" ) which will send the email.

http://stackoverflow.com/comment/38966633
has text: As per the above user. The image you're showing is the arrow... so what are you actually trying to do?
score: 0
type: Comment
comment on: http://stackoverflow.com/q/25051053
type: QuestionComment

http://stackoverflow.com/comment/38968148
score: 0
type: Comment
has text: @Teemu Those dom elements were added dynamically.
type: AnswerComment
comment on: http://stackoverflow.com/a/25051832

http://stackoverflow.com/comment/39000133
score: 0
comment on: http://stackoverflow.com/a/25068556
has text: Action Save has the same name as Button name="Save" type="Submit", so when I click this button, I will get into [HttpPost] ActionResult Save()
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38802820
type: QuestionComment
has text: Nevermind I understand your question now. I can see the problem
comment on: http://stackoverflow.com/q/24963474
score: 0
type: Comment

http://stackoverflow.com/comment/38811946
type: AnswerComment
has text: Hi, Thanks for your reply. It stills doesn't work. :(
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24964880

http://stackoverflow.com/q/25061817
has answer: http://stackoverflow.com/a/25062155
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25062118
has answer: http://stackoverflow.com/a/25062118
type: Question
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25062155
tagged with: jquery
has title: Looking to switch Main image with selected thumbnail
score: 0
tagged with: http://stackoverflow.com/tag/html
tagged with: gallery
has body: all I am currently making my own PHP-functional gallery, and all I need now is a javascript statement to switch the main image with the thumbnail image when clicked upon. I've tried several different codes, but each time I manage to somehow screw the whole thing up. Here is a link to my JSFiddle: http://jsfiddle.net/m6YMb/ I've tried using ID switching, but it wont seem to work with me, and I'm afraid it might interfere with other images in my website. :/ Here is extra code that I have implemented so far on my page: function toggle_visibility(id) { var infoBox = document.getElementsByClassName("info"); for (var i = 0; i &lt; infoBox.length; i++) { infoBox[i].style.display = 'none'; } var e = document.getElementById(id); if(e.style.display == 'block') { e.style.display = 'none'; } else { e.style.display = 'block'; } } $(".heading").click(function(){ if(!$(this).hasClass("active_heading")){ $(".heading").removeClass("active_heading"); $(this).addClass("active_heading"); } }); Hope you guys can help me out here, I'm still trying to learn!
tagged with: css

http://stackoverflow.com/q/24993685
has answer: http://stackoverflow.com/a/24993739
score: 0
answer count: 2
has comment: http://stackoverflow.com/comment/38858727
type: UnansweredQuestion
has body: I am trying to list all numbers below a certain number provided in the textfield (see input) that is multiples of 3 or 5 and then add the multiples and outputting the sum (in this case changing the div#answers text to the sum. Example: if that certain number is 10, then the multiple of 3 and 5 that is &lt; 10, would be 3,5,6,9 and the sum of 3,5,6,9 is 23. I got all down as far as the solution goes but for the life of me can't output the answer. &lt;html&gt; &lt;head&gt; &lt;script&gt; function myFunc() { var result = []; var sum; for(var i = 1; i &lt; document.getElementById('number').value; i++) { if(3*i &lt; document.getElementById('number').value) { result[i] = 3*i; } if(5*i &lt; document.getElementById('number').value) { result[i] = 5*i; } } for(i = 0; i &lt; result.length; i++) { sum += result[i]; } } document.getElementById("answers").innerHTML = sum; &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="text" id="number" /&gt; &lt;input type="button" onclick="myFunc()" value="Click for answer"&gt; &lt;div id="answers"&gt;&lt;/div&gt; &lt;/div&gt; &lt;/body&gt;
type: Question
has title: Can't output a simple javascript result
has answer: http://stackoverflow.com/a/24993873
tagged with: javascript
has comment: http://stackoverflow.com/comment/38858160

http://stackoverflow.com/comment/38769081
type: Comment
comment on: http://stackoverflow.com/a/24945760
has text: So If I have a stub (client-side method) and a server-side method, then they both run. But I can effectively treat it async on the client because it simulated what the server would do.
type: AnswerComment
score: 0

http://stackoverflow.com/comment/38893102
comment on: http://stackoverflow.com/a/25011961
type: Comment
has text: Thanks, but it will not work because near to mouse already have element. (dragged)
score: 1
type: AnswerComment

http://stackoverflow.com/comment/38758030
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24934455
has text: just an extra field to show that it works with multiple form fields, so it's not limited to just files

http://stackoverflow.com/a/24929933
answers question: http://stackoverflow.com/q/24929796
has comment: http://stackoverflow.com/comment/38739480
has comment: http://stackoverflow.com/comment/38739784
score: 0
has comment: http://stackoverflow.com/comment/38738861
has comment: http://stackoverflow.com/comment/38739084
has body: You may Try like $(document).on('change', '#checkbox1', function() { alert('alerted'); });
type: Answer

http://stackoverflow.com/a/24974117
downvote count: 0
answers question: http://stackoverflow.com/q/24973894
has body: Regex: &lt;div\b.*?\bdata-id=\"([^"]*)\"&gt;([^&lt;]*).*?\/&gt;([^&lt;]*)&lt;div\b.*?\bdata-id=\"([^"]*)\"&gt;([^&lt;]*).* Replacement string: @['id':'$1','tag':'$2']; , $3@['id':'$4','tag':'$5']; DEMO
type: Answer
has comment: http://stackoverflow.com/comment/38821773
upvote count: 1
score: 1

http://stackoverflow.com/comment/38716863
type: Comment
score: 1
comment on: http://stackoverflow.com/q/24917888
type: QuestionComment
has text: Can you not use class='required', then use $.each() to go through the form?

http://stackoverflow.com/a/24984639
has comment: http://stackoverflow.com/comment/38842321
has body: if you want to remove class just go with @littleLouito Code else if you want toggle try this one $(":radio:not(checked)").each(function () { $(this).closest('label').toggleClass("on", this.checked); });
type: Answer
answers question: http://stackoverflow.com/q/24984477
score: 0

http://stackoverflow.com/comment/39084803
type: QuestionComment
has text: Not that I am aware of.
comment on: http://stackoverflow.com/q/24951569
score: 0
type: Comment

http://stackoverflow.com/comment/38769352
score: 0
comment on: http://stackoverflow.com/q/24945979
type: QuestionComment
type: Comment
has text: Is your C# app a wesite or other type of app? If webstie, do you want to save the file client side or server side?

http://stackoverflow.com/comment/38940826
type: AnswerComment
comment on: http://stackoverflow.com/a/24998412
type: Comment
score: 0
has text: It's a philosophical difference. AngularJS was founded on the principle that such a heavy focus on direct DOM manipulation was inefficient - a hack in its own right. The core devs tried their best to eliminate the need to do this. Avoiding jQuery isn't about jQuery itself - it's about the need to do things like $('.go-find-my-element').doSomethingToIt(). Your problem is back in that land they were trying to get away from, so a hack may be unavoidable.

http://stackoverflow.com/comment/38956887
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25045030
score: 1
has text: and also, the DI part of the spring will set the required attributes itself. you need not have to explicitly call setters. once you have the object in hand, and want to save the values, do it normally like you would for any other spring managed objects. it would work fine :)

http://stackoverflow.com/a/24947610
has body: This is not possible as-such. o would always be an object. The closest you could come would be custom toString method and casting o to a string or making the object a Function and call o like o(). Here are some option that get as close as JavaScript can get. Option 1: Making o a function object and calling it. var o = function(){ return "MyReturn"; }; o.SampleString = "My String"; o.MyMethod1 = function() {}; o.MyMethod2 = function() {}; Output &gt; o() &lt; "MyReturn" &gt; o.SampleString &lt; "My String" &gt; o.MyMethod1() &lt; function() {} Option 2: Custom toString method. var o = { toString: function(){return "MyReturn";}, SampleString: "My String", MyMethod1: function() {}, MyMethod2: function() {}, } Output &gt; String(o) &lt; "MyReturn" &gt; o.SampleString &lt; "My String" &gt; o.MyMethod1() &lt; function() {} In this second option, String(o) can be substituted for ""+o, o.toString(), or anthing that causes type-casting to a string.
downvote count: 0
score: 2
upvote count: 2
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24947425
answers question: http://stackoverflow.com/q/24947425
type: Answer

http://stackoverflow.com/comment/38931104
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25031955
has text: I already seen and implemented, but my requirement is to show text in a curve (arc shape), for eg. if i put the text over the bottle product it should like in arc shape or curved shape and it should looks like that its stick to that bottle as per the bottle shape

http://stackoverflow.com/q/25066796
tagged with: ibm-content-navigator
tagged with: javascript
has title: Navigator Plugin development - Session expiration
upvote count: 1
answer count: 1
favorite count: 0
has body: I'm working on a plugin for ICN and I've managed to have it log in automatically retrieving the username/password from a file by an id which is passed as a parameter in the url. Once a user has logged in there will be no need to relog, however after some time the 'session expiration' will kick in and even after reloading I can't get it to log in again. This might be due to the fact that I'm basing my decision on a single javascript object: ecm.model.desktop.connected. Right now if ecm.model.desktop.connected is false it will try to log in, this works well until the session expiration, which apparently does not set the ecm.model.desktop.connected to false, it's still set to true. So I'm hoping to learn a way to tell if the session has expired. This here is my login code: if (ecm.model.desktop.connected == false || ecm.model.desktop.userId != loginConfig[loginID].username) { var http2 = new XMLHttpRequest(); var url2 = "/navigator/logon.do"; var params2 = "userid=" + loginConfig[loginID].username + "&amp;password=" + loginConfig[loginID].password; http2.open("POST", url2, false); http2.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); http2.onreadystatechange = function() {//Call a function when the state changes. if (http2.readyState == 4 &amp;&amp; http2.status == 200) { } }; http2.send(params2); window.location.reload(); }
has answer: http://stackoverflow.com/a/25086081
accepted answer: http://stackoverflow.com/a/25086081
type: AnsweredQuestion
downvote count: 0
tagged with: filenet-p8
score: 1
type: Question

http://stackoverflow.com/q/24987572
tagged with: anchor
type: AnsweredQuestion
tagged with: scroll
type: Question
tagged with: hyperlink
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24987714
tagged with: jquery
has body: I have a list of dynamically created links that all should go to one anchor at the bottom of the page. Then the script opens up the 4th jQuery subtab. I have really strange behavior going on and would love it if someone could help me with it. Here is the code. Edit RP Edit RP Edit RP ...lots of these... So here is what it is doing. As soon as the page is loaded, no links except the first one works. The first time I click the first the screen flashs but I do not get any scrolling or anything. The page stays at the top. The second time I click the first it scrolls down to the anchor as you would expect(per js code). Then, all of the other links start working, but instantly move the page to the anchor and do not scroll. Only the first link scrolls down. Which you can click again and again, to get it to scroll. I see similar behavior in both Chrome and Firefox, though in Firefox it doesn't scroll. But on the second click of the first link it jumps down and the other links begin to work. This is so odd. I'm learning this stuff as fast as I can but this thing has me boggled. Please let me know what's going on and if you have any suggestions on how to fix this issue.
score: 0
answer count: 2
has answer: http://stackoverflow.com/a/24987714
has title: jQuery Smooth Scrolling for Many Links to 1 anchor
has answer: http://stackoverflow.com/a/25002865
accepted answer: http://stackoverflow.com/a/25002865

dom
tags question: http://stackoverflow.com/q/25013247
type: Tag
tags question: http://stackoverflow.com/q/24963015
tags question: http://stackoverflow.com/q/24953732
tags question: http://stackoverflow.com/q/24974683
tags question: http://stackoverflow.com/q/24970516
tags question: http://stackoverflow.com/q/24911773
tags question: http://stackoverflow.com/q/25030208
tags question: http://stackoverflow.com/q/24956424
tags question: http://stackoverflow.com/q/24965332
tags question: http://stackoverflow.com/q/25068844
tags question: http://stackoverflow.com/q/24974621
tags question: http://stackoverflow.com/q/25011456
tags question: http://stackoverflow.com/q/24962333
tags question: http://stackoverflow.com/q/25040204
tags question: http://stackoverflow.com/q/25062855
tags question: http://stackoverflow.com/q/25011762
tags question: http://stackoverflow.com/q/24964631
tags question: http://stackoverflow.com/q/25018179
tags question: http://stackoverflow.com/q/24927369
tags question: http://stackoverflow.com/q/25055431
tags question: http://stackoverflow.com/q/24986178
tags question: http://stackoverflow.com/q/24989114
tags question: http://stackoverflow.com/q/24917888
tags question: http://stackoverflow.com/q/24920186
tags question: http://stackoverflow.com/q/24947508
tags question: http://stackoverflow.com/q/24972488
tags question: http://stackoverflow.com/q/24966401
tags question: http://stackoverflow.com/q/24959692
tags question: http://stackoverflow.com/q/24928635
tags question: http://stackoverflow.com/q/24981946
tags question: http://stackoverflow.com/q/24956525
tags question: http://stackoverflow.com/q/24950208
tags question: http://stackoverflow.com/q/24985815
tags question: http://stackoverflow.com/q/24953582
tags question: http://stackoverflow.com/q/25037269
tags question: http://stackoverflow.com/q/24978316
tags question: http://stackoverflow.com/q/24921484
tags question: http://stackoverflow.com/q/24928320
tag name: dom
tags question: http://stackoverflow.com/q/25040337
tags question: http://stackoverflow.com/q/25068126
tags question: http://stackoverflow.com/q/24938235
tags question: http://stackoverflow.com/q/25010572
tags question: http://stackoverflow.com/q/24963729
tags question: http://stackoverflow.com/q/24949689
tags question: http://stackoverflow.com/q/25022999
tags question: http://stackoverflow.com/q/24977514
tags question: http://stackoverflow.com/q/24937616

http://stackoverflow.com/comment/38834191
score: 0
type: Comment
has text: I've added an answer, try that.
comment on: http://stackoverflow.com/q/24980691
type: QuestionComment

http://stackoverflow.com/comment/38943323
type: Comment
comment on: http://stackoverflow.com/q/25038765
has text: This isn't a stupid question... it's a question that shows that he doesn't understand what happens to his HTML after its parsed.
score: 0
type: QuestionComment

http://stackoverflow.com/comment/38820440
type: QuestionComment
has text: Well yes, but that's not the real* problem. The problem is using yield inside of a non generator function. Which ForEach will use 90% of the time. Not to mention _.find(), _.filter(), Array.reduce(), Array.forEach(), Array.map(). All of them are useless if you need to yield anything inside.
comment on: http://stackoverflow.com/q/24967314
type: Comment
score: 1

http://stackoverflow.com/comment/38846771
score: 0
has text: It is a webform, so this looks promising - but "-" wont get me far ;)
type: Comment
comment on: http://stackoverflow.com/a/24987356
type: AnswerComment

http://stackoverflow.com/a/24925092
answers question: http://stackoverflow.com/q/24923344
type: Answer
score: 8
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/24923344
has body: I will say Just one line and you will understand it. Cookies are always related to a website/domain. It does not make sense to ask if Chrome extension has a cookie. You can have a cookie for every domain. Some more information to help you solve your problem. If you see chrome extension model, you can see there are Background Scripts Content Scripts Popup Page/Scripts If you want to store cookie in a background script/ popup script, then you can definitely do it. But that cookie will be saved for the domain of your background script which is essentially your chrome extension id. If you store cookie in a content script, then you are storing information in cookie which belongs to the domain on which your content script is injected.
upvote count: 8

http://stackoverflow.com/comment/38872727
comment on: http://stackoverflow.com/a/25001335
score: 0
type: AnswerComment
has text: I removed these references, however, json and javascript object are the same thing, from the javascript runtime point of view.
type: Comment

http://stackoverflow.com/comment/38808441
type: AnswerComment
score: 1
comment on: http://stackoverflow.com/a/24963970
type: Comment
has text: +1 for the use of an object literal (which will be more efficient when there are more than two chars in the set to be replaced).

http://stackoverflow.com/comment/38804068
has text: I think we have all been there... Cheers!
comment on: http://stackoverflow.com/a/24962117
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24936734
answers question: http://stackoverflow.com/q/24919397
score: 0
type: Answer
has body: try with onclick event instead of onClientClick. May this will help !!!

http://stackoverflow.com/a/24958906
accepted answer of: http://stackoverflow.com/q/24958628
has body: Your call should return a promise. If there's a user, return the promise from getAnotherThing, otherwise, return the promise from $q.reject... getMeSomething: function() { var user = this.getUserData(); var sendPromise; if(user) { sendPromise = this._networkManager.getAnotherThing(user.id).then(function(response) { alert("And another response: " + response); // you probably want to return the data if successful (either response or response.data, depending on what response is) return response.data; }); } else { sendPromise = $q.reject({ message: 'Rejecting this promise' }); } return sendPromise; }
answers question: http://stackoverflow.com/q/24958628
type: AcceptedAnswer
downvote count: 0
type: Answer
score: 1
upvote count: 1

http://stackoverflow.com/q/24925755
tagged with: javascript
score: 0
answer count: 2
tagged with: event-handling
tagged with: jquery
has body: I want to change the font size of two divs when I click on a particular button however button click is not responding, pls help. I am using two div IDs in one selector. also pls let me know where is the error, below is my code. Example 2 Style Switcher Default Narrow Column Large Print A Christmas Carol In Prose, Being a Ghost Story of Christmas by Charles Dickens Preface I HAVE endeavoured in this Ghostly little book, to raise the Ghost of an Idea, which shall not put my readers out of humour with themselves, with each other, with the season, or with me. May it haunt their houses pleasantly, and no one wish to lay it. Their faithful Friend and Servant, C. D. December, 1843.
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: font-size
has comment: http://stackoverflow.com/comment/38730791
has title: Unable to increase font size on click of a button
has answer: http://stackoverflow.com/a/24927215
type: Question
has answer: http://stackoverflow.com/a/24925825

http://stackoverflow.com/q/24993989
possible better answer: http://stackoverflow.com/a/24994277
favorite count: 0
tagged with: ajax
has comment: http://stackoverflow.com/comment/38863745
upvote count: 4
has comment: http://stackoverflow.com/comment/38859088
downvote count: 0
has comment: http://stackoverflow.com/comment/38859184
has answer: http://stackoverflow.com/a/24994277
type: AnsweredQuestion
has title: Is AJAX really asynchronous?
has body: When you fire an ajax call, what we typically do in the browser side code is have a "xmlhttp" variable and check for status changes until the response is loaded, which means the client side maintains some sort of connections/thread to the server and the server responds via that connection back to the client. The only difference I see is that the page is not refreshed and that brings me to the very basic question, is ajax really asynchronous? Compared to JMS where the request is sent and there is absolutely no connection between the Client and Server and the response is sent via different thread initiated by the server. Isn't JMS really asynchronous. I'm confused. Can someone please clarify.
tagged with: javascript
has answer: http://stackoverflow.com/a/24994286
score: 4
type: Question
has comment: http://stackoverflow.com/comment/38858884
answer count: 3
has answer: http://stackoverflow.com/a/25011167
accepted answer: http://stackoverflow.com/a/25011167
has comment: http://stackoverflow.com/comment/38859012
tagged with: asynchronous

http://stackoverflow.com/q/24914935
has body: I want to use the cytoscape.js library for my project. But I cannot get it running. This is the example page I use. http://cytoscape.github.io/cytoscape.js/ I make a html document and include the library. But it does not visualize the example graph. I cannot even get my code in this post :S.
type: Question
tagged with: cytoscape.js
tagged with: javascript
has title: cytoscape simple startup not working
score: 0
has answer: http://stackoverflow.com/a/24916735
answer count: 1
type: UnansweredQuestion

http://stackoverflow.com/a/24948218
has body: Try to use the context i.e] $('selector',context), var x= "#content1"; var table = $('table', x); And the above code is very much similar to, var x= "#content1"; var table = $(x).find("table");
answers question: http://stackoverflow.com/q/24948196
type: Answer
score: 2
downvote count: 0
upvote count: 2

http://stackoverflow.com/comment/38766795
has text: @KeithNicholas, with `stripped` I don't mean truncated but rather not displayed.
comment on: http://stackoverflow.com/q/24944527
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38737436
type: Comment
has text: if all your code is inside a function, then you need a way to call/execute that functions. Either a click event, an onload event..something.
comment on: http://stackoverflow.com/a/24927857
score: 0
type: AnswerComment

http://stackoverflow.com/q/24981197
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24981425
has answer: http://stackoverflow.com/a/24981425
has comment: http://stackoverflow.com/comment/38834794
has comment: http://stackoverflow.com/comment/38834749
has comment: http://stackoverflow.com/comment/38834898
has comment: http://stackoverflow.com/comment/38834754
upvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38834842
has comment: http://stackoverflow.com/comment/38834862
score: 1
tagged with: math
accepted answer: http://stackoverflow.com/a/24981307
has body: I have an array list of values var v=[0.009865,0.009866,0.009309,0.009831,0.009919,0.009965,0.009806,0.009509,0.009731,0.009888]; I calculate the min,max and difference between the two to make the range var max=Math.max.apply(this,v)/100; var min=Math.min.apply(this,v)/100; var dif=max-min; console.dir({'max':max,'min':min,'dif':dif}); the console.dir shows max: 0.00009965 min: 0.00009308999999999999 dif: 0.000006560000000000005 Then I loop through each value attempting to convert them into percentages inside the range (by finding out how larger the current value is than the min, dividing the answer by the dif and multiplying the result by 100 to get the percent) for (var i=0;i&lt;v.length;i++){ v[i]=((v[i]-min)/dif)*100; console.log(v[i]); } the console.log shows values I really don't expect to see (expected between 0-100) 148962.04268292672 148977.28658536574 140486.43292682915 148443.74999999985 149785.21341463405 150486.43292682915 148062.65243902427 143535.21341463405 146919.35975609746 149312.65243902427 What am I doing wrong? My reference to the math: https://math.stackexchange.com/questions/51509/how-to-calculate-percentage-of-value-inside-arbitrary-range
has comment: http://stackoverflow.com/comment/38834661
answer count: 2
has comment: http://stackoverflow.com/comment/38834728
downvote count: 0
tagged with: javascript
has title: Math.min/max.apply set values as percent of new range
favorite count: 0
has comment: http://stackoverflow.com/comment/38834701
has comment: http://stackoverflow.com/comment/38834812
tagged with: range
has comment: http://stackoverflow.com/comment/38834772
has comment: http://stackoverflow.com/comment/38834634
has answer: http://stackoverflow.com/a/24981307
has comment: http://stackoverflow.com/comment/38834873
has comment: http://stackoverflow.com/comment/38834711

http://stackoverflow.com/comment/38992993
has text: Looks like XY problem; you're looking for the wrong solution. If it's going to take you forever to change classes to ids, then ask about how to fix your class problem. `getElementsByClassName` returns a collection, are you looping?
score: 2
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25065082

http://stackoverflow.com/q/25013763
has answer: http://stackoverflow.com/a/25014432
type: AnsweredQuestion
score: 1
upvote count: 1
accepted answer: http://stackoverflow.com/a/25014432
tagged with: angularjs-scope
type: Question
has answer: http://stackoverflow.com/a/25014475
downvote count: 0
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/25014475
has body: I have a JSON file returning a number of dates in such format: /Date(1235548800000)/ How can i filter this in my Controller to only return the year? I have tried: var filteredDate = $filter('date')($scope.ToDate, 'yyyy'); console.log(filteredDate); But console is displaying: /Date(1235548800000)/
answer count: 3
tagged with: angular-filters
has title: AngularJS - How to filter date in controller
has comment: http://stackoverflow.com/comment/38896715
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/25014692
has comment: http://stackoverflow.com/comment/38896696
has comment: http://stackoverflow.com/comment/38896632

http://stackoverflow.com/a/24966775
type: Answer
score: 2
answers question: http://stackoverflow.com/q/24964455
downvote count: 0
has comment: http://stackoverflow.com/comment/38824497
upvote count: 2
has body: toSting() JavaScript uses method toString() to represent text value. By default, the toString() method is inherited by every object descended from Object. If this method is not overridden in a custom object, toString() returns "[object type]", where type is the object type. Overwriting toSting() Method `toSting() can be overwritten as almost everything in JavaSctript $scope.arrayObjects = $scope.arrayStrings.map(function(s){ return { text: s, selected: true, toString: function() { return '{text: "' + s + '"}' // this will be returned instead of [object Object] } } });

http://stackoverflow.com/a/25051624
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/39022801
has comment: http://stackoverflow.com/comment/39007249
answers question: http://stackoverflow.com/q/25051575
has body: $(".link").click(function(e){ e.preventDefault(); $(".popup").fadeIn(300,function(){$(this).focus();}); }); $('.close').click(function() { $(".popup").fadeOut(300); }); $(".popup").on('blur',function(){ $(this).fadeOut(300); }); Demo Hope it works for you
accepted answer of: http://stackoverflow.com/q/25051575
has comment: http://stackoverflow.com/comment/39012820
upvote count: 1
has comment: http://stackoverflow.com/comment/38968293
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/39008785
type: Answer

http://stackoverflow.com/comment/38981029
type: AnswerComment
comment on: http://stackoverflow.com/a/25057872
has text: A syntax error should be caught as well (at least it does when I test it by evaling invalid code in the console).
score: 0
type: Comment

http://stackoverflow.com/comment/55042613
type: Comment
comment on: http://stackoverflow.com/a/25057795
has text: An adaptation of this code snippet fixed a similar problem for me. Thanks for the answer. :)
score: 1
type: AnswerComment

http://stackoverflow.com/q/24983479
has answer: http://stackoverflow.com/a/24983535
has title: trying to get the value of php into javascript
answer count: 3
tagged with: javascript
has comment: http://stackoverflow.com/comment/38839431
score: 0
has answer: http://stackoverflow.com/a/24983530
has body: I'm trying to get value of the $dateyearrange to put in yearRange: For example my $dateyearrange = 2001 then the yearRange:'dateyearrange:+0' should be yearRange:'2001:+0' but I can't seem to make it work Edit: the problem in my code is in yearRange:('dateyearrange:+0') If I put echo <?php $Dateyear ?> the code wouldn't execute because if I use yearRange:dateyearrange the ouput on the yearrange is only 2001 which is the code is working fine. so the problem in my code is in yearRange: What i wanted is to be shown in yearrange is 2001:+0 I'm so sorry for my english I can't really explain myself to it. EDIT 2:(Solution): I use yearRange:"<?php echo $DateYear ?>:+0" and removed var dateyearrange = "<?php $Dateyear ?>"; I just made my code more complicated I don't know why I go in that way. Thanks for the replies it helps me. <?php $DateYear = date("Y", strtotime($Datebirth)) ;?> var dateminimum = "<?php Echo($Datebirth); ?>"; var dateyearrange = "<?php $Dateyear ?>"; $(function() { $( "#datepicker" ).datepicker({minDate:dateminimum, maxDate:'0', yearRange:('dateyearrange:+0'), dateFormat: "yy-mm-dd",changeMonth: true, changeYear: true}); });
has comment: http://stackoverflow.com/comment/38839202
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38839169
tagged with: php
type: Question
has answer: http://stackoverflow.com/a/24983536
has comment: http://stackoverflow.com/comment/38839213

drupal
type: Tag
tags question: http://stackoverflow.com/q/24942509
tags question: http://stackoverflow.com/q/24961216
tag name: drupal
tags question: http://stackoverflow.com/q/25005440
tags question: http://stackoverflow.com/q/25038225
tags question: http://stackoverflow.com/q/24978972
tags question: http://stackoverflow.com/q/24970778

http://stackoverflow.com/comment/38890883
comment on: http://stackoverflow.com/q/24981849
has text: Sorry, I (personally) have no suggestions about chart.js And suggestion of competitor products are actually prohibited on this site :) Our product (see my profile) has options which you need, it could fit you.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/q/24994830
score: 0
tagged with: pug
has title: gulp-browserify error during compilation of jade in html
answer count: 1
has answer: http://stackoverflow.com/a/24996149
tagged with: javascript
tagged with: gulp
linked to: http://stackoverflow.com/q/24087791
type: AnsweredQuestion
has body: Sorry for possible mistakes in the writing - use the Google translator. I use the gulp-browserify gulpfile.js - gulp.task('jade', function(){ gulp.src('app/src/*.jade') .pipe(plumber(/*{ErrorHandler: notify.onError("&lt;% error.massage %&gt;")}*/)) .pipe(browserify({ transform: ['jadeify'], extension: ['.jade'] })) .pipe(rename('*.html')) .pipe(gulp.dest('app/dev')) }) error - [14:20:53] Plumber found unhandled error: SyntaxError in plugin 'gulp-browserify' /home/acopalipsis/proj/app/src/fake_723954d4.js:1 doctype html ^ ParseError: Unexpected identifie index.jade - doctype html html(lang="en") head meta(charset="UTF-8") title Test body Why the error? How to fix? ***********************************ADDED*********************************** Made - gulp.task('jade', function(){ browserify(['./app/src/index.jade']) .transform(jadeify) .bundle({debug:false}) .pipe(source('index.html')) .pipe(gulp.dest('app/dev')) }) But the generated html consists of 224 js code... Why? If you want to display this code, tell me, I'll show! ***********************************ADDED-PART-TWO*********************************** index.html after the task execution - And if I understand Your words, that this code is designed to display index.jade in the browser? But in the browser when opening index.html displays only the code is written below. (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&amp;&amp;require;for(var o=0;o&lt;r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ var jade = require("jade/runtime"); module.exports = function template(locals) { var buf = []; var jade_mixins = {}; var jade_interp; buf.push("&lt;!DOCTYPE html&gt;&lt;html lang=\"en\"&gt;…
accepted answer: http://stackoverflow.com/a/24996149
type: Question

http://stackoverflow.com/q/25045783
linked to: http://stackoverflow.com/q/10218534
has answer: http://stackoverflow.com/a/25049166
has comment: http://stackoverflow.com/comment/38959881
favorite count: 0
has answer: http://stackoverflow.com/a/25069279
tagged with: meteor
has comment: http://stackoverflow.com/comment/38961730
upvote count: 6
score: 6
has comment: http://stackoverflow.com/comment/38957770
has body: I am writing a piece of software that connects to a Meteor server via DDP to read data. The problem I am facing is figuring out how to differentiate between a NEW document getting added to a collection and getting notified about already-existing documents. When I first connect to the server, I get a series of added messages to populate the clientside collection. I don't know how to differentiate between those messages, and the ones that come later, indicating a new document was added live. This gets even worse when the DDP client needs to reconnect to the server, at which point all of the current documents are again sent as added messages.
type: AnsweredQuestion
tagged with: ddp
accepted answer: http://stackoverflow.com/a/25069279
type: Question
answer count: 2
has title: Meteor DDP: How to get notified when a NEW document is added to a Collection
downvote count: 0
possible better answer: http://stackoverflow.com/a/25049166
tagged with: javascript

http://stackoverflow.com/comment/38893069
comment on: http://stackoverflow.com/q/25011909
score: 0
type: Comment
type: QuestionComment
has text: @RobSchmuecker : Could you provide any reference example link?

http://stackoverflow.com/a/25063569
has body: You just need to have have a well built html table like this: HELLO WORLD Check the updated feedle
type: Answer
downvote count: 1
answers question: http://stackoverflow.com/q/25063416
score: 0
upvote count: 1

http://stackoverflow.com/a/24997953
downvote count: 0
score: 4
upvote count: 4
type: Answer
answers question: http://stackoverflow.com/q/24997901
has comment: http://stackoverflow.com/comment/38866329
has body: Try window.localStorage: var localStorage = window.localStorage; var foo = localStorage.getItem("bar"); // ... localStorage.setItem("bar", foo); The data can be any type supported by JavaScript, including strings, Booleans, integers, or floats. However, the data is actually stored as a string. So if you want to store object literals (as you might want to do within angular), you can use angular.toJson() and angular.fromJson(): var person = { name: 'jake' }; localStorage.setItem("person", angular.toJson(person)); var t = angular.fromJson(localStorage.getItem("person"))

http://stackoverflow.com/comment/38796599
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24960850
score: 0
has text: http://stackoverflow.com/questions/24939966/jquery-appended-content-not-clickable/24940012#24940012

media
tags question: http://stackoverflow.com/q/24910850
tag name: media
type: Tag

http://stackoverflow.com/q/24918038
has comment: http://stackoverflow.com/comment/38717677
tagged with: javascript
upvote count: 1
answer count: 1
favorite count: 0
tagged with: angularjs
has answer: http://stackoverflow.com/a/24918404
has comment: http://stackoverflow.com/comment/38718896
accepted answer: http://stackoverflow.com/a/24918404
type: AnsweredQuestion
downvote count: 0
score: 1
has body: I'm trying to move my template from being in-line to it's own file. Everything was working before I changed from template to templateUrl Glenn.directive('test', function($compile) { return { restrict: 'A', priority: 1000, terminal: true, templateUrl: function(tElement, tAttrs) { return ('test.html'); }, link: function(scope, element, attrs) { attrs.$set('editable-text', 'content.' + attrs.edit + '.data'); attrs.$set('edit', null); $compile(element)(scope); } } }); test.html {{ 'content.' + tAttrs.edit + '.data' }} edit Why isn't the tAttrs being passed to my template test.html?
has title: AngularJS directive pass parameters through templateUrl function
type: Question
tagged with: angularjs-directive

http://stackoverflow.com/a/25060666
answers question: http://stackoverflow.com/q/25060493
type: Answer
has comment: http://stackoverflow.com/comment/39005912
upvote count: 1
downvote count: 1
score: 0
has comment: http://stackoverflow.com/comment/39007188
has comment: http://stackoverflow.com/comment/39006338
has body: Why do you need to know the byte size of the input? Regardless, to calculate the byte size of a string in Javascript you can use: function stringSize(s) { return encodeURI(s).split(/%..|./).length - 1; } This assumes that you're using UTF-8. Not sure if this would work with other encodings.

http://stackoverflow.com/a/25033658
has comment: http://stackoverflow.com/comment/38934047
upvote count: 1
has comment: http://stackoverflow.com/comment/38934188
has comment: http://stackoverflow.com/comment/38936983
score: 1
has comment: http://stackoverflow.com/comment/38937154
answers question: http://stackoverflow.com/q/25033353
downvote count: 0
has comment: http://stackoverflow.com/comment/38937410
has body: You have to use the REST Google Places API. "Nearby Search Requests" Example: GET https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&amp;radius=500&amp;types=food&amp;name=cruise&amp;key=AddYourOwnKeyHere Documentation here
has comment: http://stackoverflow.com/comment/38937882
type: Answer
has comment: http://stackoverflow.com/comment/38934430

http://stackoverflow.com/q/24985079
answer count: 4
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38842266
upvote count: 1
has comment: http://stackoverflow.com/comment/38842186
type: Question
has answer: http://stackoverflow.com/a/24985198
has body: I have this code: for (i = 0; i &lt; 3; i++) { var interval = setInterval(function(){ alert(i); }, 2000); } What I would like to achieve is to have an alert every 2 sec displaying first 0, then 1 and lastly 2. Instead I have to wait for quite long before I have 3 alerts all displaying the number 3. Where is my code wrong?
tagged with: javascript
possible better answer: http://stackoverflow.com/a/24985145
has answer: http://stackoverflow.com/a/24985420
has answer: http://stackoverflow.com/a/24985145
accepted answer: http://stackoverflow.com/a/24985420
downvote count: 0
has answer: http://stackoverflow.com/a/24985280
score: 1
favorite count: 0
has title: Combine for loop with timing events in javascript

http://stackoverflow.com/comment/38878025
comment on: http://stackoverflow.com/q/25003949
score: 0
type: QuestionComment
type: Comment
has text: @XaxD that's for DOM not for my JSON array

http://stackoverflow.com/q/24990017
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38852241
has title: window.print() dialog not showing in Chrome wher it works fine in IE , Firefox and Safari
tagged with: printing
has comment: http://stackoverflow.com/comment/38851448
linked to: http://stackoverflow.com/q/24947993
answer count: 1
has body: Print dialog is not showing in Chrome var newWin = window.open("","",'width=0,height=0'); $.ajax({ type: "POST", async: true, url: '/BarcodePrintTest/PrintBarcodeLabel1', data: JSON.stringify(dataToSend), contentType: "application/json; charset=utf-8", dataType: "json", success: function (data) { if (data != "") { newWin.document.write('&lt;/head&gt;&lt;body &gt;'); newWin.document.write(JSON.stringify(data.replace(/\r\n/g, "&lt;br/&gt;"))); newWin.document.write('&lt;/body&gt;&lt;/html&gt;'); newWin.document.close(); newWin.resizeTo(0, 0); newWin.moveTo(0, window.screen.availHeight + 10); newWin.focus(); newWin.print(); // setTimeout(function () { newWin.close(); }, 1); newWin.close(); return false; // window.location = '@Url.Action("Create", "BarcodePrintTest")'; } newWin.close(); return false; }, error: function () { alert('Error in print'); } This is my code ... It is prompting print dialoge in Firefox,IE and Safari perfectly but didn't promt the dialog in chrome browser. Have gone through many threds but unable to produce solution.
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24990459
score: 0
has comment: http://stackoverflow.com/comment/38851428
has answer: http://stackoverflow.com/a/24990459
has comment: http://stackoverflow.com/comment/38851466
tagged with: google-chrome

http://stackoverflow.com/comment/38709145
has text: your question doeson't meet http://stackoverflow.com/help/how-to-ask
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24914217
type: Comment

http://stackoverflow.com/q/24926146
has comment: http://stackoverflow.com/comment/38733779
has comment: http://stackoverflow.com/comment/38732334
has comment: http://stackoverflow.com/comment/38733668
has comment: http://stackoverflow.com/comment/38734807
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: callback
tagged with: express
accepted answer: http://stackoverflow.com/a/24937632
tagged with: nodemailer
has comment: http://stackoverflow.com/comment/38732477
has comment: http://stackoverflow.com/comment/38733401
possible better answer: http://stackoverflow.com/a/38968765
has answer: http://stackoverflow.com/a/38968765
has comment: http://stackoverflow.com/comment/38734311
favorite count: 0
has comment: http://stackoverflow.com/comment/38733294
has comment: http://stackoverflow.com/comment/38733371
has comment: http://stackoverflow.com/comment/38734384
upvote count: 2
has comment: http://stackoverflow.com/comment/38734555
has comment: http://stackoverflow.com/comment/38734133
has comment: http://stackoverflow.com/comment/38734069
tagged with: node.js
has title: Nodemailer not working when sending email in a callback
has comment: http://stackoverflow.com/comment/38733524
score: 2
has body: Following is the code for sending an email via forget password hit, which is not working, however if the same code run via file it is sending an email..let me know what I am doing wrong with the callback usage. Following is the code, which is working but not sending an email - app.post('/forget', function(req, res){ var userEmail = req.body.email; User.findOne({email: userEmail}, function(err, user){ if (err) { res.send({"message": "Wrong!", "err": err, "status_code": "500"}); } else{ var password = "12345"; var smtpTransport = nodemailer.createTransport("SMTP",{ service: "Gmail", auth: { user: "XXXXX@gmail.com", pass: "YYYYY" } }); var mailOptions = { from: "Team | &lt;XXXXX@gmail.com&gt;", to: user.email, subject: "Password Change", text: "Hello world", html: "Your password changed successfully."+ "Your new password is "+ "&lt;style='color: red;'&gt;"+ password +"&lt;/style&gt;" // html body }; console.log(mailOptions); smtpTransport.sendMail(mailOptions, function(error, response){ if(error){ console.log(error); }else{ console.log("Message sent: " + response.message); } }); user.password = password; user.save(function(err){ if (err) return handleError(err); else return res.send({"message": "success", "data": user, "status_code": "200"}); }); } }); }); Error it is throwing - { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } FYI - I am using var nodemailer = require("nodemailer"); above the code so that is not the case. Working code - Now if I put the same code in a file and run via node mail.js command then mail sent successfully. Let me know what I am doing wrong here if any Working code (just a duplicate code ) var password = "12345"; var smtpTransport = nodemailer.createTransport("SMTP",{ service: "Gmail", auth: { user: "XXXXX@gmail.com", pass: "YYYYY" } }); var mailOptions = { from: "Team | &lt;XXXXX@gmail.com&gt;", to: user.email, subject: "Password Change", text: "Hello world", html: "Your password changed succe…
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38734788
has comment: http://stackoverflow.com/comment/38734615
has answer: http://stackoverflow.com/a/24937632

http://stackoverflow.com/comment/38881320
type: Comment
has text: @PHPglue I cleared my cache and tried again but that did not work.
comment on: http://stackoverflow.com/q/25005750
score: 0
type: QuestionComment

http://stackoverflow.com/q/24931070
type: AnsweredQuestion
score: 1
has body: I'm using the Three.js javascript library. To test it I downloaded the an example from here. I'm trying to display several times the same element using a for loop. There two questions related (1, 2) but it's not exactly what I want. My problem is that if I create the element inside the loop it will only display the last element of the iteration. In this particular case the element in position (12,12). But, if I do an action like an alert it will display all the elements. Also if I have any other functions that delays the execution. I saw some examples running, as the mrdoob examples, but I would like this code running because I need to load several mesh instead of generating primitive figures. // Set up the scene, camera, and renderer as global variables. var scene, camera, renderer; var group; // Call functions init(); animate(); // Sets up the scene. function init() { // Iterator var i, j; // Create the scene and set the scene size. scene = new THREE.Scene(); var WIDTH = window.innerWidth, HEIGHT = window.innerHeight; // Create a renderer and add it to the DOM. renderer = new THREE.WebGLRenderer({antialias:true}); renderer.setSize(WIDTH, HEIGHT); document.body.appendChild(renderer.domElement); // Create a camera, zoom it out from the model a bit, and add it to the scene. camera = new THREE.PerspectiveCamera(45, WIDTH / HEIGHT, 0.1, 20000); camera.position.set(0,20,20); scene.add(camera); // Create an event listener that resizes the renderer with the browser window. window.addEventListener('resize', function() { var WIDTH = window.innerWidth, HEIGHT = window.innerHeight; renderer.setSize(WIDTH, HEIGHT); camera.aspect = WIDTH / HEIGHT; camera.updateProjectionMatrix(); }); // Set the background color of the scene. renderer.setClearColor(0x333F47, 1); // Create a light, set its position, and add it to the scene. var light = new THREE.PointLight(0xffffff); light.position.set(-100,200,100); scene.add(light); group = new THREE.Object3D(); for(i=0; i &lt; 15; i+=3) { for(…
upvote count: 1
linked to: http://stackoverflow.com/q/20459588
type: Question
linked to: http://stackoverflow.com/q/20547365
tagged with: javascript
has answer: http://stackoverflow.com/a/24932093
answer count: 2
has title: display several times the same 3D object with three.js
downvote count: 0
favorite count: 0
possible better answer: http://stackoverflow.com/a/24932282
has answer: http://stackoverflow.com/a/24932282
tagged with: three.js
accepted answer: http://stackoverflow.com/a/24932093

http://stackoverflow.com/comment/38751887
type: QuestionComment
comment on: http://stackoverflow.com/q/24936937
has text: @DanRitchie but its not working.... my response text is false but the if loop is not executing.
score: 0
type: Comment

http://stackoverflow.com/a/53596700
type: Answer
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/115017425
downvote count: 0
answers question: http://stackoverflow.com/q/25060186
has body: RegEX will help you to extract date with Different Type of format and It returns as Array, let str="dd/mm/yyyy06/06/2018 yyyy/mm/dd 2018/02/12 d/m/yy 1/1/18 dd/mm/yy 18/12/12 mm/d/yyyy 12/2/2018 m/dd/yyyy 1/12/2018 yy/m/d 18/1/1 yy/mm/d 18/12/1 yyyy/2018/1/1"; str.match(/(\d{1,4}([.\-/])\d{1,2}([.\-/])\d{1,4})/g); Reference Link From regextester

http://stackoverflow.com/a/24980382
type: Answer
has comment: http://stackoverflow.com/comment/38847952
upvote count: 1
score: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24924926
has body: You can use datepicker to format the date for you : var myDate = '12-06-2014'; var myNewDate = $.datepicker.formatDate('ddmmyy', $.datepicker.parseDate( 'dd-mm-yy', myDate ) ); alert (myNewDate); achieves everything on one line and easily adapted for other formats should you need. to reflect your actual code, you would write: var myDate = document.getElementById("from_date").value; var strStartDate = $.datepicker.formatDate('ddmmyy', $.datepicker.parseDate( 'dd-mm-yy', myDate ) ); Jon

http://stackoverflow.com/comment/38864682
comment on: http://stackoverflow.com/q/24993797
score: 0
type: Comment
type: QuestionComment
has text: I don't know about a leak but "new Array(1000000).join('*')" is very expensive, it will give you a million (-1) *'s (why you need this I don't know)

http://stackoverflow.com/comment/38747386
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24934677
has text: I am posting the code ..pls take a look at it..
type: Comment

http://stackoverflow.com/comment/38947088
type: Comment
has text: No I don't know what's going sorry. Here's a thing I know but it may be totally unrelated: sometimes, submit buttons are disabled unless the user type something in a form input. To achieve this, an event listener *may* be added to this input and listen to "mouseup/mousepress" event. In your case, since you fill in the form programatically, there's no mouse event, so the JS event does not get triggered and the submit button is never disabled. Maybe you can try to see in your browser what's enabling the submit, and try to simulate this behavior using WatiN. Let me know if it helps :)
comment on: http://stackoverflow.com/a/25012872
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38786165
score: 0
type: AnswerComment
has text: You don't have to edit your code later, I already have solution by Shaunak D as answer above. Yea, I know that bug with tabs, I don't know what it could be, but I already get everything I wanted.
type: Comment
comment on: http://stackoverflow.com/a/24951513

http://stackoverflow.com/comment/38747378
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/24934699
has text: No - this is fine. `.each` is a synchronous function

http://stackoverflow.com/comment/38771014
comment on: http://stackoverflow.com/q/24941795
score: 0
type: QuestionComment
type: Comment
has text: Try using regexp: `$.ajaxPrefilter(function(options, originalOptions, jqXHR) { options.url = "http://localhost:" + ((options.url.search(/\.png|\.jpg/i) == -1) ? 3000 : 3001) + options.url; }`

http://stackoverflow.com/a/24960683
upvote count: 1
score: 1
has body: txt.people.length will give you the correct answer http://jsfiddle.net/rsBYb/6/
downvote count: 0
type: Answer
answers question: http://stackoverflow.com/q/24960645

http://stackoverflow.com/comment/38970009
score: 0
type: Comment
type: QuestionComment
has text: Can you highlight the question(s) here? There seems to be quite a few to be answered.
comment on: http://stackoverflow.com/q/25052758

http://stackoverflow.com/q/25030208
has comment: http://stackoverflow.com/comment/38944027
answer count: 1
downvote count: 0
has title: DOM manipulation on print only
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38944249
favorite count: 0
type: UnansweredQuestion
has body: I want to do $('#foo').insertAfter('#bar'); but only when the user prints the page. I don't want to do any scripting while on screen. I realize this would have been simple if I wanted to manipulate styles, because then I would have just used @media print {} in CSS. However the goal I am trying to achieve (DOM manipulation) cannot be achieved with CSS, hence I need to use JS. How can I run JavaScript (or jQuery) only when the user prints or does print-preview?
has comment: http://stackoverflow.com/comment/38927680
has comment: http://stackoverflow.com/comment/38927261
has answer: http://stackoverflow.com/a/25030422
has comment: http://stackoverflow.com/comment/38944759
upvote count: 1
linked to: http://stackoverflow.com/q/1234008
type: Question
score: 1
linked to: http://stackoverflow.com/q/11138939
tagged with: dom

http://stackoverflow.com/comment/38884044
has text: `What I often do is this:` So you often don't use the prototype chain? Why use 2 functions to create an instance? You can have myItemBuilder return the object literal with p0 and p1 in the closure scope of the object literal's methods.
type: Comment
comment on: http://stackoverflow.com/a/25003565
score: 0
type: AnswerComment

tumblr
tags question: http://stackoverflow.com/q/24977562
tags question: http://stackoverflow.com/q/24913478
tag name: tumblr
tags question: http://stackoverflow.com/q/24940318
type: Tag
tags question: http://stackoverflow.com/q/24980598

http://stackoverflow.com/comment/38874232
type: AnswerComment
type: Comment
score: 2
has text: Tested in Chrome, FireFox, and IE11. Works great with single and multiple paragraphs and tabbing focuses fine. Going back to h2 and hitting tab, goes back to the start. Maybe you should look into tabbing to the end of the block of HTML? Or not worry about tabbing to other places, as users will tab, see the caret and then move to where they want to edit anyway.
comment on: http://stackoverflow.com/a/24987431

http://stackoverflow.com/comment/38771293
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24947025
score: 0
has text: Well you guys are quick. I've only learnt Javascript/Jquery in the last month. Will have a go at creating a fiddle. And I do call changeStyle() in the HTML as a button.

http://stackoverflow.com/comment/38764537
type: QuestionComment
has text: @Tyblitz That just made sense to me. I'm new to jQuery/JavaScript. If you have a better method I'd love to hear it!
comment on: http://stackoverflow.com/q/24943316
score: 0
type: Comment

github
tags question: http://stackoverflow.com/q/25037827
tags question: http://stackoverflow.com/q/24960334
tags question: http://stackoverflow.com/q/24912259
tags question: http://stackoverflow.com/q/24934391
tag name: github
type: Tag
tags question: http://stackoverflow.com/q/25037216

http://stackoverflow.com/comment/38751982
type: Comment
has text: I can give it a try but im pretty sure im going in the wrong direction. *Added some code
score: 0
type: QuestionComment
comment on: http://stackoverflow.com/q/24937082

http://stackoverflow.com/comment/38999238
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25068084
has text: How you want handle errors and what kind of errors?

http://stackoverflow.com/comment/38718120
type: QuestionComment
comment on: http://stackoverflow.com/q/24918888
score: 0
has text: please post the specific code.
type: Comment

http://stackoverflow.com/q/25016381
tagged with: http://stackoverflow.com/tag/html
has body: I have created a popup that loads .php site using the jQuery plugin: bpopup. Problem is that plugin won't load website that is coded in php. Can someone told me where is problem? This is code that I am using: JavaScript: $('#leader').bind('click', function (e) { // Prevents the default action to be triggered. e.preventDefault(); // Triggering bPopup when click event is fired $('#leaderboard').bPopup({ modalClose: false, opacity: '0', positionStyle: 'fixed', //'fixed' or 'absolute' content: 'iframe', //'ajax', 'iframe' or 'image' contentContainer: '.content', loadUrl: 'http://remake.hr/memtest/leaderboard.php' //Uses jQuery.load() }); }); HTML: &lt;div id="leaderboard" class="info"&gt;&lt;/div&gt; &lt;div class="button" id="leader"&gt;&lt;/div&gt; CSS: .info { display:none; width:700px; background: rgb(38, 170, 225); /* Fall-back for browsers that don't support rgba */ background: rgba(38, 170, 225, .9); color:white; line-height: 35px; padding: 25px 50px 50px 25px; }
has comment: http://stackoverflow.com/comment/38901173
tagged with: iframe
upvote count: 1
tagged with: php
answer count: 1
accepted answer: http://stackoverflow.com/a/25016510
has title: jQuery popup (bPopup) fails to load iFrame
has comment: http://stackoverflow.com/comment/38901338
type: AnsweredQuestion
downvote count: 0
tagged with: javascript
score: 1
tagged with: jquery
has comment: http://stackoverflow.com/comment/38901438
favorite count: 0
type: Question
has answer: http://stackoverflow.com/a/25016510

http://stackoverflow.com/comment/38867776
type: Comment
comment on: http://stackoverflow.com/q/24998299
score: 0
type: QuestionComment
has text: What is the "publicly available URL" for the KML you are trying to load? The code posted doesn't attempt to load any KML.

http://stackoverflow.com/comment/38854285
has text: oh yes sorry there is a custom string library used which enhances the string prototype.
comment on: http://stackoverflow.com/q/24985467
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24926582
has body: It is clearly explained in error that Values must match the following regular expression: '[0-9]{4}-[0-9]{2}-[0-9]{2}|today|yesterday|[0-9]+(daysAgo) so you are allowed to use different words like today , yesterday or date in yyyy-mm-dd format. So you should keep same format while passing date. your format is yyyymmdd. You need to change it according to requirement.
has comment: http://stackoverflow.com/comment/38772514
score: 0
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/24926405
answers question: http://stackoverflow.com/q/24926405
type: Answer
has comment: http://stackoverflow.com/comment/38733137

http://stackoverflow.com/q/24914612
has title: Using JavaScript to Export to Excel and Filter/Frezze First Row - Sharepoint2007, DataView
downvote count: 0
favorite count: 0
type: UnansweredQuestion
tagged with: sharepoint-2007
has body: On a SharePoint2007 site I have create a page and inserted a DataView. I have also inserted a button that will export the DataView to Excel. This works great, however I want to freeze the first row and set auto filters on since they are the column headers. Please let me know if there is any code I can add in to make this possible. Export to Excel
tagged with: excel
answer count: 0
tagged with: dataviewwebpart
score: 1
upvote count: 1
type: Question
tagged with: javascript
tagged with: dataview

http://stackoverflow.com/q/24919053
tagged with: node.js
favorite count: 0
tagged with: karma-runner
upvote count: 1
has body: I am trying to run karma on a project, and its crashing on running the junit report, although it works with the same project in a similarly configured machinne. When trying to run karma start '&lt;path-to&gt;/karma.conf.js' --reporters junit --single-run --junitReporter.outputFile karmaoutpu And I am getting this traceback: INFO [karma]: Karma v0.12.17 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS INFO [PhantomJS 1.9.2 (Linux)]: Connected on socket fAqoa8mrX6WgaHTam1Ut with id 5898608 ERROR [karma]: [TypeError: Cannot call method 'push' of undefined] TypeError: Cannot call method 'push' of undefined at [object Object].onBrowserStart (&lt;project-path&gt;/node_modules/karma/lib/reporters/base.js:14:20) Checking that base.jsfile, I have this snippet: this.onRunStart = function() { this._browsers = []; }; this.onBrowserStart = function(browser) { this._browsers.push(browser); // &lt;this._browsers is undefined here!&gt; }; If I force the initiation of the this._browsers array inside onBrowserStart, I get other errors elsewhere - but this tells me that onRunStart is not being called - so I am probably missing some initialization. What could be that it fails, being that the same project, with the same versions of Node packages work in an Ubuntu system (I am on Fedora 20) The dots reporter plug-in, on the other hand, works flawlessly. Versions for karma, and karma related packages installed: karma 0.12.17 ├─┬ karma-chai@0.0.1 │ └── chai@1.6.1 ├── karma-chrome-launcher@0.1.4 ├─┬ karma-coffee-preprocessor@0.1.3 │ └─┬ coffee-script@1.7.1 │ └── mkdirp@0.3.5 ├── karma-firefox-launcher@0.1.3 ├── karma-html2js-preprocessor@0.1.0 ├── karma-jasmine@0.1.5 ├─┬ karma-junit-reporter@0.1.0 │ └── xmlbuilder@0.4.2 ├── karma-mocha@0.1.6 ├── karma-phantomjs-launcher@0.1.4 ├── karma-requirejs@0.2.2 ├── karma-script-launcher@0.1.0 ... ├─┬ phantomjs@1.9.2-2
type: AnsweredQuestion
tagged with: testing
score: 1
has title: karma junit report crashing
type: Question
has answer: http://stackoverflow.com/a/24939970
answer count: 1
downvote count: 0
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24939970

http://stackoverflow.com/comment/38905687
type: Comment
type: QuestionComment
has text: ' Next Page '
comment on: http://stackoverflow.com/q/24999422
score: 0

http://stackoverflow.com/comment/40314349
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25140992
has text: There is a follow-up to this question: [Project organization and naming conventions](http://stackoverflow.com/questions/25769920/project-organization-and-naming-conventions) - would really appreciate your insight. Thank you.
score: 0

http://stackoverflow.com/q/25040804
has body: I have a form in which the data is loaded in a dropdown list which has ng-model="placeid", Now when the user selects the data from the first ng-model I want it to display the parameter place.lat of the chosen option in the input box. So When the user selects the value from the list below Select a place {{place.name}} The latitude parameter should be display in the box below: In order to make it clear, the purpose of what I am doing is that in drop down there is a form which user can submit and input is part of the google map search.
score: 0
answer count: 1
tagged with: angularjs
type: UnansweredQuestion
has title: same ng-model to display two different parameters on two different input boxes
has answer: http://stackoverflow.com/a/25042001
type: Question
tagged with: javascript

http://stackoverflow.com/q/24949451
has body: In MongoDB, does .find({...}).limit(#) really limit the number of queries? I mean, when you do db.collection.find(condition), doesn't it already waste computational power to query all the results that match the given condition? If so, then does adding .limit() after it just strip off the unneeded elements from the query results? Thanks a lot for clarifying this up!
has answer: http://stackoverflow.com/a/25034115
tagged with: node.js
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/24949646
score: 3
tagged with: database
tagged with: javascript
has answer: http://stackoverflow.com/a/24949543
type: Question
upvote count: 3
tagged with: mongodb
answer count: 3
downvote count: 0
tagged with: mongoose
has title: MongoDB: truth behind find({...}).limit(#)
favorite count: 0

http://stackoverflow.com/comment/64149701
type: AnswerComment
has text: Thanks on the tons of information in this topic. Does anyone know how to take an intensity of the LUT into account in this JS implementation? I want to be able to choose the intensity with which the LUT is applied from 0 to 100 percent.
score: 0
comment on: http://stackoverflow.com/a/25252446
type: Comment

http://stackoverflow.com/comment/38873885
comment on: http://stackoverflow.com/q/25001739
score: 0
type: QuestionComment
has text: Also, this is an infinite loop in chrome as well, it just doesn't display a dialogue
type: Comment

iife
tags question: http://stackoverflow.com/q/24919590
type: Tag
tag name: iife
tags question: http://stackoverflow.com/q/25050782
tags question: http://stackoverflow.com/q/24977784

http://stackoverflow.com/comment/38795675
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/24960357
type: Comment
has text: I was writing an answer, but you beat me and I think you summarized better. I think the key thing this article is targeting is minimal websites, where there is a single page and very minimal amount of content.

http://stackoverflow.com/a/24999611
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24999501
has body: var global=0; var temp; function somefunction(){ global++; } function somefunctiontwo() { var x=temp; console.log(x); } somefunction(); temp=global; somefunctiontwo(); This will give what you expect. Pay attention on how/where you call the functions.

http://stackoverflow.com/q/25014591
has comment: http://stackoverflow.com/comment/38897930
has comment: http://stackoverflow.com/comment/38898240
type: Question
upvote count: 15
has answer: http://stackoverflow.com/a/25014731
downvote count: 0
tagged with: javascript
has title: JSON.stringify extra quotes
has comment: http://stackoverflow.com/comment/101707118
answer count: 1
favorite count: 0
accepted answer: http://stackoverflow.com/a/25014731
has comment: http://stackoverflow.com/comment/38898542
has comment: http://stackoverflow.com/comment/38898228
has body: Consider: var d = new Date(); var j = d.toJSON(); var s = JSON.stringify(d); console.log for each of the variables returns: Tue Jul 29 2014 13:27:19 GMT+0200 (W. Europe Summer Time) 2014-07-29T11:27:19.253Z // a string "2014-07-29T11:27:19.253Z" // same string as above but packed in "" I expected them to return the same thing, but then I read http://www.json.org/js.html: If the stringify method sees an object that contains a toJSON method, it calls that method, and stringifies the value returned. This allows an object to determine its own JSON representation. and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify: If an object being stringified has a property named toJSON whose value is a function, then the toJSON method customizes JSON stringification behavior: instead of the object being serialized, the value returned by the toJSON method when called will be serialized. For example: Does this mean that I always have to do something like: var d = new Date(); var j = d.toJSON(); var s; if (d.toJSON) { s = d.toJSON(); } else { s = JSON.stringify(d); } to ensure that s == j, since I can't rely on JSON.stringify not performing two serialisations? EDIT In light of jgillich's answer, the following code helps clarify things (for me at least): var s = "xxx" s = JSON.stringify(s) s = JSON.stringify(s) s = JSON.stringify(s) s = JSON.stringify(s) s = JSON.stringify(s) console.log(s) returns: ""\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"xxx\\\\\\\\\\\\\\\"\\\\\\\"\\\"\""" i.e. JSON.stringify returns not a string representation but rather a serialisation of an object. You'd think I'd realise that from the name and the presence of toString.
type: AnsweredQuestion
score: 15
has comment: http://stackoverflow.com/comment/38898282
tagged with: http://stackoverflow.com/tag/json

http://stackoverflow.com/q/24965181
possible better answer: http://stackoverflow.com/a/24965276
tagged with: http://stackoverflow.com/tag/html
tagged with: css
has title: sidebar double click instead of a single click
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24965235
accepted answer: http://stackoverflow.com/a/24965235
has body: I have an issue with my left side bar, i need to have my sidebar populated when it's clicked but when i run my code i have to double click on my "show menu" to get my menu...what am i doing wrong? $(document).ready(function () { var slider_width = $('.menucont').width(); //get width automaticly $('#pollSlider-button').click(function () { if ($(this).css("margin-right") == slider_width + "px" &amp;&amp; !$(this).is(':animated')) { $('.menucont,#pollSlider-button').animate({ "margin-right": '-=' + slider_width }); $(".menucont").show(); $(".showmenu").css("display", "none"); $(".hidemenu").show(); } else { if (!$(this).is(':animated')) //perevent double click to double margin { $('.menucont,#pollSlider-button').animate({ "margin-right": '+=' + slider_width }); $(".showmenu").show(); $(".menucont").hide(); $(".hidemenu").css("display", "none"); } } }); }); i also have a fiddle URL http://jsfiddle.net/6834Y/ any help would be greatful
type: Question
has answer: http://stackoverflow.com/a/24965276
tagged with: javascript
score: 0
answer count: 2
tagged with: jquery

http://stackoverflow.com/a/24972144
answers question: http://stackoverflow.com/q/24971906
has comment: http://stackoverflow.com/comment/38818802
has comment: http://stackoverflow.com/comment/38819448
has comment: http://stackoverflow.com/comment/38818779
upvote count: 2
has body: jsBin demo Just assign a class (like next-news) to your buttons (don't let your JS logic depend on Text, only an added whitespace might brake it) Prev Next and this is all you need: var $panel = $('.panel-slider .panel'), idx = 0; $(".prev-news, .next-news").click(function () { $panel.addClass("hide"); idx = ($(this).hasClass('next-news') ? ++idx : --idx) % $panel.length ; $panel.eq(idx).removeClass("hide"); });
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38819488
type: Answer
accepted answer of: http://stackoverflow.com/q/24971906
score: 2
downvote count: 0

http://stackoverflow.com/a/25011979
has comment: http://stackoverflow.com/comment/38893114
answers question: http://stackoverflow.com/q/25011909
has comment: http://stackoverflow.com/comment/38893172
has comment: http://stackoverflow.com/comment/38894777
has comment: http://stackoverflow.com/comment/38894673
has comment: http://stackoverflow.com/comment/38893178
has comment: http://stackoverflow.com/comment/38893234
has body: in 2.php the variable (POST using JS) can be accessed using $_POST['variable']; (in PHP). sessionVar (JS) in 1.php is undefined (JS), data can be accessed by response.sessionVar (JS) (from success:function(response){). In 2.php you have to print the data like echo json_encode(array('sessionVar' =&gt; $sessionVar)); (PHP). Update: To prevent confusion I pointed out wether the code parts are PHP or JS. Update: You can't expose data and a binary image in a response as there is no multipart response in common HTTP (not sure about SPDY). Either expose an image OR data, not both. What you can do is to base64 encode the image and output the image as part of the data: echo json_encode(array( 'image' =&gt; base64_encode($image), 'variable' =&gt; $someVariable), ); A different approach is not to use ajax but use phps include('2.php'); instead, then the variable is available in 1.php.
type: Answer
has comment: http://stackoverflow.com/comment/38894336
has comment: http://stackoverflow.com/comment/38894465
has comment: http://stackoverflow.com/comment/38893020
score: 0
has comment: http://stackoverflow.com/comment/38894501
has comment: http://stackoverflow.com/comment/38894616

http://stackoverflow.com/comment/39295955
comment on: http://stackoverflow.com/a/25044071
score: 0
has text: Thanks, this helped me figure it out!
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24912452
has answer: http://stackoverflow.com/a/24912738
has comment: http://stackoverflow.com/comment/38705434
type: UnansweredQuestion
downvote count: 2
has comment: http://stackoverflow.com/comment/38705519
score: -2
has title: Assigning and Summing Numeric value
type: Question
upvote count: 0
answer count: 1
has comment: http://stackoverflow.com/comment/38705613
tagged with: javascript
favorite count: 0
has body: I have created a form using Adobe Acrobat. The form includes 82 questions with five radio buttons each. Each button is named "a" through "e" (e.g., 1a, 1b, 1c, etc.). I need to assign a numerical value to each button: Strongly Disagree = 1 Disagree = 2 Neutral = 3 Agree = 4 Strongly Agree = 5 Then, I need to sum each question's numerical value. Logically, the sum function could be expressed as: (1a + 1b + ... + 82e = sum) What's the Java script syntax for this? Can anyone please help?

http://stackoverflow.com/q/24921768
tagged with: performance
has comment: http://stackoverflow.com/comment/38723893
has comment: http://stackoverflow.com/comment/38766189
has comment: http://stackoverflow.com/comment/38765931
has comment: http://stackoverflow.com/comment/38724704
has comment: http://stackoverflow.com/comment/38724186
tagged with: javascript
has comment: http://stackoverflow.com/comment/38789208
has comment: http://stackoverflow.com/comment/38724298
has comment: http://stackoverflow.com/comment/38723792
downvote count: 0
has body: I'm looking for a method for checking whether or not a javascript object has any properties on it, or not. The solution I've often seen for this looks something like this: var isObjectEmpty = function(obj) { for (var key in obj) { return false; } return true; } However, I've discovered that, though this appears like it should operate in constant time (returning after one iteration in the for loop), it actually operates in linear time, at least in Chrome. For an example, please observe this test: http://jsperf.com/empty-map-check-performance Is anyone aware of a method for checking the emptiness of a javsacript object that will operate in constant time in all browsers?
favorite count: 0
has comment: http://stackoverflow.com/comment/38724260
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38724010
answer count: 0
score: 1
upvote count: 1
tagged with: google-chrome
has comment: http://stackoverflow.com/comment/38724612
type: Question
has title: Is there a way to check if a javascript object is empty in constant time?

http://stackoverflow.com/q/25017922
has title: Soundcloud windget setVolume not working at all
type: UnansweredQuestion
upvote count: 1
linked to: http://stackoverflow.com/q/18329013
tagged with: widget
type: Question
has answer: http://stackoverflow.com/a/25018570
tagged with: soundcloud
downvote count: 0
answer count: 1
tagged with: javascript
score: 1
favorite count: 0
has body: Soundcloud widget is a great thing but volume control is completely broken. JS api calls to setVolume just ignored by player, tested in latest Chrome and Firefox. Broken volume control can be easily seen at official playground page - https://w.soundcloud.com/player/api_playground.html Some time ago there was workaround - SoundCloud Widget API setVolume Method broken? - but now even this hack does not work. Please fix widget API. without volume control it is almost unusable ( Btw, workaround is not ok anyway, since first second of loaded sound still playing at full volume, hiting site visitor with "overloaded" sound

http://stackoverflow.com/comment/38957251
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25045751
has text: Use OAuth2 protocol or social logins - you could look at this https://github.com/thinktecture/Thinktecture.IdentityServer.v3

http://stackoverflow.com/q/24912796
downvote count: 0
tagged with: javascript
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24916112
tagged with: google-maps-api-3
tagged with: google-maps-markers
possible better answer: http://stackoverflow.com/a/32018722
favorite count: 0
has answer: http://stackoverflow.com/a/32018722
upvote count: 3
linked to: http://stackoverflow.com/q/17283826
type: AnsweredQuestion
score: 3
has title: Google api v3 show nearby markers on customer road
has body: How can I show only the markers (they are predefined, but hidden for the whole map), which are nearby (may by radius of 10mile or 20mile) to the road I choose using Google api v3 for example I use Directions service HTML: start: end: JavaScript: var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { directionsDisplay = new google.maps.DirectionsRenderer(); var chicago = new google.maps.LatLng(41.891224, -87.638675); var mapOptions = { zoom:7, center: chicago } map = new google.maps.Map(document.getElementById('map'), mapOptions); directionsDisplay.setMap(map); /* === markers === */ var locations = [ ['1', 40.577651, -82.200443], ['2', 40.760976, -93.911868], ['3', 39.110017, -111.116458], ['4', 27.036116, -81.717045], ['5', 34.104058, -117.444583], ['6', 44.790790, -121.443607], ]; var marker, i; for (i = 0; i < locations.length; i++) { marker = new google.maps.Marker({ map: map, title: locations[i][0], position: new google.maps.LatLng(locations[i][1], locations[i][2]), //visible: false, //true for all, but hidden icon:'img/the_icon.png' }); } } function calcRoute() { var start = document.getElementById('start').value; var end = document.getElementById('end').value; var request = { origin:start, destination:end, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); } google.maps.event.addDomListener(window, 'load', initialize);
linked to: http://stackoverflow.com/q/19369363
type: Question
has comment: http://stackoverflow.com/comment/38706595
answer count: 2
has comment: http://stackoverflow.com/comment/38707197
has answer: http://stackoverflow.com/a/24916112
tagged with: google-maps

http://stackoverflow.com/q/24959305
tagged with: javascript
tagged with: jquery
linked to: http://stackoverflow.com/q/1732348
score: 0
has title: Accurately count number of links in PHP and Javascript
tagged with: http://stackoverflow.com/tag/html
answer count: 1
has comment: http://stackoverflow.com/comment/38794053
has comment: http://stackoverflow.com/comment/38793509
has body: I have a form that I am validating with JS on the front-end and PHP on the server side. What I need is a way to reliably count the number of links in an HTML string. The best way that I could think of was to count the closing tags. However simply searching for this tag will not work because the user could circumvent the validation by adding spaces like so: &lt;/a &gt;. I am fairly new to regex and this is the pattern that I have been able to come up with so far: &lt;[ \n\t]*\/[ \n\t]*a[ \n\t]*&gt; In Javascript: function link_count(s){ return s.match(/&lt;[ \n\t]*\/[ \n\t]*a[ \n\t]*&gt;/g, s).length; } In PHP: function count_links($str){ return preg_match_all('&lt;[ \n\t]*/[ \n\t]*a[ \n\t]*&gt;', $str, $matches); } Is this the best approach? Will it affect the performance of my form (the html string could be very long)? I am looking for the most efficient and reliable solution. Thanks in advance.
has comment: http://stackoverflow.com/comment/38793485
type: UnansweredQuestion
tagged with: php
tagged with: regex
has comment: http://stackoverflow.com/comment/38794393
has comment: http://stackoverflow.com/comment/38794348
has answer: http://stackoverflow.com/a/24959723
has comment: http://stackoverflow.com/comment/38800189
type: Question

http://stackoverflow.com/q/25037894
type: Question
has comment: http://stackoverflow.com/comment/38942803
has answer: http://stackoverflow.com/a/27489283
has comment: http://stackoverflow.com/comment/38941496
tagged with: javascript
answer count: 1
downvote count: 0
has title: Expand Items to max text length in Selectric Dropdown Menu
has body: I am trying to create a menu using jQuery and Selectric frameworks and I have run in to a problem that I need some help with. With this menu, I want to have the min width of the dropdown be the max-width of the largest text item in the drop down select. As it is now, I can have max and min widths preset, but I would like to have min width be the max width of the longest item. Thanks for the help in advanced Here's the code I am using: http://lcdsantos.github.io/jQuery-Selectric/
tagged with: drop-down-menu
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38942347
tagged with: css
score: 2
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/a/24998740
has body: The problem is simple but the explanation is less simple... Let us try anyway ! code modification : var tstart = new Date(row[3]); Logger.log('hour only = '+tstart) tstart.setDate(date.getDate()); Logger.log('setDate = '+tstart) tstart.setMonth(date.getMonth()); Logger.log('setMonth = '+tstart) tstart.setYear(date.getYear()); Logger.log('setYear = '+tstart) As you see, I added a couple of Logger.log in your code and notice a difference in time value like shown below [14-07-28 16:18:53:441 BST] hour only = Sat Dec 30 1899 10:00:00 GMT-0000 (GMT) [14-07-28 16:18:53:442 BST] setDate = Fri Dec 29 1899 10:00:00 GMT-0000 (GMT) [14-07-28 16:18:53:442 BST] setMonth = Sat Jul 29 1899 10:00:00 GMT+0100 (BST) [14-07-28 16:18:53:442 BST] setYear = Tue Jul 29 2014 10:00:00 GMT+0100 (BST) When you create the date object with hours only, the date is logically december 30 1899 which is in winter.(december 30 1899 is the "epoch" used as reference in JS date) Then you set the date (still in december) and then the month which is July and July is obviously in summer... as you can see in the logger, the date object has switched from GMT to BST (british summer time I guess ?) and from there it is 1 hour later. To solve that you have a few possibilities, the simplest one would be to combine time and date in the spreadsheet itself, this would create a complete date object that wouldn't need any change. If you can't (or don't want) to change your SS layout I guess the easier way would be to convert your time value to a string using Utilities.formatDate() and parse this string into integer values to get hours and minutes. You'll have to change a bit the sequence order of your date manipulations but from what I see of your coding skills that should not be a problem. Hoping my explanation was clear enough ;)
accepted answer of: http://stackoverflow.com/q/24995581
type: Answer
upvote count: 1
score: 1
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/24995581

http://stackoverflow.com/q/25002104
favorite count: 0
type: UnansweredQuestion
score: 1
has answer: http://stackoverflow.com/a/29982790
type: Question
has title: How to hide REST API methods in LoopBack 2.0?
tagged with: javascript
upvote count: 2
has comment: http://stackoverflow.com/comment/38887053
tagged with: loopbackjs
answer count: 1
downvote count: 1
has body: I haven't managed to hide API methods in LoopBack 2.0. According to the documentation, I should achieve this with something like: var app = require('../app'); var Location = app.models.Location; Location.deleteById.shared = false; Howver, this doesn't seem to work. Also, console.log(Location.deleteById) prints: [Function] If deleteById is a function and not an object, then the assignment to the shared property makes no sense. No surprise then, that console.log(Location.deleteById.shared) prints: undefined Any clues, anybody?

http://stackoverflow.com/comment/38951688
has text: Create a new post. You'll get a much better response that way (others will be able to see it)
comment on: http://stackoverflow.com/a/25042993
type: AnswerComment
type: Comment
score: 1

http://stackoverflow.com/comment/38849324
type: Comment
type: QuestionComment
has text: thanks guys all you suggestion works for me
comment on: http://stackoverflow.com/q/24988512
score: 0

http://stackoverflow.com/comment/38820248
score: 0
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/24973159
has text: @blex can you edit my code in fiddle and give the code to me?

http://stackoverflow.com/q/25015548
possible better answer: http://stackoverflow.com/a/25015730
tagged with: string
has title: Why won't jQuery's .text() recognize \n?
accepted answer: http://stackoverflow.com/a/25015584
type: AnsweredQuestion
score: 0
tagged with: formatting
type: Question
answer count: 2
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25015730
has answer: http://stackoverflow.com/a/25015584
has body: I am trying to print html text on a page. Right now I am doing $("#generate_html_button").click(function(){ var generated_html_text = $("#visual_form").html(); $("#generated_html_text").text(generated_html_text);//generated_html_text is just a element }); If I print the generated_html_text to the console it will come out looking like dropdown Option 1 Option 2 the console will use the proper forming. When I use .text() to print the text to my page, it ignores the \n and just prints it in one long line. dropdown Option 1 Option 2 Most suggest using .replace(), but when I tried generated_html_text = generated_html_text.replace(/\n/g, ' '); but that will produce the same result just with everywhere without the formatting, and I am trying to avoid having s in my output. I have also tried changing .text() to .html() but then it just renders the elements. Why won't .text() recognize the existing \n?
tagged with: http://stackoverflow.com/tag/html

http://stackoverflow.com/a/24965866
score: 1
has body: It sounds like you want to use the output of your first call to emailsAPI for your second call to syncAPI. In order to achieve this put the call to syncAPI in your success callback for emailsAPI like so: var crmApp = angular.module('crmApp', []); crmApp.controller('EmailsCtrl', function($scope, $http) { var getReadStatus = function(emails) { $scope.emails=emails; for(var i = 0; i &lt; emails.length; i++) { $http.get('http://local.app.com:8080/imap/syncAPI?emailsId=' + emails[i].EmailsID + '&amp;mailbox=inbox', {withCredentials: true}).success(function(unreadD) { $scope.emails[i].Unread = unreadD; }); } } $http.get('http://local.app.com:8080/emailsAPI', {withCredentials:true}).success(function(data) { getReadStatus(data); }); } The getReadStatus function here will assign all of the emails recieved from the first API call to the same variable as before ($scope.emails) it will then cycle through each email object, and use the EmailsID property to call the second API. Finally it will add a property called Unread to each email object allowing it to be accessed correctly from the template.
upvote count: 1
has comment: http://stackoverflow.com/comment/38806364
downvote count: 0
answers question: http://stackoverflow.com/q/24965723
has comment: http://stackoverflow.com/comment/38806271
has comment: http://stackoverflow.com/comment/38806400
type: Answer

http://stackoverflow.com/comment/38720411
score: 0
comment on: http://stackoverflow.com/a/24920040
type: Comment
type: AnswerComment
has text: Yeah!That worked like a charm.But I wan't to know what exactly is there before and after the text..whitespaces?

http://stackoverflow.com/q/24972416
has comment: http://stackoverflow.com/comment/38829725
tagged with: javascript
tagged with: jquery
has title: Prevent script from running with jQuery / Greasemonkey?
linked to: http://stackoverflow.com/q/3972038
duplicate of: http://stackoverflow.com/q/3972038
downvote count: 0
has body: Is there any way of preventing some script from running with jQuery? For example if the website has HTML: &lt;script src="annoyingscript.js"&gt;&lt;/script&gt; Is there any possibility to trigger .remove() for that script-tag before Firefox runs the script or does anything with it ? Basically I wish to create similar behaviour that adblock does, but I'm using Greasemonkey instead.
favorite count: 0
type: UnansweredQuestion
answer count: 0
score: 1
has comment: http://stackoverflow.com/comment/38827127
upvote count: 1
has comment: http://stackoverflow.com/comment/38818876
type: Question
tagged with: greasemonkey
tagged with: firefox

http://stackoverflow.com/comment/38854726
has text: @somethinghere: It is a new feature that was released in Chrome 36: http://www.chromestatus.com/features/5770237022568448; demo with API: http://demo.agektmr.com/dialog/
type: AnswerComment
comment on: http://stackoverflow.com/a/24991135
score: 0
type: Comment

http://stackoverflow.com/a/25035369
type: Answer
answers question: http://stackoverflow.com/q/25035321
has body: Because you have this console.log("looopChecked"); after the if condition.And after that you have the else condition which is not a valid one.The else part must be placed immediately after the if condition.So you must change this if (checked){ $(this).text('Uncheck All'); } console.log("looopChecked"); else { $(this).text('Check All'); } to this if (checked){ $(this).text('Uncheck All'); } else { $(this).text('Check All'); } And keep logging into the console either before of after the condition checking or do it either inside your if condition or inside the else condition will solve the error.
score: 4
upvote count: 4
downvote count: 0

http://stackoverflow.com/comment/38746172
type: Comment
comment on: http://stackoverflow.com/a/24933773
has text: then we can enable all the options first then we'll try to disable it.
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38832725
type: AnswerComment
comment on: http://stackoverflow.com/a/24979846
type: Comment
has text: Thanks for your answer. The original text does not contain any '\r' or '\n'. The word breaking is only controlled by CSS.
score: 1

http://stackoverflow.com/comment/38771894
type: QuestionComment
comment on: http://stackoverflow.com/q/24947331
score: 0
type: Comment
has text: Not sure what is going on in that code since it is weird, but Did you think about trying `this[functionName]` ????

http://stackoverflow.com/comment/38840438
type: Comment
type: AnswerComment
score: 1
has text: That link to the $q API was much appreciated. This worked perfectly. Thanks! I'm going to go research deferred objects and promises more now, so that I don't have to repeat this kind of question.
comment on: http://stackoverflow.com/a/24984001

http://stackoverflow.com/comment/38829506
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/24950382
has text: Using Firebase inside of a factory is more complicated than what you would usually do. Firebase constantly pushes out data to the client, so you have to be able to keep this open channel. I'm not saying any of your previous examples wouldn't have worked at a generic level. However, they wouldn't have worked at all with Firebase, which is a requirement from the OP.

http://stackoverflow.com/q/24934523
has title: How can I add withCredentials to existing jquery.get statements
upvote count: 3
has body: I have written my application in javascript and jquery and have made extensive use of jquery.get, jquery.post and jquery.when. This works fine testing on my localhost, but now I need to connect to an api on another server I find I have to add xhrFields: { withCredentials: true }, to all my http requests. Is there any way I can include this in my jquery.get statement, or do I have to convert them all to jquery.ajax statements?
type: Question
tagged with: javascript
tagged with: jquery
tagged with: ajax
answer count: 1
favorite count: 0
has comment: http://stackoverflow.com/comment/38747270
has answer: http://stackoverflow.com/a/24934738
type: UnansweredQuestion
downvote count: 1
score: 2

http://stackoverflow.com/comment/101870194
comment on: http://stackoverflow.com/a/24977494
type: Comment
has text: @Alberto Except if you are not programming for browsers
score: 5
type: AnswerComment

http://stackoverflow.com/comment/38904945
comment on: http://stackoverflow.com/a/25018082
score: 0
type: Comment
has text: @João ok, use `filter` instead of `find` method. See example: http://jsfiddle.net/ex8Hk/
type: AnswerComment

http://stackoverflow.com/a/24964616
type: Answer
has comment: http://stackoverflow.com/comment/38804252
has comment: http://stackoverflow.com/comment/38804288
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24963889
score: 0
has body: $.click() is a direct binding in jQuery which only works on elements in the DOM on page load. Try using a delegated binding instead, such as $.on(): $(body).on('click', '.corregir', function(e) { e.preventDefault(); alert('aqui toy'); }); Check out the .on() jQuery Documentation.
accepted answer of: http://stackoverflow.com/q/24963889

http://stackoverflow.com/comment/38906265
score: 0
has text: better to use event selectionchange, but for unsupported browsers use other events: mouseup, drugend, touch, keyup (for shift+right and other keyboard methods of selection modifications, but only for unsupported browsers )
type: Comment
comment on: http://stackoverflow.com/a/25018940
type: AnswerComment

http://stackoverflow.com/comment/38909751
comment on: http://stackoverflow.com/a/25020853
has text: I am using namespace, but all instances have the same namespace :|
type: AnswerComment
score: 0
type: Comment

http://stackoverflow.com/comment/38895326
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25012952
score: 0
has text: Fiddle with images: http://jsfiddle.net/StephanWagner/ZssxL/ I also don't see what youd like to achieve

http://stackoverflow.com/a/24995692
score: 1
accepted answer of: http://stackoverflow.com/q/24995577
has body: By the looks of things you're passing in an array containing an object. You just need to access the Today value. d3.csv("OrderValueToday.csv", function(obj) { var text = 'Total sales today = '; var totalSales = text + obj[0].Today; svgLabel = d3.select("#label").append("h2") .text(totalSales); });
has comment: http://stackoverflow.com/comment/38863180
answers question: http://stackoverflow.com/q/24995577
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38862251
upvote count: 1
type: Answer
downvote count: 0

http://stackoverflow.com/comment/38936660
has text: also why are you doing `substring(4)` as far as I can see the id of your del is `1` so that substring wouldn't work. Perhaps you should be using data-attributes rather than multiple same ids
comment on: http://stackoverflow.com/q/25035251
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/39181815
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24916444
has text: Yes, that's what I'm getting at. In your answer it says `What <ever> you & want;` not `What <ever> you & want except single quote unless encoded;` - that's why it is OK if already safely in a variable, but not if you are putting whatever you want between two quote characters.
type: AnswerComment

http://stackoverflow.com/comment/38868523
has text: More like `browserify -d app/index.js > app/bundle.js`
comment on: http://stackoverflow.com/q/24999068
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25059583
type: Answer
has body: Instead of invoking some javascript from HTML, contain that logic in your JS instead. Example: (function() { var footerBox = document.querySelector('footer_box'); [].forEach.call(document.querySelectorAll('.store.box'), function(el){ el.addEventListener('click', function(e) { footerBox.innerHTML = e.target.dataset.type; }, false); }); })();
answers question: http://stackoverflow.com/q/25059481
score: 0

http://stackoverflow.com/q/25008083
accepted answer: http://stackoverflow.com/a/25069722
has comment: http://stackoverflow.com/comment/38892333
has body: I am using bootstrap tabs and dropdown with prev next functionality Before Starting the Application Before Starting the Application Who Can Apply? Application Details Applicant Details Premises Details Details of Personal License Holder Fees and Payments Checklist Conditions Submit Tab 1 Tab 2 Tab 3 Tab 4 Tab 5 Tab 6 Tab 7 To find anchor tag...for prev next $('.btnNext').click(function () { $('.nav-tabs > .active').next('li, li > ul > li').find('a').trigger('click'); }); $('.btnPrevious').click(function () { $('.nav-tabs > .active').prev('li').find('a').trigger('click'); }); But from the script i didn't find all the anchor tag means anchor tag inside the dropdown (li > ul > li > a ) Application Details Applicant Details Premises Details Details of Personal License Holder I want to find each anchor tag from nav-tabs for prev and next function. Thanks in Advance.
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25069722
score: 0
answer count: 1
has title: prev next function for nested tabs in bootstrap
tagged with: twitter-bootstrap
tagged with: css
type: AnsweredQuestion
tagged with: twitter-bootstrap-3
type: Question

http://stackoverflow.com/comment/38855309
comment on: http://stackoverflow.com/q/24991855
score: 0
type: Comment
type: QuestionComment
has text: looping until over is set at true within the callback of the trigger the idea is to prevent the return elem until the span has been added

http://stackoverflow.com/a/67661199
type: Answer
answers question: http://stackoverflow.com/q/24909819
score: 0
has body: you should do a condition first to load bootstrap rtl only on language that you need to. then make a custom style with these changes , please make sure to call this custom style only when you need it, 'cause will cause you incompatible with ltr. .carousel-item { margin-right: initial; } .carousel-control-next { right: initial; }

http://stackoverflow.com/a/25175879
upvote count: 3
accepted answer of: http://stackoverflow.com/q/25010563
answers question: http://stackoverflow.com/q/25010563
type: AcceptedAnswer
downvote count: 0
has body: Perhaps not best practise, but I eventually solved the problem by directly editing the stream object: setInterval(function(){ //check if criteria has changed if(stream.params.track != searchStr){ console.log("Reconnecting with " + searchStr); stream.stop(); stream.params.track = searchStr; stream.start(); } else { console.log("Criteria unchanged"); } },60*5*1000);
score: 3
has comment: http://stackoverflow.com/comment/82351710
type: Answer

http://stackoverflow.com/comment/38707469
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24913221
has text: Not if I knew *why* it crashed (as opposed to not knowing *why* the site "isn't loading properly"). Good point though; it's true that "a simple advisory message" would help, but if it is so optional why have the "optional" feature at all? :P
score: 0

http://stackoverflow.com/comment/38828710
has text: I think you're now asking about how to access the parameters passed from Angular on the server? If so, I think that's a separate question and so better to open a new question rather than continuing this discussion here. I'm happy to answer your new question if you make a new question page for it and post a link to it here.
type: Comment
comment on: http://stackoverflow.com/a/24977659
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38793410
type: AnswerComment
has text: @cubanGuy, That's because in your original markup thead and tbody were messed up - see my jsfiddle, markup is correct there.
type: Comment
comment on: http://stackoverflow.com/a/24958702
score: 1

http://stackoverflow.com/comment/38721357
score: 0
type: Comment
type: QuestionComment
has text: are you certain that your external script file is loading? check your network tab to confirm.
comment on: http://stackoverflow.com/q/24919110

http://stackoverflow.com/comment/38917461
has text: You'd need to adjust the selector for the next input as following: `input.nextAll('input:first')` (see http://jsfiddle.net/r595Y/3/).
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25024532
type: Comment

http://stackoverflow.com/comment/38931666
comment on: http://stackoverflow.com/q/25024734
has text: While @dandavis is correct, you can catch MANY cases of the person trying to navigate away from the page through links and forms by using event delegation on the document. It won't catch someone navigating away through the back/forward buttons, bookmarks and typing into the address bar.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/comment/38943184
has text: maybe correct http://jsfiddle.net/z4VJq/482/
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25035738

http://stackoverflow.com/a/24980648
downvote count: 0
has comment: http://stackoverflow.com/comment/38838726
has comment: http://stackoverflow.com/comment/38842297
type: Answer
has body: I think the problem is that you are actually CALLING the error-handler instead of just passing it into the prepareQuery-function - and since you are calling it without parameters, the error itself is undefined. Try it like this: prepareQuery('SELECT name FROM Lists WHERE id=(?)', [$scope.listId], listnameResultHandler, defaultErrorHandler); prepareQuery('SELECT * FROM Products', [], defaultResultHandler, defaultErrorHandler);
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24980341

http://stackoverflow.com/comment/38738873
type: QuestionComment
type: Comment
has text: What is generating '29 July, 2014, 30 July, 2014, 31 July, 2014' ?
comment on: http://stackoverflow.com/q/24930243
score: 0

http://stackoverflow.com/comment/53419224
comment on: http://stackoverflow.com/a/24987241
score: 1
has text: @Filippos This particular jsbin eg can confuse new users because it uses the same name for component action and internal 'button click' event handler. Think component as a black box which is intended to be isolated from the rest of application. Component actions can be considered as components API and they merely holds string names of externally implemented javascript fucntions. A component does not handle an action but 'sends' an action to the external world. See this modified jsbin if it makes sense to the above description - http://emberjs.jsbin.com/muyerisojo/edit?html,js,console,output
type: AnswerComment
type: Comment

http://stackoverflow.com/a/24912284
has comment: http://stackoverflow.com/comment/38707739
answers question: http://stackoverflow.com/q/24911626
has comment: http://stackoverflow.com/comment/38706460
upvote count: 7
type: Answer
has comment: http://stackoverflow.com/comment/38706506
has comment: http://stackoverflow.com/comment/38706282
score: 7
has comment: http://stackoverflow.com/comment/38707365
type: AcceptedAnswer
downvote count: 0
has body: Hi it looks like you miss something please see here: http://plnkr.co/edit/1PpscI4dOMYpYRf6fbUS?p=preview angular.module('mySceApp', ['ngSanitize']) .controller('AppController', ['$http', '$scope', '$sce', function($http, $scope, $sce) { $scope.image = {}; $http.get("test_data.json").success(function(data) { console.log(data.url); // $scope.userComments = userComments; $scope.image.url = $sce.trustAsResourceUrl(data.url); }); } ]); HTML: Example - example-example64-production {{userComments.name}}:
accepted answer of: http://stackoverflow.com/q/24911626

http://stackoverflow.com/comment/38699590
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24909498
has text: Can you create a JSFiddle example of your problem?
score: 0

http://stackoverflow.com/q/24938975
type: Question
answer count: 1
tagged with: javascript
has title: CRM 2013 Javascript N:N AssociateObjects not working
score: 0
has answer: http://stackoverflow.com/a/25090441
type: UnansweredQuestion
tagged with: crm
has body: We are migrating from CRM 2011 to CRM 2013, both on-premise version. We have a ribbon customization on the Case form using javascript that loads up a custom Lookup view of N:N associated Account entity. From this custom lookup view, users can associate the selected Account records with the current Case. For some reason this function is not working anymore in crm 2013. The custom Lookup view is still loaded up correctly, however for some reason the Account records are not getting associated with the parent Case record anymore. I read another question about this which was resolved using the link below by Paul Nieuwelaar: http://www.magnetismsolutions.co.nz/blog/paulnieuwelaar/2014/04/21/filter-n-n-add-existing-lookup-dynamics-crm-2013 Basically the ‘LookupObjects’ function is not working anymore in CRM 2013 and must be replace by ‘LookupObjectsWithCallback’. However even after following this solution I'm still not able to associate the Account records to the Case. Here is my code below that I have modified to follow Paul Nieuwelaar's suggestion. Am I missing something here? I even included in the code if the CRM 2011 version is still using Rollup 12, just in case. I have a feeling this is probably because the parent Case was not picked up properly in the script. Thanks, any help is greatly appreciated. -elisabeth function openAddLookupDialog(gridTypeCode) { var relName = "new_account_incident"; var roleOrd = 2; var viewId = "{00000000-0000-0000-00AA-000010001002}"; //dummy view ID if (!IsNull(relName)) { var customView = { fetchXml: "{...}", //my FetchXML id: viewId, layoutXml: "{...}", //my layoutXml name: "Filtered Lookup View", recordType: gridTypeCode, Type: 0 }; var parent = GetParentObject(null, 0); var parameters = [gridTypeCode, "", relName, roleOrd, parent]; var callbackRef = Mscrm.Utilities.createCallbackFunctionObject("locAssocObjAction", this, parameters, false); //pops the lookup window with our view injected var lookupItems = LookupObjectsWithCallback(ca…

http://stackoverflow.com/a/25039644
type: Answer
answers question: http://stackoverflow.com/q/25039064
has comment: http://stackoverflow.com/comment/38954597
score: 0
has comment: http://stackoverflow.com/comment/38948025
has comment: http://stackoverflow.com/comment/38948608
has body: Perhaps you should insert the element into the dom before setting the value. Not sure if this works, try it and let me know. $('&lt;input type="date" id="#someDate"&gt;').appendTo("#someDiv").val("2014-07-31"); or you could try $('#someDate').val("2014-07-31"); if appendTo doesn't chain. Also, the input type is readonly, so setting the attribute on the element may not work correctly.

http://stackoverflow.com/q/24959703
has title: Backbone collection missed few models while adding models
type: Question
tagged with: javascript
has comment: http://stackoverflow.com/comment/38799463
tagged with: marionette
has comment: http://stackoverflow.com/comment/38795719
has body: I am new to backbone; i am also using marionette. but this case is related to backbone collection. Issue is while page loading; it only adds one models while rest are missed. For more info see the image; in editor part; left side; blue circle mark is where issue is created in console; right side red Circle mark; 1st one printed while loading the page; and 2nd one i have created myself; for that i have copied the "temp_ll" to some global variable so that it can come in the console. and this is marked in green square; see both are same when i add models to the collection in console; it adds all three models; while missed two models while loading the page. is this related to my programming mistake?? or else??? i am using Jquery 1.9.1, underscore 1.4.4, backbone 1.0.0, marionette v1.0.3 Sample data : { "axislist": [ "None" ], "axisdata": [ { "memberlist": [ "None" ], "mydata": [ { "Ddata": [ "Q2 2008", "10,339,000,000" ] }, { "Ddata": [ "Q2 2009", "6,076,000,000" ] }, { "Ddata": [ "Q3 2009", "8,823,000,000" ] }, { "Ddata": [ "Q4 2009", "9,422,000,000" ] }, { "Ddata": [ "Q1 2010", "8,155,000,000" ] }, { "Ddata": [ "Q2 2010", "5,505,000,000" ] }, { "Ddata": [ "Q3 2010", "8,161,000,000" ] }, { "Ddata": [ "Q4 2010", "4,023,000,000" ] }, { "Ddata": [ "Q1 2011", "7,021,000,000" ] }, { "Ddata": [ "Q2 2011", "9,610,000,000" ] }, { "Ddata": [ "Q3 2011", "12,881,000,000" ] }, { "Ddata": [ "Q4 2011", "10,610,000,000" ] }, { "Ddata": [ "Q1 2012", "6,388,000,000" ] }, { "Ddata": [ "Q2 2012", "6,938,000,000" ] }, { "Ddata": [ "Q3 2012", "5,036,000,000" ] }, { "Ddata": [ "Q4 2012", "6,017,000,000" ] }, { "Ddata": [ "Q1 2013", "5,240,000,000" ] }, { "Ddata": [ "Q2 2013", "3,804,000,000" ] }, { "Ddata": [ "Q3 2013", "4,023,000,000" ] }, { "Ddata": [ "Q4 2013", "10,059,000,000" ] } ], "header": [ "Period", "Balance as of" ] } ] } above is the actual value of the first element of ill/temp_ll array. while other elements are 5-10 times of this data. as suggested by the comment; i have added…
tagged with: backbone.js
answer count: 0
type: UnansweredQuestion
score: 0
has comment: http://stackoverflow.com/comment/38797331
has comment: http://stackoverflow.com/comment/38843031
has comment: http://stackoverflow.com/comment/38795495

http://stackoverflow.com/a/25041723
score: 4
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25041685
answers question: http://stackoverflow.com/q/25041685
has comment: http://stackoverflow.com/comment/38971527
type: Answer
upvote count: 4
has comment: http://stackoverflow.com/comment/38981012
downvote count: 0
has body: This is the purpose of the ng-init directive Delete Alternatively use (index, value) formatting: Delete
has comment: http://stackoverflow.com/comment/38949311
has comment: http://stackoverflow.com/comment/38971422

http://stackoverflow.com/a/25016576
type: Answer
has comment: http://stackoverflow.com/comment/38901749
downvote count: 0
score: 1
upvote count: 1
type: AcceptedAnswer
accepted answer of: http://stackoverflow.com/q/25013565
has comment: http://stackoverflow.com/comment/38901870
has body: You can schedule background jobs. Create a job as you wish, for example: Parse.Cloud.job("my_job", function(request, response) { response.success("Ran scheduled job."); }); Deploy that to your Parse App and go to your Cloud Code dashboard, then click on Scheduled Jobs. From there, click on Schedule a Job and set up the first time it should be called and it's frequency. Simply save that and you are ready! :)
answers question: http://stackoverflow.com/q/25013565

http://stackoverflow.com/comment/38747807
type: Comment
comment on: http://stackoverflow.com/q/24934847
score: 0
has text: Also, I'm aware of the FileSystem API (https://developer.mozilla.org/en-US/docs/WebGuide/API/File_System#Browser_Compatibility) but it looks like it's dead (http://lists.w3.org/Archives/Public/public-webapps/2014AprJun/0010.html), and unpredictable across browsers.
type: QuestionComment

http://stackoverflow.com/a/24978655
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24978522
type: Answer
has body: As already stated in a comment, onsubmit is much more appropriate in this situation. The JavaScript placed in an onclick attribute will fire when the HTML element is clicked, but for a form you actually want code that executes on submission. So: &lt;form align="center" method="POST" action="self" name="regform" onsubmit="Submit()"&gt; would be closer. However, it's generally considered poor practice to use the "on" attributes to handle events in JavaScript. For one, it mixes your JavaScript with your semantic HTML, which can be make debugging harder an mixes separate concerns. But it also means that whatever you use in the "on" attributes has to be in the global scope, which can become problematic fast. Consider if you had multiple forms on the page; how would you designate the submit functions for each? A more solid way of performing this is to put your function in an event listener, e.g.: function Submit() { // rest of your code here } document.form.regform.addEventListener('submit', Submit, false); Here the addEventListener method takes an event type string first and a function to execute when that event occurs second. The MDN article on addEventListener has more.

http://stackoverflow.com/q/24962615
type: AnsweredQuestion
has answer: http://stackoverflow.com/a/24962746
accepted answer: http://stackoverflow.com/a/24962746
has body: I have the following divs: Inner1 Ininner1 Ininner2 Inner2 How can I increment their heights so that they are in a single column? I was thinking maybe a for loop, but I'm not quite sure how that would work with divs #inner{ background-color:#B0C2F7; top: 80px; left: 125px; } #inner2{ background-color:#FF0000; top: 180px; left: 25px; } The Ininner divs are the same way with different numbers for 'top'. I just a way to do with a loop if possible.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38800325
upvote count: 2
score: 0
downvote count: 2
answer count: 1
has comment: http://stackoverflow.com/comment/38800239
favorite count: 0
has comment: http://stackoverflow.com/comment/38800304
has comment: http://stackoverflow.com/comment/38800258
has comment: http://stackoverflow.com/comment/38800302
has title: Incrementing Div Height
has comment: http://stackoverflow.com/comment/38800460
type: Question

http://stackoverflow.com/q/24988658
has body: I've just started developing an application with javascript for fxos using jQuery Mobile and already got stuck with a framework related problem. For my app I need to use tcp communication provided by mozilla API (mozTCPSocket), it works well when I run it outside from JQM events, but when I do the socket.open() call from a JQM event (eg. pageshow) it looks like the socket object is being killed after each call. Here is my code: window.addEventListener('DOMContentLoaded', function() { 'use strict'; var socket; var host = "someserver"; var port = 6667; //connect(); // when calling from here, connection works fine $(document).bind("pageshow", function(e) { if (typeof e.currentTarget.URL==="string") { var haystack = $.mobile.path.parseUrl(e.currentTarget.URL); var needle = /^#server/; if (haystack.hash.search(needle)!==-1) { connect(); // ...from here is failing } } }); function connect() { socket = navigator.mozTCPSocket.open(host,port); } socket.ondata = function (event) { var data = event.data; var lines = data.split('\r\n'); for (var i=0;i&lt;lines.length;i++) { if (lines[i].length&gt;0) console.log(lines[i]); } } }); What could be going wrong?
has title: Socket not working on jQuery Mobile events
has comment: http://stackoverflow.com/comment/38885456
type: Question
accepted answer: http://stackoverflow.com/a/31123307
tagged with: jquery-mobile
tagged with: javascript
has comment: http://stackoverflow.com/comment/38849877
answer count: 1
downvote count: 0
tagged with: jquery
favorite count: 0
has comment: http://stackoverflow.com/comment/38966517
has answer: http://stackoverflow.com/a/31123307
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38854978
score: 1
has comment: http://stackoverflow.com/comment/38885431
tagged with: firefox-os
upvote count: 1

http://stackoverflow.com/q/24914588
favorite count: 0
type: Question
tagged with: http://stackoverflow.com/tag/html
tagged with: checkbox
has title: Show a div if 2 specific checkboxes are checked, show another if 1 checkbox is checked (don't show it if the 2 checkboxes are checked)
has body: There are red, green and blue boxes in my code as 3 different divs, and I want to show these divs, depending on which checkboxes are checked. The aim is: if the blue checkbox is checked, it should show the blue div. If the green div is checked, it should show the green div. But, to show the red div, the red AND the green checkbox should be checked. These are working in my code, but there is a problem. If the red and green checkboxes are checked, the red div appears, but the green div also appears. What I need your help for is this: if the red and green checkboxes are checked, the red div should be shown, but the green checkbox should not be shown. (the green div should be shown if only the green checkbox is checked.) Thank you for your help! Here is the code: jQuery Show Hide Using Checkboxes red green blue You have selected red and green checkbox so i am here You have selected green checkbox so i am here You have selected blue checkbox so i am here
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38709870
has answer: http://stackoverflow.com/a/24914871
tagged with: if-statement
tagged with: javascript
has answer: http://stackoverflow.com/a/24914811
type: AnsweredQuestion
downvote count: 0
score: 1
tagged with: jquery
accepted answer: http://stackoverflow.com/a/24914871
possible better answer: http://stackoverflow.com/a/24914811

http://stackoverflow.com/comment/38758175
type: Comment
comment on: http://stackoverflow.com/a/24939788
type: AnswerComment
has text: I try to get the resulting value of my function `getImageBase64()` out if it. But `var res = getImageBase64('http://fiddle.jshell.net/img/logo.png', myCallBack);` is still not my new data.
score: 0

http://stackoverflow.com/comment/38993815
type: Comment
comment on: http://stackoverflow.com/q/25063190
score: 0
has text: gonna build a string with foreach and use eval. Thx Stefan Baiu, you may want to add this as an answer so i can accept it. :)
type: QuestionComment

http://stackoverflow.com/comment/38976332
type: QuestionComment
comment on: http://stackoverflow.com/q/25055691
has text: I believe that `$q.all` should accept an array of promises
score: 0
type: Comment

mysql
tags question: http://stackoverflow.com/q/24999308
tags question: http://stackoverflow.com/q/24918168
tags question: http://stackoverflow.com/q/24929767
tags question: http://stackoverflow.com/q/24979195
tags question: http://stackoverflow.com/q/24972313
tags question: http://stackoverflow.com/q/25037296
tag name: mysql
tags question: http://stackoverflow.com/q/24964636
tags question: http://stackoverflow.com/q/25025819
tags question: http://stackoverflow.com/q/24991833
tags question: http://stackoverflow.com/q/24971398
tags question: http://stackoverflow.com/q/25045094
tags question: http://stackoverflow.com/q/24932922
tags question: http://stackoverflow.com/q/24980736
tags question: http://stackoverflow.com/q/25044729
tags question: http://stackoverflow.com/q/25043791
tags question: http://stackoverflow.com/q/25057164
tags question: http://stackoverflow.com/q/24938991
tags question: http://stackoverflow.com/q/24925450
tags question: http://stackoverflow.com/q/24915207
type: Tag
tags question: http://stackoverflow.com/q/25057053
tags question: http://stackoverflow.com/q/25051707
tags question: http://stackoverflow.com/q/24984649
tags question: http://stackoverflow.com/q/24971127
tags question: http://stackoverflow.com/q/24962711
tags question: http://stackoverflow.com/q/24969473
tags question: http://stackoverflow.com/q/24928167
tags question: http://stackoverflow.com/q/24910301
tags question: http://stackoverflow.com/q/24915699
tags question: http://stackoverflow.com/q/24927496
tags question: http://stackoverflow.com/q/25045691
tags question: http://stackoverflow.com/q/24925480
tags question: http://stackoverflow.com/q/24960108
tags question: http://stackoverflow.com/q/24915244
tags question: http://stackoverflow.com/q/25062672
tags question: http://stackoverflow.com/q/25064884
tags question: http://stackoverflow.com/q/25042958
tags question: http://stackoverflow.com/q/24969679
tags question: http://stackoverflow.com/q/25008241

http://stackoverflow.com/a/25043633
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25043534
has comment: http://stackoverflow.com/comment/38957680
has comment: http://stackoverflow.com/comment/38964619
type: AcceptedAnswer
upvote count: 2
type: Answer
score: 2
answers question: http://stackoverflow.com/q/25043534
has body: $http functions happen asynchronously. Thus, calling console.log after the customersFactory.getAllData will always be empty. console.log($scope.customers); // Object with correct data is actually happening AFTER console.log($scope.customers); // empty [] You can trust the success callback to set $scope.customers correctly, you just need your site to understand that it will happen later. If you NEED scope.customers to be populated before the view loads, consider using a resolve on the controller.

http://stackoverflow.com/comment/39024699
has text: @harbichidian I'm not above needing some refreshing, but are you familiar with using nightwatch for end-to-end testing? it exhibits some atypical behaviors that doesn't match typical javascript functionality, in this case regarding variable scope.
comment on: http://stackoverflow.com/q/25067391
type: QuestionComment
type: Comment
score: 1

http://stackoverflow.com/q/24996320
has answer: http://stackoverflow.com/a/24996444
has title: Multiline title in dialog?
answer count: 3
accepted answer: http://stackoverflow.com/a/24996444
downvote count: 0
has comment: http://stackoverflow.com/comment/38863464
has comment: http://stackoverflow.com/comment/38863232
tagged with: jquery
favorite count: 0
has answer: http://stackoverflow.com/a/24996399
has body: How can I have a JQuery Dialog with a title that is more than one line? See this: http://jsfiddle.net/VKcJ7/7/ I've tried using a newline character, and fiddling with the JQuery UI CSS classes for the title &amp; titlebar, but nothing seems to be working. JS: / JQuery: $(document).ready(function () { $('#dialog').dialog({ autoOpen: false, modal: true, title: 'Something really long wow \n too much to have in a title but oh well' //adding the newline character \n does nothing! }); }); CSS: .ui-dialog-title{ } .ui-dialog-titlebar{ }
tagged with: css
upvote count: 6
has answer: http://stackoverflow.com/a/24996472
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38863280
score: 6
has comment: http://stackoverflow.com/comment/38863406
possible better answer: http://stackoverflow.com/a/24996399
type: Question
has comment: http://stackoverflow.com/comment/38863276
tagged with: jquery-ui
tagged with: javascript
has comment: http://stackoverflow.com/comment/38863287

http://stackoverflow.com/comment/38734273
type: Comment
comment on: http://stackoverflow.com/a/24927308
has text: Yes, good point. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
score: 0
type: AnswerComment

http://stackoverflow.com/q/25004256
has title: How to check if an element is overflowed to the right or left?
has comment: http://stackoverflow.com/comment/38878348
tagged with: javascript
tagged with: jquery
score: 0
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38878420
linked to: http://stackoverflow.com/q/143815
has body: There are a ton of questions about figuring out whether or not an element is overflowed: Here, here, and here But I need a little more specificity. I have an element that's being overflowed horizontally, meaning the user can scroll either to right or to the left. I would like a way of figuring out if the element has been overflowed to either direction. In other words, if the element is pushed all the way to the left, then this function would return true for overflowRight and false for overflowLeft. This is what I'm using now: function isOverflowed(element){ return element.scrollWidth &gt; element.clientWidth; } It returns a bool indicating whether there is any overflow at all, but doesn't offer a configuration for direction. How can I figure out whether or not my element is overflowing left or right? Thanks!
type: UnansweredQuestion
linked to: http://stackoverflow.com/q/7668636
linked to: http://stackoverflow.com/q/9333379
answer count: 0
type: Question

http://stackoverflow.com/q/24939358
has title: change focus select highlight color of text field
upvote count: 1
tagged with: php
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/3481890
linked to: http://stackoverflow.com/q/2258647
type: Question
duplicate of: http://stackoverflow.com/q/2258647
accepted answer: http://stackoverflow.com/a/24939635
has answer: http://stackoverflow.com/a/24939496
tagged with: javascript
tagged with: jquery
downvote count: 4
answer count: 3
has body: How do I change the standard highlight color that is applied when you select the data from a text input field? For example: 1.) User clicks on the text field box. 2.) The contents get highlighted. 3.) I'd like to change this color. Here is my code: &lt;input type="text" value="&lt;?php echo $url;?&gt;" size="40" id="selecturl"/&gt;&lt;br/&gt;&lt;br/&gt; &lt;script language="JavaScript"&gt; jQuery(document).ready(function(){ jQuery('#selecturl').focus(); jQuery('#selecturl').select(); }); &lt;/script&gt; &lt;style&gt; input[type=text]:focus, textarea:focus { box-shadow: 0 0 5px rgba(81, 203, 238, 1); border: 1px solid rgba(81, 203, 238, 1); } &lt;/style&gt; Thanks!
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38756384
has answer: http://stackoverflow.com/a/24939462
tagged with: highlight
favorite count: 0
possible better answer: http://stackoverflow.com/a/24939462
has answer: http://stackoverflow.com/a/24939635
score: -3

http://stackoverflow.com/q/24971526
has answer: http://stackoverflow.com/a/25011917
favorite count: 0
has comment: http://stackoverflow.com/comment/38863785
tagged with: google-chrome
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/26189317
has comment: http://stackoverflow.com/comment/38885856
has title: Caching uploadify files crashes the chrome
tagged with: uploadify
tagged with: caching
downvote count: 1
type: Question
answer count: 2
upvote count: 5
has comment: http://stackoverflow.com/comment/39617335
has comment: http://stackoverflow.com/comment/38817359
has body: I am using uploadify. when i try to open the page with uploadify script the page is crashed. I using this for a long time. but now only I am getting the error. Its happening only in chrome. Its working perfectly in firefox, safari, and IE. I searched through the google and find a solution like disable cache in the browser(working). But its not the best way to do this in the client browser. Is there any way to disable cache for the specific page using htaccess? I tried the following in the htaccess. but no use. &lt;Files jquery.uploadify.js&gt; ExpiresDefault "access plus 0 seconds" &lt;/Files&gt; Please suggest me to solve this problem.
tagged with: javascript
has comment: http://stackoverflow.com/comment/38892935
score: 4
linked to: http://stackoverflow.com/q/32414
tagged with: .htaccess
accepted answer: http://stackoverflow.com/a/25011917
has answer: http://stackoverflow.com/a/26189317
has comment: http://stackoverflow.com/comment/38865753

http://stackoverflow.com/a/24984361
has body: Why not using an array?, you can even loop on the php to generate the questions &lt;?php error_reporting(E_ALL);ini_set('display_errors','On'); $Q1 = 'Question 1'; $Q2 = 'Question 2'; $Q3 = 'Question 3'; ?&gt; &lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; var Question= new Array( "&lt;?php Print($Q1); ?&gt;","&lt;?php Print($Q2); ?&gt;","&lt;?php Print($Q3); ?&gt;"); for (var i = 0; i &lt;= 3; i++) { alert (Question[i]); } &lt;/script&gt; &lt;/body&gt;
upvote count: 2
type: AcceptedAnswer
type: Answer
answers question: http://stackoverflow.com/q/24984297
has comment: http://stackoverflow.com/comment/38840902
accepted answer of: http://stackoverflow.com/q/24984297
score: 2
downvote count: 0

http://stackoverflow.com/q/25030712
answer count: 3
tagged with: radio-button
has comment: http://stackoverflow.com/comment/38928239
has answer: http://stackoverflow.com/a/25031264
has answer: http://stackoverflow.com/a/25036265
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38928241
has comment: http://stackoverflow.com/comment/38928746
has title: Change radio button value to the value of text input
has body: I have this code which has a radio button. I want to get the value of the text box and set it as the value of the selected radio button. HTML Monthly amount of P 300.00 P (please specify) ADD Javascript window.onload = function() { var promised = document.getElementsByName("amounts"); for (var i = 0; i < promised.length; i++) { promised[i].onclick = function() { var rads = this.form[this.name]; for (var i = 0; i < rads.length; i++) { var textField = this.form[rads[i].value.toLowerCase() + "Amount"]; if (textField) textField.disabled = !rads[i].checked; } } } }
has answer: http://stackoverflow.com/a/25031576
type: Question
tagged with: javascript
linked to: http://stackoverflow.com/q/8838648
score: 0

http://stackoverflow.com/comment/38794389
score: 1
comment on: http://stackoverflow.com/q/24959699
has text: @AvinashRaj You should never use reg exp to match html
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38749882
has text: @banzsolt Then please be clear next time you are asking a question. Closed as a dupe.
score: 3
comment on: http://stackoverflow.com/q/24935498
type: Comment
type: QuestionComment

http://stackoverflow.com/a/24952212
has body: try this one function setJsonSer() { formData = { Email: 'clientlink@russell.com', Password: 'russell1234', URL: getVaria() }; $.ajax({ url: "/APIWebService.asmx/AnalyticsDataShowWithPost", type: 'POST', data: formData, complete: function(data) { alert(JSON.stringify(data)); } }); $.ajax({ url: "/APIWebService.asmx/GetMessage", type: 'POST', data: formData, complete: function(data) { alert(JSON.stringify(data)); } }); }
upvote count: 2
has comment: http://stackoverflow.com/comment/38782699
accepted answer of: http://stackoverflow.com/q/24949346
has comment: http://stackoverflow.com/comment/38785729
answers question: http://stackoverflow.com/q/24949346
score: 2
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38783276
type: Answer

http://stackoverflow.com/comment/39002835
comment on: http://stackoverflow.com/a/25069552
type: AnswerComment
score: 0
type: Comment
has text: @iYonatan Paste you function in your question or paste it on jsbin.com and share the link here

http://stackoverflow.com/a/25011676
has comment: http://stackoverflow.com/comment/38894014
type: Answer
has comment: http://stackoverflow.com/comment/38893970
has body: Try to .clone() the selected lis and then .append() it into the other UL as per your wish, $('.checklist li').click(function () { $(this).toggleClass("active-checklist"); $('ul.append-checklist').empty().append($(this).closest('ul').find('.active-checklist').clone()) }); DEMO As per your new requirement use, $('.checklist li').click(function () { $(this).toggleClass("active-checklist"); $('ul.append-checklist').html($.map($(this).closest('ul').find('.active-checklist '),function(elem,i){ return "&lt;li&gt;" + $(elem).text() + '&lt;/li&gt;'; })) }); DEMO
answers question: http://stackoverflow.com/q/25011615
accepted answer of: http://stackoverflow.com/q/25011615
has comment: http://stackoverflow.com/comment/38893410
score: 4
upvote count: 4
has comment: http://stackoverflow.com/comment/38893185
type: AcceptedAnswer
downvote count: 0
has comment: http://stackoverflow.com/comment/38894102

http://stackoverflow.com/comment/38840925
score: 0
type: Comment
has text: I'm not too worried about that. every account on the front end will have a different API key and thus a separate series of nonce. coupled with the fact that traphic will be relatively low for the application the number of api request shouldn't fire more than 10 or so api calls a minute. but yes some sort of async wrapper that would queue up the requests would be ideal. I'm just not sure how to structure it. (not necessarily ajax as that kind of a browser only tech.)
type: QuestionComment
comment on: http://stackoverflow.com/q/24984299

http://stackoverflow.com/comment/38711627
has text: Consider expanding this answer by including some of the information in the link.
type: AnswerComment
comment on: http://stackoverflow.com/a/24915199
score: 0
type: Comment

http://stackoverflow.com/comment/38801800
type: AnswerComment
score: 0
has text: Weird that this is not stated in the API - http://backbonejs.org/#View-delegateEvents
type: Comment
comment on: http://stackoverflow.com/a/24963430

http://stackoverflow.com/comment/38704214
type: Comment
type: QuestionComment
has text: What is `.listview( 'refresh' );` supposed to be chained to? There's a semi-colon prior to that from `.html(data);`
comment on: http://stackoverflow.com/q/24911751
score: 0

http://stackoverflow.com/a/24956710
upvote count: 1
score: 1
has body: Your attribute doesn't have the id selector in it. You need to do a string concatenation : $('.title').on('click', function () { var clicked = $(this).attr('industry_id'); alert(clicked); $('#' + clicked).toggle(400); $('#' + clicked).siblings().hide(); //The two last lines could be : //$('#' + clicked).toggle(400).siblings().hide(); }); Also you have to remove the class content and title on the row since it trigger the click event and the hide part. Here's a working fiddle : http://jsfiddle.net/dPsrL/3/
answers question: http://stackoverflow.com/q/24956651
downvote count: 0
has comment: http://stackoverflow.com/comment/38788623
type: Answer
has comment: http://stackoverflow.com/comment/38788656
has comment: http://stackoverflow.com/comment/38788759

http://stackoverflow.com/comment/38900071
score: 0
has text: @bjb568 your prototype extension would break any other piece of code that uses strings in JavaScript or including libraries that do so in the application. I don't think that's better. What about logging a warning for the very least?
type: AnswerComment
comment on: http://stackoverflow.com/a/24988713
type: Comment

http://stackoverflow.com/q/25067914
has body: I am working on a site that generates notation for a random musical rhythm based on some user-selected parameters. It does this by using an ajax call, which returns a random set of &lt;img&gt; elements that represent different notes. I have a function that is designed to scale the rhythm to fit in the screen, regardless of it's actual size. The function is triggered after a successful ajax call, which is triggered by a click event on a button. My problem is that the function does not work as desired when running the first time the page is loaded. After the function runs for the first time, the height attribute of all of the &lt;img&gt; elements is somehow set to 0. However, the function works great if I run the it again (by clicking the button). It also works fine after a page refresh. Also, I do not have this issue in IE11, only Chrome (I haven't tested other browsers yet). I have tried wrapping the code in both $(window).load() and $(document).ready() event handlers, but this didn't help. The site in action can be found at http://www.rhythmrandomizer.com Any help would be greatly appreciated! Below is the relevant code: Event handler for the button: $("#randomize").click(function(){ //get general options from form var timeSignature = $("#timeSignature").val(); var phraseLength = $("#phraseLength").val(); //get note options from form var checked = []; $("#noteOptions :checked").each(function() { checked.push($(this).val()); }); //alert user and exit function if nothing is selected if (checked.length &lt; 1) { alert("Please select at least one note value"); return; } //format note option ids into a delimited string var noteOptions = ""; for (var i=0; i &lt; checked.length; i++) { noteOptions += checked[i] + "a"; } //remove the final comma and space noteOptions = noteOptions.substr(0, noteOptions.length - 1); //ajax call $.ajax("randomize.php", { data : { timeSignature : timeSignature, phraseLength : phraseLength, noteOptions : noteOptions }, type : "GET", success : …
favorite count: 0
has comment: http://stackoverflow.com/comment/38999103
has title: Why doesn't this JavaScript function calculate correctly when the site is first loaded, but works fine afterwards?
type: UnansweredQuestion
upvote count: 1
tagged with: php
score: 1
has answer: http://stackoverflow.com/a/25068197
has answer: http://stackoverflow.com/a/25068363
type: Question
has comment: http://stackoverflow.com/comment/38998967
tagged with: javascript
has comment: http://stackoverflow.com/comment/38998969
has comment: http://stackoverflow.com/comment/38999435
tagged with: jquery
has answer: http://stackoverflow.com/a/25068190
tagged with: ajax
answer count: 3
tagged with: http://stackoverflow.com/tag/html
downvote count: 0

sequelize.js
type: Tag
tags question: http://stackoverflow.com/q/25064698
tag name: sequelize.js

http://stackoverflow.com/a/25066176
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38995813
type: Answer
has body: It is because you initialize top outside the loop scope and that makes top[0] overwrite all references to the top array, which are being held in array Put the top declaration inside the loop and see the difference var current = json[0].dateMarketHash; var array = []; for(var key in current){ var top = []; top[0] = current[key].formattedDate; top[1] = current[key].currency; top[2] = current[key].price; array[array.length] = top; } http://jsfiddle.net/sUpC8/ If you insist on top being outside the loop scope you can work-around this problem by cloning the top array var current = json[0].dateMarketHash; var array = []; var top = []; for(var key in current){ top[0] = current[key].formattedDate; top[1] = current[key].currency; top[2] = current[key].price; array[array.length] = top.slice(0); }
accepted answer of: http://stackoverflow.com/q/25065957
has comment: http://stackoverflow.com/comment/38996164
answers question: http://stackoverflow.com/q/25065957
score: 0

http://stackoverflow.com/comment/38846219
type: Comment
type: QuestionComment
has text: @AlirezaAhmadi Can you give me an example? The input is coming from an input of type text, submitted by an input of type button and appended to a ul. I have just added to the above code.
score: 1
comment on: http://stackoverflow.com/q/24987088

http://stackoverflow.com/comment/38882548
score: 0
type: Comment
has text: hopefully the OP does not have querystrings. ;)
comment on: http://stackoverflow.com/a/25006563
type: AnswerComment

http://stackoverflow.com/a/25020317
downvote count: 0
has comment: http://stackoverflow.com/comment/38908923
has comment: http://stackoverflow.com/comment/38908901
type: Answer
upvote count: 1
has body: Use this: &lt;input type="submit" value="Submit"&gt;
score: 1
answers question: http://stackoverflow.com/q/25020237

http://stackoverflow.com/a/24977696
downvote count: 0
has comment: http://stackoverflow.com/comment/38828341
type: Answer
score: 1
upvote count: 1
has body: You can use a simple for loop to iterate over the list/array. in the example below i am appending a list item containing the value of the key results[i].title. you can append the values of as many valid keys as you would like to the div. var TMDbAPI = "https://api.themoviedb.org/3/search/movie"; var moviequery = $("#search").val(); var api_key = "baab01130a70a05989eff64f0e684599"; $ul = $('ul'); $.getJSON( TMDbAPI, {query: moviequery,api_key: api_key},function(data){ var results = data.results;//cast the data.results object to a variable //iterate over results printing the title and any other values you would like. for(var i = 0; i &lt; results.length; i++){ $ul.append("&lt;li&gt;"+ results[i].title +"&lt;/li&gt;"); } });
answers question: http://stackoverflow.com/q/24977558

http://stackoverflow.com/q/25045259
tagged with: angularjs
type: AnsweredQuestion
has body: If I am creating logic to format data in a view that is very specific and will likely only be used once, should I create it as a filter or simply create a method in my controller?
type: Question
tagged with: javascript
score: 0
has answer: http://stackoverflow.com/a/25045321
accepted answer: http://stackoverflow.com/a/25045321
answer count: 1
has title: When to use AngularJS filters instead of controller methods?

http://stackoverflow.com/a/24913722
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24913478
has body: Your question isn't very clear but I believe you're asking how to remove a certain element from your unordered list. This line: Childhood Influences represents a list element with a text value of "Childhood Influences". Remove the line, and this list item will no longer show up. Edit: I misread your question, give me a second and I will edit this answer again to address your entire question correctly

http://stackoverflow.com/comment/38869316
score: 0
has text: Thanks , i want to check if there any values in the option .
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24999119

http://stackoverflow.com/comment/38789640
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24956620
has text: So this will choose 'test' if input starts as undefined, but otherwise use the input? How does it decide which to use? And there's no Google UI for this?

http://stackoverflow.com/a/24999289
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24995760
has body: You can use javascript events for the modal. For example loaded.bs.modal;This event is fired when the modal has loaded content using the remote option. $('#myModal').on('loaded.bs.modal', function (e) { // do something... }) There are other events fired with the modal you can read about here
accepted answer of: http://stackoverflow.com/q/24995760
type: Answer
downvote count: 0
score: 1
upvote count: 1

http://stackoverflow.com/q/24916935
tagged with: network-programming
has body: I'm working on a page that has streaming audio and many slides. The audio plays and the slides are loaded on demand during the event. Works fine during regular events but fails during large corporate events where the http download of a slide for 1000 users spikes the bandwidth and temporarily saturates the network causing the audio to skip / cut out. I want to preload all the images upon the user opening the page but I was wondering if it is also possible to rate limit this download of all the images. I'd love to limit the preload of the images to a specific kb/s. Is this possible client side? If not what would be a good option server/client side?
tagged with: javascript
linked to: http://stackoverflow.com/q/5697605
score: 0
tagged with: http://stackoverflow.com/tag/html
answer count: 1
type: UnansweredQuestion
has title: Is there a way to rate limit image preloads client side?
tagged with: bandwidth
has comment: http://stackoverflow.com/comment/38714393
has answer: http://stackoverflow.com/a/24917162
tagged with: scaling
type: Question

http://stackoverflow.com/comment/38943655
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25034486
score: 0
has text: Textbox does not use my watcher. I need to make my own repaint. Your binding is not interesting for me. It does not resolve my task.

http://stackoverflow.com/comment/39002974
type: Comment
has text: Definitely, that's why i suggested the IIEF, can u update your post with the full JavaScript you currently have?
comment on: http://stackoverflow.com/a/25006061
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38941493
type: Comment
has text: I thought of proper solution but I've put it in wrong place... Here you go now :)
comment on: http://stackoverflow.com/a/25037429
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38939785
comment on: http://stackoverflow.com/a/25036670
type: AnswerComment
type: Comment
has text: Hi @dystroy, it's what I thought. If I really need 1.0 to be recognized as float, I have to keep the value as a string. For now, I'll let this go. Thanks
score: 0

iframe
tags question: http://stackoverflow.com/q/24993991
tags question: http://stackoverflow.com/q/25012113
tags question: http://stackoverflow.com/q/24943285
tags question: http://stackoverflow.com/q/25003328
tags question: http://stackoverflow.com/q/25066052
tags question: http://stackoverflow.com/q/25060176
tag name: iframe
tags question: http://stackoverflow.com/q/25010986
tags question: http://stackoverflow.com/q/24955015
tags question: http://stackoverflow.com/q/24984081
tags question: http://stackoverflow.com/q/24928695
tags question: http://stackoverflow.com/q/24975338
tags question: http://stackoverflow.com/q/24933866
tags question: http://stackoverflow.com/q/25033213
tags question: http://stackoverflow.com/q/25014009
tags question: http://stackoverflow.com/q/25058396
tags question: http://stackoverflow.com/q/24936403
tags question: http://stackoverflow.com/q/24925267
tags question: http://stackoverflow.com/q/25028578
tags question: http://stackoverflow.com/q/25006768
tags question: http://stackoverflow.com/q/24921584
tags question: http://stackoverflow.com/q/24930110
tags question: http://stackoverflow.com/q/25046540
tags question: http://stackoverflow.com/q/25026134
tags question: http://stackoverflow.com/q/25057705
tags question: http://stackoverflow.com/q/24937073
tags question: http://stackoverflow.com/q/24911422
tags question: http://stackoverflow.com/q/25000470
tags question: http://stackoverflow.com/q/24949965
tags question: http://stackoverflow.com/q/24914513
tags question: http://stackoverflow.com/q/25005940
tags question: http://stackoverflow.com/q/25033294
tags question: http://stackoverflow.com/q/25016697
tags question: http://stackoverflow.com/q/24979353
type: Tag
tags question: http://stackoverflow.com/q/24915238
tags question: http://stackoverflow.com/q/25067293
tags question: http://stackoverflow.com/q/25053082
tags question: http://stackoverflow.com/q/25016381
tags question: http://stackoverflow.com/q/25033832
tags question: http://stackoverflow.com/q/24952151
tags question: http://stackoverflow.com/q/24972684
tags question: http://stackoverflow.com/q/24996841
tags question: http://stackoverflow.com/q/24964984
tags question: http://stackoverflow.com/q/24967105
tags question: http://stackoverflow.com/q/25027104
tags question: http://stackoverflow.com/q/25001491
tags question: http://stackoverflow.com/q/25069449
tags question: http://stackoverflow.com/q/24940571
tags question: http://stackoverflow.com/q/25032974
tags question: http://stackoverflow.com/q/24914574

http://stackoverflow.com/comment/38813347
comment on: http://stackoverflow.com/q/24969790
has text: just include js2 inside js1..
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/a/25012150
answers question: http://stackoverflow.com/q/25011915
score: 3
upvote count: 3
has body: try this : var hovred=null; $('.dropped').mouseenter(function(e) { hovred=$(this); }); $('.dropped').mouseleave(function(e) { hovred=null; }); $('.dropped').mousemove(function(e) { ... if($(this)==hovred &amp;&amp; hovred != null) { //do your stuff here man } });
downvote count: 0
type: Answer

http://stackoverflow.com/a/24927753
downvote count: 0
has comment: http://stackoverflow.com/comment/38748963
accepted answer of: http://stackoverflow.com/q/24919870
answers question: http://stackoverflow.com/q/24919870
has body: Sadly there is no individual inner radius option, and I didnt see it being talked about on the forum. Though I might have misunderstood what you want: the innerRadius is the radius of the hole of the donut, not the radius of the slices. With individual innerRadius, you would end with that: http://img11.hostingpics.net/pics/420457test.png That doesn't make the slices wider, but separate them. If you want to try that, you would have to edit the pie plugin, the real difficulty is not the individual radius but the shadow (there is a shadow if you tilt your pie) that is currently a whole dark circle which needs to be drawn with individual shadows instead, but you dont seem to use the shadow so you wont need it. So, the pie plugin use a drawPie() method to draw the pie, method containing a drawSlice() method that draws the individual slice. What you need to do is tell drawSlice to translate the drawing according to your radius: so where drawSlice is called, just replace the call with something like this: drawSlice(slices[i].angle, slices[i].translateRadius, slices[i].color, true); (I added the slices[i].translateRadius in the call) and in the drawSlice method itself, after the fill option: ctx.translate( translateRadius * Math.cos(currentAngle + angle / 2), translateRadius * Math.sin(currentAngle + angle / 2) ) Thats it, for the translating. You could use some security option( check if translateRadius is set, etc...), and you just have to add a translateRadius option in your indivual series like this: var data = [ {translateRadius: 10, data: [66] } , {translateRadius: 10, data: [33] }
type: Answer
score: 3
upvote count: 3
type: AcceptedAnswer

http://stackoverflow.com/a/25230783
score: 0
type: Answer
answers question: http://stackoverflow.com/q/24962589
has body: Let's think of the browser's history as a stack. Each time you click a link or navigate forward, you push items onto the stack. Whenever you want to go backward, the browser "pops" an item off of the stack. Let's call each of these items a "state". The browser keeps a few pieces of information about each state, like the URL, title, and a "state object" if needed. In summary, new states get pushed on to the stack when you go forward and the most recent state gets popped off of the end when you want to go backwards. With that in mind, what you want to accomplish is pushing a state onto the stack manually. In this way, the user isn't actually navigating anywhere—the HTML5 History API gives us the ability to push/pop/replace the states in the browser's history stack without the page changing. In your click event listener, you'll need to add some code to add a new state to the history stack. Something like: window.history.pushState({}, 'Step 2', '/step-2'); This will add a new state to the history stack and your URL will change to /step-2. Now when you click the back button, it will pop this state off of the stack and go back to the previous state. Both states are the same page and DOM. Now you have to account for changing the visibility of those two items on the page when the user navigates back in their browser. This can be detected via a popstate event that gets fired on the window every time the state changes. Check out this plunkr example I put together. In the click event listener, the DOM is changed (hiding and showing the items) and a new history state is pushed onto the stack with an integer representing what step should be shown in that history state. Then, on a popstate event, the user is navigating backwards and in the event object, we're given the state that is being popped off. We know that we should be going backwards, so if the step that's being popped off is step 2, we'll want to show step 1. I made some minor changes to the html to be able to write the …

http://stackoverflow.com/q/24934751
has answer: http://stackoverflow.com/a/49286015
downvote count: 0
has title: intro.js not working for specific elements based on classes
favorite count: 0
tagged with: intro.js
linked to: http://stackoverflow.com/q/16026600
type: UnansweredQuestion
answer count: 4
has body: I am not able to start intro.js with specific elements which are have class='test'.I am using Intro.js v0.9.0. as per documentation, I written code just like following way. I tried to start intro like this introJs(".test").start(); It's not working.I goggled some guys suggested regarding this,I tried those ways also but it's not working. How can I fix this.
has answer: http://stackoverflow.com/a/53019215
has answer: http://stackoverflow.com/a/26673598
type: Question
tagged with: javascript
score: 4
upvote count: 4
has answer: http://stackoverflow.com/a/24955592

http://stackoverflow.com/comment/38868471
type: Comment
comment on: http://stackoverflow.com/a/24998223
has text: here is the updated [fiddle](http://jsfiddle.net/936zB/5/) the reason behind that is when you say postion:absolute to dd-panel it takes in realtion to the parent container which has a position set. So you need to give a -ve top
type: AnswerComment
score: 1

http://stackoverflow.com/comment/38979419
type: QuestionComment
comment on: http://stackoverflow.com/q/25057573
score: 0
type: Comment
has text: I have edited and corrected the code

http://stackoverflow.com/comment/38985654
type: QuestionComment
has text: @PatrickQ - I've just modified the code on my end, but no luck.. Any ideas?
score: 0
comment on: http://stackoverflow.com/q/25060578
type: Comment

http://stackoverflow.com/q/24970653
has body: I would like to start using some monitoring framework for my website's JS. All of the JS is served when it's already minified, making it quite difficult to know what the problem really was. I looked at a few, but would appreciate it if anyone with experience could point me in the right direction.
has comment: http://stackoverflow.com/comment/38816710
has comment: http://stackoverflow.com/comment/38814985
score: 2
type: Question
tagged with: debugging
answer count: 2
downvote count: 0
linked to: http://stackoverflow.com/q/24637356
has title: Error monitoring minified javascript
has answer: http://stackoverflow.com/a/62418466
tagged with: javascript
tagged with: monitoring
has answer: http://stackoverflow.com/a/38212666
tagged with: minify
favorite count: 0
upvote count: 2
has comment: http://stackoverflow.com/comment/110392350
type: UnansweredQuestion

http://stackoverflow.com/a/24942645
score: 0
has body: jQuerys Sizzle (the engine used for selecting things) does not return the HTMLObject (&lt;input type='text' ...&gt;) but a jQuery Object: [input#input-tags, context: input#input-tags, jquery: "1.11.0", constructor: function, selector: "", toArray: function…] 0: input#input-tags context: input#input-tags length: 1 __proto__: Object[0] To shorten things: The correct way of getting #water is either $(this).val() (http://api.jquery.com/val/) or $(this)[0].value since $(this)[0] represents the HTMLObject.
answers question: http://stackoverflow.com/q/24942557
type: Answer
has comment: http://stackoverflow.com/comment/38762969
has comment: http://stackoverflow.com/comment/38763029

http://stackoverflow.com/comment/38767228
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24944719
type: AnswerComment
has text: I realized that too, but changing that didn't help. In any case the "Event - Menu Click" should have still fired, since the value for 'event' is passed as a string, and so should have at least passed that if not rest of the values.

http://stackoverflow.com/comment/51871811
score: 1
comment on: http://stackoverflow.com/a/31982285
type: AnswerComment
has text: @bardzusny it's the question that's borderline close-worthy, IMO :-)
type: Comment

http://stackoverflow.com/q/24915857
has body: Simple javascript that is supposed to alert the number of array elements. var name = ["Bill", "Kevin", "Alice"]; alert(name.length) But when I run the code it will alert the number of strings in the name array. Also if I alert name[1] it will alert i instead of Kevin. If I change the name of the array to something else, ex. friendsNames, it functions as intended. What is it about the variable "name" that changes the behavior?
type: Question
has answer: http://stackoverflow.com/a/24916003
has comment: http://stackoverflow.com/comment/38712360
answer count: 2
upvote count: 1
has comment: http://stackoverflow.com/comment/38712323
tagged with: javascript
has comment: http://stackoverflow.com/comment/38712286
score: 0
downvote count: 1
has comment: http://stackoverflow.com/comment/38712557
accepted answer: http://stackoverflow.com/a/24916001
favorite count: 0
has title: array.length returns number of strings instead of number of array elements
possible better answer: http://stackoverflow.com/a/24916003
has answer: http://stackoverflow.com/a/24916001
type: AnsweredQuestion

http://stackoverflow.com/comment/38803980
type: QuestionComment
has text: https://www.google.com/search
comment on: http://stackoverflow.com/q/24964481
score: 0
type: Comment

http://stackoverflow.com/a/24989228
score: 2
downvote count: 0
has comment: http://stackoverflow.com/comment/38850819
has comment: http://stackoverflow.com/comment/38850617
upvote count: 2
answers question: http://stackoverflow.com/q/24988018
type: Answer
has body: We can use jQuery's .val() method to check the date value. If two of them equal, then use .show() to display the extra elements, else use .hide() to not show them. Start: End: Full day Half day function check() { if ($('#s').val() == $('#e').val()) { $('#detail').show(); } else { $('#detail').hide(); } } fiddle
has comment: http://stackoverflow.com/comment/38851751

http://stackoverflow.com/comment/38872435
comment on: http://stackoverflow.com/a/25001247
score: 2
type: AnswerComment
has text: Might want to fix your brackets
type: Comment

http://stackoverflow.com/comment/38830083
has text: Please check demo over here or make a fiddle?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24978509

http://stackoverflow.com/comment/38993771
type: QuestionComment
comment on: http://stackoverflow.com/q/25065168
score: 1
has text: It might also be interesting to know why the return value of [`getElementsByTagName()`](https://developer.mozilla.org/en-US/docs/Web/API/Element.getElementsByTagName) (a [`NodeList`](https://developer.mozilla.org/en/docs/Web/API/NodeList)) doesn't support Array methods: https://developer.mozilla.org/en-US/docs/Web/API/NodeList#Why_can't_I_use_forEach_or_map_on_a_NodeList.3F
type: Comment

http://stackoverflow.com/a/24914242
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/24914217
type: Answer
downvote count: 0
score: 1
has body: To break it down: ./ = folder this file is in. folderwithinfolder/= A folder within the folder the webpage is in. file.js = Javascript File.
accepted answer of: http://stackoverflow.com/q/24914217
upvote count: 1

http://stackoverflow.com/a/24911630
downvote count: 0
has body: This will work for what you want (get the selected text) function getSelectionText() { var text = ""; if (window.getSelection) { text = window.getSelection().toString(); } else if (document.selection &amp;&amp; document.selection.type != "Control") { text = document.selection.createRange().text; } return text; } Of course maybe you want to check if the selected text is part of the span, in this case, the window.getSelection does not provide that information. but you can do something like this $(".cls_ani").text().indexOf(text) != -1
type: Answer
has comment: http://stackoverflow.com/comment/38704719
upvote count: 1
score: 1
answers question: http://stackoverflow.com/q/24911541

http://stackoverflow.com/q/24942969
answer count: 1
downvote count: 0
favorite count: 0
tagged with: promise
tagged with: angularjs
has comment: http://stackoverflow.com/comment/38933438
has answer: http://stackoverflow.com/a/24943104
type: AnsweredQuestion
linked to: http://stackoverflow.com/q/24662289
has body: I'm writing a function that handles results from an Angular $http. In my $http request I'm using .then() to handle results. var GET = function (url) { return $http({ method: 'GET', url: url }).then( function (data) { return data.data; }, function (data) { return data.data; }); }; And then I call the GET function from another function, like this: var initializeUsers = function () { return dbService.GET(serverUrl + dbResource).then( function (data) { // Some code to handle success }, function (data) { // Some code to handle error }); }; Here's the problem: If there is an error in the HTTP request, it is being handled by the error handler in the GET function. BUT, when the initializeUsers is run, the error handler is NOT triggered, but rather the success handler. So the error does not "bubble" up, which is should However, if I, instead of using .then in the GET function, I use .success and .error, like this: var GET = function (url) { return $http({ method: 'GET', url: url }).success( function (data) { return data.data; }).error( function (data) { return data.data; }); }; it works fine in the initializeUsers. HOWEVER, if I then call initializeUsers from another function using .then, the error handler in it is not triggered. I would seem that I have to use .success and .error all the way, which is not how it's supposed to work, as far as I can understand. As long as I explicitly use .error on every function in order to actually catch the error, otherwise the error gets lost and the next function acts as though the last one was successful. I'm I misunderstanding, or is there something wrong with my code?
has comment: http://stackoverflow.com/comment/38767593
has comment: http://stackoverflow.com/comment/38767562
upvote count: 1
has title: Error handler in .then() not triggered unless .success and .error is used
type: Question
has comment: http://stackoverflow.com/comment/38792548
has comment: http://stackoverflow.com/comment/38812283
score: 1
tagged with: javascript
accepted answer: http://stackoverflow.com/a/24943104

http://stackoverflow.com/q/24965249
answer count: 1
tagged with: javascript
favorite count: 0
has comment: http://stackoverflow.com/comment/38805120
has body: I'm trying to figure out what the assignment to id means in the following snippet, and in particular the '-$1'. I do see that it's taking the DOM element text and swapping in something else, and then lowercasing the result. I just don't understand what is being swapped in. for (var k in ui) { var id = k.replace(/([A-Z])/, '-$1').toLowerCase(); var element = document.getElementById(id); if (!element) { throw "Missing UI element: " + k; } ui[k] = element; }
has title: What does '-$1' mean in javascript?
upvote count: 6
has comment: http://stackoverflow.com/comment/38805255
has comment: http://stackoverflow.com/comment/38805163
score: 2
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/24965258
linked to: http://stackoverflow.com/q/5982824
accepted answer: http://stackoverflow.com/a/24965258
downvote count: 4

http://stackoverflow.com/q/24929678
has answer: http://stackoverflow.com/a/24929754
type: Question
has comment: http://stackoverflow.com/comment/38738106
has title: Regexp - find my email Id end with valid domain
tagged with: javascript
tagged with: jquery
score: 0
answer count: 2
accepted answer: http://stackoverflow.com/a/24929722
has body: I am doing a email validation. I would like to test the email - the user entered properly end with some domain. usually the domain contains min 2 letters to max 3 letters. and it should prepended with . notation. I tried like this, but not working properly \.+{2}|{3}$ what is the correct approach to find this?
tagged with: regex
has comment: http://stackoverflow.com/comment/38737886
has comment: http://stackoverflow.com/comment/38738086
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38738037
has answer: http://stackoverflow.com/a/24929722
possible better answer: http://stackoverflow.com/a/24929754

http://stackoverflow.com/q/24950277
upvote count: 7
type: Question
tagged with: google-analytics
has answer: http://stackoverflow.com/a/55044762
has answer: http://stackoverflow.com/a/44061801
has title: How to automate test google analytics on every event fired using Selenium WebDriver
tagged with: javascript
has comment: http://stackoverflow.com/comment/38781836
has body: I am working on Google Analytics automation test with Selenium WebDriver java bindings. Our site has Google Analytics tracking events set on important elements on the site. I need to verify that on clicking a certain element under test, the Google Analytic event is in fact fired. I'm testing it on FireFox. When I click F12, I can see in the console that a Google Analytics is fired with message GET http://www.google-analytics.com/__utm.gif on each element click event. SampleCode :- WebDriver wd = new FirefoxDriver(); wd.get("http://www.dummyExample.com/"); wd.findElement(By.linkText("Document Referece")).click(); wd.findElement(By.id("Ex2vc2")).click(); How can I achieve this task? I have googled it but could not find good answers. If anyone can help me with some references or sample code I would be very Thankful.
has answer: http://stackoverflow.com/a/24960573
downvote count: 0
has comment: http://stackoverflow.com/comment/38784434
answer count: 4
favorite count: 0
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/30732161
tagged with: selenium-webdriver
score: 7
tagged with: java
tagged with: selenium

http://stackoverflow.com/a/25012495
type: Answer
has body: First of all, that use of eval is completely unwarranted, as there is nothing that needs to be evaluated that way. The original code should have been just: document.forms[0].telephone.value = $telephone[$i]; The eval function evaluates a string as code, which is generally associated with risks of cross site scripting attacks and similar. Accessing elements using eval is actually never needed, even with dynamic field names they can be accessed by name without using eval. Example: var formNumber = 0; var fieldName = "telephone"; document.forms[formNumber][fieldName].value = $telephone[$i]; Back to the span; in modern browsers you can use the querySelector method to find it using the class name. Then you use the innerHTML property to set the content: document.querySelector('.tel-prefix').innerHTML = $telephone[$i]; To work in older browsers it would help a lot if you can add an id to the span (for example id="telPrefix"), then you can use the getElementById method: document.getElementById('telPrefix').innerHTML = $telephone[$i]; It's possible to find the element using the class name, but then you need to loop through all elements in the page until you find it in browsers that doesn't support the querySelector method.
upvote count: 1
accepted answer of: http://stackoverflow.com/q/25012201
answers question: http://stackoverflow.com/q/25012201
type: AcceptedAnswer
downvote count: 0
score: 1

http://stackoverflow.com/q/25037112
possible better answer: http://stackoverflow.com/a/25037429
has answer: http://stackoverflow.com/a/25037392
has title: get the html of the child div if the checkbox in the parent div has been checked in javascript
has comment: http://stackoverflow.com/comment/38939882
has comment: http://stackoverflow.com/comment/38939795
type: AnsweredQuestion
has body: I have the following HTML: &lt;div id="chkBox20"&gt; &lt;input type="checkbox" id="box20" name="rooms[]" value="20" class="box"/&gt; &lt;div class="specialprice2" style="float:left;"&gt;68.00&lt;/div&gt; &lt;/div&gt; &lt;div id="chkBox21"&gt; &lt;input type="checkbox" id="box21" name="rooms[]" value="21" class="box"/&gt; &lt;div class="specialprice2" style="float:left;"&gt;68.00&lt;/div&gt; &lt;/div&gt; &lt;div id="chkBox22"&gt; &lt;input type="checkbox" id="box22" name="rooms[]" value="22" class="box"/&gt; &lt;div class="specialprice2" style="float:left;"&gt;155.00&lt;/div&gt; &lt;/div&gt; Some or none of those checkboxes might be checked. If some of the boxes are checked, I have script that display the sum for checked checkboxes. What I am trying now is to update the result if the user check or uncheck any of the checkboxes. Here is the javascript that I have now: $(document).ready(function(){ var sum = 0; $('.specialprice').each(function(i, el) { sum += parseInt($(el).html()); if(sum){ thesum = sum.toFixed(2); } }); sumPerRoom = (thesum * &lt;?php echo $searchQueryNumOfDays;?&gt;); formatedSumPerRoom = sumPerRoom.toFixed(2); $('.newprice').append(thesum +" &amp;euro; x Evenings: &lt;?php echo $searchQueryNumOfDays ;?&gt; = "+formatedSumPerRoom+" &amp;euro;"); }); // above part work just fine, problem is bellow. //I guess that bellow I should try something with child div //but i don't know how to do it $(".box").click(function(){ var sum = 0; $('.specialprice2').each(function(i, el) { sum += parseInt($(el).html()); if(sum){ thesum = sum.toFixed(2); } }); alert(thesum); }); Needles to say the sum alert the sum of all divs, and i want only the clicked ones. If someone can help me to alert or to console log the updated price, I will find my way from there. Regards, John
type: Question
has answer: http://stackoverflow.com/a/25037429
score: 0
answer count: 2
tagged with: javascript
accepted answer: http://stackoverflow.com/a/25037392
has comment: http://stackoverflow.com/comment/38939732
tagged with: checkbox

http://stackoverflow.com/q/25035967
type: AnsweredQuestion
score: 1
accepted answer: http://stackoverflow.com/a/25038104
upvote count: 1
has comment: http://stackoverflow.com/comment/38938068
type: Question
tagged with: jsonp
tagged with: javascript
tagged with: express
answer count: 1
has body: don't know why but my Express app is returning something weird with res.jsonp, something llike this: /**/ typeof jsonp1406719695757 === 'function' &amp;&amp; jsonp1406719695757({"published":true,"can_add_to_cart":true,"updated_at":"2014-01-[...snip...] instead only this: jsonp1406719695757({"published":true,"can_add_to_cart":true,"updated_at":"2014-01-[...snip...] I can't understand why. Any ideas?
downvote count: 0
favorite count: 0
has comment: http://stackoverflow.com/comment/38937748
has answer: http://stackoverflow.com/a/25038104
has title: node.js express jsonp return typeof
tagged with: node.js

http://stackoverflow.com/a/24959595
type: Answer
answers question: http://stackoverflow.com/q/24950473
has comment: http://stackoverflow.com/comment/38813089
type: AcceptedAnswer
has body: What I am gonna tell you is probably a bit expensive but it's the best thing I can think about at the moment. I would do this way NSString *path = [[NSBundle mainBundle] pathForResource:@"text" ofType:@"txt"]; NSFileHandle *filehandle = [NSFileHandle fileHandleForWritingAtPath:path]; NSString *towrite = @"test"; // get the actual content NSData *original = [NSMutableData dataWithContentsOfFile:path]; // create a mutable data instance which starts with the string you want to put at the top NSMutableData *complete = [[towrite dataUsingEncoding:NSUTF8StringEncoding] mutableCopy]; // than you append the original [complete appendData:original]; // and write the data as you already know how [filehandle writeData:complete]; NSArray* data = [[NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil] componentsSeparatedByCharactersInSet: [NSCharacterSet newlineCharacterSet]]; NSLog(@"%@",[data objectAtIndex:0]); This will print: testABCDEFGHIJKLMNOPQRSTUVWXYZ Tested myself and working. Hope it helps. p.S. It might be a bit too expensive when it comes to really huge files. For the second part of your question I would do this way: Get the file path you want to write to, adding the extension .js And then do something similar to: [complete writeToFile:pathToFileWithJSExtension]; Hope it helps
score: 0
accepted answer of: http://stackoverflow.com/q/24950473

http://stackoverflow.com/comment/38803530
score: 0
comment on: http://stackoverflow.com/q/24963043
type: Comment
type: QuestionComment
has text: Thanks, I will update all my database APIs as soon as I find time for it.

http://stackoverflow.com/a/24989366
has comment: http://stackoverflow.com/comment/39234911
has comment: http://stackoverflow.com/comment/39312746
score: 0
type: Answer
has body: What you should do, is using JavaScript to achieve that. You should use onchange or oninput method to track changes and to display what you want. Of course JavaScript in browser should be enabled. Sample working code: My cart Select option option1 option2 Continue Of course you need to adjust code to your needs.
has comment: http://stackoverflow.com/comment/39238461
has comment: http://stackoverflow.com/comment/39313002
has comment: http://stackoverflow.com/comment/38921756
answers question: http://stackoverflow.com/q/24988675
has comment: http://stackoverflow.com/comment/38925916

http://stackoverflow.com/q/25050711
answer count: 2
has answer: http://stackoverflow.com/a/25050953
accepted answer: http://stackoverflow.com/a/25050953
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/25051066
score: 0
linked to: http://stackoverflow.com/q/13868132
has body: Here is my code: Please fill out my form. This code works fine, but i need like to display as light box, for example please refer this site, http://fancybox.net/ ,, I am new to javascript, can anyone one help me to do this, Any help would be appreciated, Thank you.
has title: Light box pop up form in jquery
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25051066
type: Question

http://stackoverflow.com/a/24985926
upvote count: 1
type: Answer
answers question: http://stackoverflow.com/q/24985785
downvote count: 0
score: 1
has body: Please update your code as follows : if( second &lt; 10 ){ var sec = '0'+second; console.log(sec); $('.sec').html(sec); } else{ $('.sec').html(second); } Without the else statement, sec is replaced by second anyway.

http://stackoverflow.com/comment/59519852
has text: Did you solve the problem now?
comment on: http://stackoverflow.com/q/25034717
score: 1
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38967757
type: Comment
has text: If you want `foreach` semantics in javascript, look at `Array.prototype.forEach`. You can basically do this: `[0, 1, 2, 3].forEach(function(item, key) { /* do stuff with item and key */ });`. Though you can't `break` and `continue` it.
score: 0
comment on: http://stackoverflow.com/q/25051629
type: QuestionComment

http://stackoverflow.com/a/24933781
has comment: http://stackoverflow.com/comment/38746030
answers question: http://stackoverflow.com/q/24933712
has comment: http://stackoverflow.com/comment/38745638
has body: There's no need for any jQuery or anything like that here - the css properties you're looking for are "transitions" - http://www.w3schools.com/css/css3_transitions.asp
score: 0
type: Answer
has comment: http://stackoverflow.com/comment/38745615

http://stackoverflow.com/q/25019887
tagged with: javascript
score: 0
answer count: 1
tagged with: http://stackoverflow.com/tag/html
has title: How do I display vertical radio buttons in the horizontal style using jquery-mobile?
tagged with: css
has body: Jquery-mobile can display sets of radio buttons on a horizontal grouping with the actual selection box suppressed and selection indicated by the background text colour by adding the attribute 'data-type="horizontal"'. It can also display a vertical set, which retains the boxes and does not set the background colour, by setting 'data-type="vertical"'. Is there a way to change the vertical styling to match the horizontal styling? That is, suppress the boxes and use the background text colour to indication selection. FYI, we're using jquery-mobile 1.3.2.
tagged with: jquery-mobile-radio
type: AnsweredQuestion
type: Question
has answer: http://stackoverflow.com/a/25023650
accepted answer: http://stackoverflow.com/a/25023650
tagged with: jquery-mobile

http://stackoverflow.com/q/24931032
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Toggling classes not working as expected with css3 animation
has answer: http://stackoverflow.com/a/24931179
score: 1
has answer: http://stackoverflow.com/a/24931230
downvote count: 1
type: Question
possible better answer: http://stackoverflow.com/a/24931179
has answer: http://stackoverflow.com/a/24931317
tagged with: javascript
tagged with: jquery
has body: By using the below code i was just tried to toggle the text shadow with animating effect, i had done it for the forward flow but the reverse flow is not working smoothly. It is reverting without any animation effect. Can anybody help me to fix this.? HTML: testing testing testing glow unglow JS: $(':button:contains(glow)').click(function () { $('h1').addClass('shadow'); }); $(':button:contains(unglow)').click(function () { $('h1').addClass('removeShadow'); }); CSS: h1.removeShadow { -webkit-animation: removeGlow 1s 1; -webkit-animation-fill-mode:forwards; } @-webkit-keyframes removeGlow { to { text-shadow: 1px 0px 0px rgba(0, 0, 0, 0); } } h1.shadow { -webkit-animation: glow .7s 1; -webkit-animation-fill-mode:forwards; } @-webkit-keyframes glow { to { text-shadow:1px 1px 10px rgb(255, 153, 0), 1px 1px 10px rgb(255, 153, 0), 1px 1px 10px rgb(255, 153, 0); } } DEMO
answer count: 3
favorite count: 0
accepted answer: http://stackoverflow.com/a/24931317
upvote count: 2

http://stackoverflow.com/q/24909850
has comment: http://stackoverflow.com/comment/38704358
has comment: http://stackoverflow.com/comment/38708421
tagged with: promise
has title: q.all seems to behave differently, why?
has comment: http://stackoverflow.com/comment/38703665
has comment: http://stackoverflow.com/comment/38707062
score: 0
has comment: http://stackoverflow.com/comment/38705282
has answer: http://stackoverflow.com/a/24957103
has comment: http://stackoverflow.com/comment/38706950
type: Question
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38702444
has comment: http://stackoverflow.com/comment/38702257
has answer: http://stackoverflow.com/a/24919274
has body: Here is my code that I would expect would start from the top and execution would continue on down. The first two clauses get a record from the database and then update the 'self' object. However, when the execution hits the Q.all, the method returns Promises rather than actually resolving the promises and putting the value into locs(and eventually 'self'). Eventually, the promises will get resolved, but after the 'return self' in the last then clause. I need self.locations to be set before 'return self' is run. return dao.getRecords(APP_COLLECTION, filters).then(function(data) { return self.loadClientAppImpl(data); }).then(function() { locArray = self.app.field_194_raw; return dao.getChildren("object_23", self.appId, "field_210", "field_164").then(function(knackRecord) { self.priorCarriers = knackRecord.records; }); }).then(function() { var locPromiseArray = getPromisesArray(locArray); return Q.all(locPromiseArray).then(function(locs){ self.locations = locs; }); }).then(function() { return self; }).done(); I thought that the multiple promises were supposed to act like the single call promises as well? ie. dao.getRecords is fine, but why does the Q.all([dao.getRecords1, dao.getRecord2 etc]) not work as I might expect (ie. doesn't resolve before 'return self;')? The following code works fine, I replaced Q.all with a single promise and everything works as expected (ie. return self called last in chain). The question remains: why does Q.all not work the same? I'm assuming this is just the way its supposed to work and I don't understand something about the implementation. return dao.getRecords(APP_COLLECTION, filters).then(function(data) { self.loadClientAppImpl(data); }).then(function() { locArray = self.app.field_194_raw; return dao.getChildren("object_23", self.appId, "field_210", "field_164").then(function(knackRecord) { self.priorCarriers = knackRecord.records; }); }).then(function() { var locPromiseArray = getPromiseArray(locArray); return locPromiseArray[0].then(f…
has comment: http://stackoverflow.com/comment/38704027
answer count: 2
has comment: http://stackoverflow.com/comment/38704578
has comment: http://stackoverflow.com/comment/38700615
accepted answer: http://stackoverflow.com/a/24957103
possible better answer: http://stackoverflow.com/a/24919274
tagged with: javascript
has comment: http://stackoverflow.com/comment/38707124
has comment: http://stackoverflow.com/comment/38704400
has comment: http://stackoverflow.com/comment/38705903
tagged with: http://stackoverflow.com/tag/q
has comment: http://stackoverflow.com/comment/38706760

http://stackoverflow.com/a/25060104
score: 0
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25059605
type: Answer
has body: The page does not reload. You're setting a new hash "" which is equivalent to "top of the page" so the browser does what you tell him: jump to the top. If you want to keep the postion you should recall scrollTo(): clickCancel = function(){ location.hash = ""; window.scrollTo(0, 2000); }
has comment: http://stackoverflow.com/comment/38983656
accepted answer of: http://stackoverflow.com/q/25059605

http://stackoverflow.com/comment/38994118
comment on: http://stackoverflow.com/a/25062977
type: AnswerComment
score: 0
type: Comment
has text: just call it evens already and don't push your luck! ;-)

http://stackoverflow.com/comment/52408825
comment on: http://stackoverflow.com/a/24965133
type: AnswerComment
score: 0
type: Comment
has text: Awesome elegant solution. UnderscoreJS really rocks =]

http://stackoverflow.com/comment/38976624
score: 0
has text: Fair enough, I guess. I'll come up with something better to say! :D
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25056369

http://stackoverflow.com/comment/38979877
type: AnswerComment
has text: FYI you asked about other resources, and two of the linked articles come from a site that should complement what you've already seen.
type: Comment
comment on: http://stackoverflow.com/a/25057997
score: 1

http://stackoverflow.com/comment/94484118
type: AnswerComment
score: 0
has text: Hmm, let me rephrase that. After some more fiddling, IE10 doesn't seem to bother with anything you specify, not even the locale. It always returns a full date with long names according to the OS locale.
type: Comment
comment on: http://stackoverflow.com/a/45464959

http://stackoverflow.com/q/25023392
score: 0
has comment: http://stackoverflow.com/comment/38914912
tagged with: window
tagged with: javascript
answer count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38916668
type: Question
has title: Opening a child window using Javascript that has navigation arrows and ability to add its own tabs
has body: I am trying to open a bare bones window using window.open(), which is pretty basic and easy to do. I'm concerned here with Chrome running on Mac OSX. My code: window.open(url, "_account", "scrollbars, resizable"); A user asked me to add navigation controls (forward, back, reload), menu bar, status bar, and the ability to add new tabs from the child window... basically he wanted the window to behave like a "normal" browser window. My code changed to: window.open(url, "_account", "toolbar, scrollbars, resizable, menubar, location, status"); This was just me basically adding all of the options I could find to enable everything available. Yet this does not actually bring up the navigation controls or an address bar, or the 'new tab' button. When I checked mozilla's window.open() page, (especially the section describing the 'toolbar' option), I read this: If this feature [toolbar] is on, then the new secondary window renders the Navigation Toolbar (Back, Forward, Reload, Stop buttons). That sounds like it should have done exactly what I want, but I don't see those controls. So, are child windows prevented by some unchangeable browser policy from having those controls? I don't see on that reference page how to add new tabs, address bar (that I can edit to go to a new location). Thanks in advance. (edited to address James's comment below)

http://stackoverflow.com/a/24967507
type: Answer
score: 0
has body: Addition to Armin's answer, you'll probably have to use the $modal service from angularui project (to make sure your expressions do compile and wont show up as {{exp}}). they did a great work implementing the service and it's easier to use their's than to write your own directive/service (believe me I've tried both :D)
answers question: http://stackoverflow.com/q/24966952

http://stackoverflow.com/q/24965922
tagged with: javascript
tagged with: angularjs
type: AnsweredQuestion
has title: Angular Directive -- Can't access child or grandchild nodes in a tree view
accepted answer: http://stackoverflow.com/a/24966540
type: Question
tagged with: angularjs-directive
has body: I have a directive that builds a tree view. It's based off of a code example at http://jsfiddle.net/KNM4q/113/. I would like to be able to click on any node in the tree, and have the click execute a method in a controller that processes data particular to that node. While I have gotten the code working in the root node and the child nodes I can't make it work with grandchildren or great granchildren nodes. Here is the plunker: http://plnkr.co/edit/AKiD8ZyKK8dUSPEcWI3p?p=preview. Here is the HTML: Here is the directive: angular.module('components') .directive('tree', function ($compile) { return { restrict: 'E', terminal: true, scope: { val: '=', parentData:'=', zo:'&' }, link: function (scope, element, attrs) { var template = '{{val.text}} Show Detail '; if (angular.isArray(scope.val.items)) { template += ' '; } scope.showDetail = function(index) { var param = 'aaa'; scope.zo(); }; var newElement = angular.element(template); $compile(newElement)(scope); element.replaceWith(newElement); } } }); Here is the controller: function appCtrl($scope) { var treeData = { "text": "root", "items": [{ "text": "Furniture", "items": [{ "text": "Tables & Chairs" }, { "text": "Sofas", "items": [{ "text": "Tables & Chairs" }, { "text": "Sofas" }] }, { "text": "Occasional Furniture" }] }, { "text": "Decor", "items": [{ "text": "Bed Linen" }, { "text": "Curtains & Blinds" }, { "text": "Carpets" }] }] }; //initial parameter that is sent $scope.param = 'root'; $scope.treeData = treeData; $scope.itemDetail = function (param){ alert('in controller ' + param); } }
score: 0
has answer: http://stackoverflow.com/a/24966540
answer count: 1

http://stackoverflow.com/comment/39003481
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25066155
type: Comment
has text: Hi @developerwjk. I am really new to this web development and don't know anything about Ajax. I am referring to other websites and forums to build until this stage. But I am stuck with the latest problem. I just need the graph to be updated without going to a new page. Any advice?

http://stackoverflow.com/q/24951015
type: Question
tagged with: javascript
tagged with: fullcalendar
tagged with: jquery
has title: FullCalendar: modal for displaying events is triggered multiple times
has body: I have been struggling with an issue that I wasn't expecting. I have a FullCalendar2 instance on my site and all event actions (insert/update/show) are handled through a Bootstrap modal box. Oddly, the "shown" and "hidden" events of the modal box appear to be "remembering" all previous "select" clicks on the calendar. Here's my code: select: function(start, end) { console.log('select start'); $('#mymodal').modal({ show : true }).on('loaded.bs.modal', function(e) { console.log('loaded'); $('#calendar').fullCalendar('unselect'); }).on('shown.bs.modal', function (e) { console.log('shown ' + start.format('DD.MM.YYYY')); $('#calendar').fullCalendar('unselect'); }).on('hidden.bs.modal', function(e) { console.log('hidden ' + start.format('DD.MM.YYYY')); $('#calendar').fullCalendar('unselect'); }); console.log('select end'); $('#calendar').fullCalendar('unselect'); }, Link to working JsFiddle - to see the error, check the console output after clicking on different empty days (click at least on two different days). As you can see, the console logs all clicks done on the calendar. I don't know why. Tried to clear the selection, clear the modal box (without destroying it, as it would render it unusable). Any idea on how to prevent the "shown" and "hidden" methods of the modal box to be called multiple times? Many thanks in advance
downvote count: 0
score: 1
favorite count: 0
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/50740296
answer count: 0
tagged with: twitter
upvote count: 1

http://stackoverflow.com/comment/41254805
has text: Actually I want to do gridcell.unbind("keydown"). But in the dataInit function I am not able to get a reference to the gridCell. How do I get a reference to the gridCell???
type: Comment
type: AnswerComment
score: 0
comment on: http://stackoverflow.com/a/25015093

http://stackoverflow.com/q/25013009
tagged with: viewport
has title: Dynamic Viewport/scale up down with Javascript
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38895381
has comment: http://stackoverflow.com/comment/38903315
answer count: 0
score: 0
has body: I have a web widget that can be deployed on different mobile sites. it is a widget that opens as full screen jquery.colorbox and display some dynamic content. as mobile website can differs - sometimes the mobile browser can scale down - in order to fit all content. this causes a problem - as my widget than opens much smaller (texts/font extc.) My widget opens on click on full screen - and its inject content into website code (not an iframe). I am looking for a way to change the viewport dynamically and on the fly- and enable an option to return to previous viewport when widget is closed. I have looked at this solution- but what I need is to be even more dynamic. Dynamic viewport changing the scale on widget open and close.
type: Question
tagged with: mobile-website
tagged with: javascript
linked to: http://stackoverflow.com/q/8469255

http://stackoverflow.com/a/24938304
has body: Solved: id: function(data){return data.Value;} I was returning a object with id and not a directly value. Thanks to @mgibsonbr from Stackoverflow PT
type: Answer
score: 6
downvote count: 1
accepted answer of: http://stackoverflow.com/q/24935840
answers question: http://stackoverflow.com/q/24935840
upvote count: 7
type: AcceptedAnswer

http://stackoverflow.com/a/25050158
upvote count: 1
score: 1
downvote count: 0
has body: AngularJS $resource If the parameter value is prefixed with @ then the value of that parameter will be taken from the corresponding key on the data object (useful for non-GET operations). You have put params in the wrong place, you should implement like this .factory('UserService', function($resource) { return $resource('api/users/:id', { id: '@id' }, { doGet: { method: 'GET' }, doPost: { method: 'POST' }, doPut: { method: 'PUT' }, doDelete: { method: 'DELETE' } }); }); Lets test it describe('userApp', function () { var UserService , $httpBackend ; beforeEach(function () { module('userApp'); }); beforeEach(inject(function (_UserService_, _$httpBackend_) { UserService = _UserService_; $httpBackend = _$httpBackend_; })); describe('User resource - api/users', function () { it('Calls GET – api/users/{id}', function() { $httpBackend.expectGET('api/users/42').respond(200); UserService.doGet({id: 42}); $httpBackend.flush(); }); it('Calls POST - api/users/{id}', function() { $httpBackend.expectPOST('api/users/42').respond(200); UserService.doPost({id: 42}); $httpBackend.flush(); }); it('Calls PUT - api/users/{id}', function() { $httpBackend.expectPUT('api/users/42').respond(200); UserService.doPut({id: 42}); $httpBackend.flush(); }); it('Calls DELETE - api/users/{id}', function() { $httpBackend.expectDELETE('api/users/42').respond(200); UserService.doDelete({id: 42}); $httpBackend.flush(); }); }); }); jsfiddle: http://jsfiddle.net/krzysztof_safjanowski/vbAtL/
type: Answer
answers question: http://stackoverflow.com/q/25044469

http://stackoverflow.com/a/24956620
has comment: http://stackoverflow.com/comment/38789640
type: AcceptedAnswer
downvote count: 1
answers question: http://stackoverflow.com/q/24956056
accepted answer of: http://stackoverflow.com/q/24956056
type: Answer
has comment: http://stackoverflow.com/comment/41000397
has body: The function as you wrote it does need a parameter and there is no way to avoid that except by including a default value in the function itself. See example below function myFunction(input) { input= input||'test'; var caps = input.toUpperCase(); var output = caps.substrin(1, 4); return output; }
has comment: http://stackoverflow.com/comment/38789996
score: 10
upvote count: 11
has comment: http://stackoverflow.com/comment/139799226

touchmove
tags question: http://stackoverflow.com/q/24911685
type: Tag
tag name: touchmove

http://stackoverflow.com/comment/38861935
score: 0
type: Comment
type: QuestionComment
has text: are the number is the function (1,2,3) are always according to number in the innerHTML (asd1,asd2,asd3) ?
comment on: http://stackoverflow.com/q/24995655

http://stackoverflow.com/comment/40493348
type: QuestionComment
comment on: http://stackoverflow.com/q/25055899
score: 0
type: Comment

http://stackoverflow.com/comment/38862912
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24956504
has text: ANyway, make sure to set an ID of your grid, controls created programatically need those IDs so they can load their ViewState after a postback. Do not leave their generation to chance and to the framework. Also, add a "return false;" statement in the button client-side handler if you do not want it to postback (I do not see code that handles it, so I assume it is not needed and you want this done on the client).

http://stackoverflow.com/comment/38758890
has text: I'd say this should be an equivalent: `$('form:first :first-child')`
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/24940575

http://stackoverflow.com/q/25002216
tagged with: javascript
score: 0
answer count: 1
has body: I've been Googling around for a while and I haven't been able to find a direct answer. If I had a file structure for a Todo app like this: app.js index.html -- Todo | -- todo.html | -- todoModule.js | -- todoController.js | -- todoDirective.js -- Routes | -- routes.js And in todoDirective.js I had: myApp.directive('todoDirective', [function() { function link(scope, element, attrs) { console.log('todo directive'); }; return { restrict: 'E', link: link, templateUrl: 'todo.html' }; }]) And in routes.js I had: myApp.config(['$routeProvider', function($routeProvider) { 'use strict'; $routeProvider .when('/', { templateUrl: '/todo', controller: 'todoController' }) .otherwise({ redirectTo: '/' }); }]); Am I correct in thinking that I will see 'todo directive' output to the console? I have a larger application I'm working on and recently found that I could not seem to access the DOM from a given directives link function. Do I have a misconception as to how Angular works? Any insight you could give would be great. Thank you.
tagged with: angularjs
has answer: http://stackoverflow.com/a/25002309
accepted answer: http://stackoverflow.com/a/25002309
type: AnsweredQuestion
type: Question
has title: Does Link Function in Directive Run via Routing?

http://stackoverflow.com/comment/38777693
type: QuestionComment
score: 2
comment on: http://stackoverflow.com/q/24950551
has text: you want to hide error message from chrome console ? :)
type: Comment

http://stackoverflow.com/comment/38884108
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25007129
has text: how is that any different than adding a class?
type: Comment

http://stackoverflow.com/a/25020018
has body: When you do Posts.find().count(); in the browser console, what do you get? If you get 0, then might have named your collections differently. Sharing some code always helps people to better answer your question.
answers question: http://stackoverflow.com/q/25006513
score: 0
type: Answer

http://stackoverflow.com/a/39208107
answers question: http://stackoverflow.com/q/25011729
has body: Assuming you have picked two nodes and stored them in source_node and target_node, and you want to label everything in between with class 'path_element': p = cy.elements().aStar({root: source_node, goal: target_node, directed: true}).path; if (p) { p.filter(function(i,x) { return x != source_node &amp;&amp; x != target_node; }) .addClass('path_element'); p.edgesWith(p) .addClass('path_element'); }
score: 0
type: Answer

http://stackoverflow.com/comment/38857496
has text: you can use ajax/jquery post method for this
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24993276

http://stackoverflow.com/a/41359346
type: Answer
answers question: http://stackoverflow.com/q/25021482
has body: I'm posting my ajax code here that has worked for me and this CORS error in console doesn't matter. If you see in network you will get the access token. see the ajax code below. function gettoken() { var param = { grant_type: "password", client_id : "id here", client_secret : "seceret here ", username:"username", password:"password with full key provided by sf"}; $.ajax({ url: 'https://test.salesforce.com/services/oauth2/token', type: 'POST', data: param, dataType: "json", contentType: "application/x-www-form-urlencoded", success: function (data) { alert(data); } }); } I hope this will work for you perfectly.
downvote count: 0
has comment: http://stackoverflow.com/comment/86802694
score: 1
upvote count: 1

http://stackoverflow.com/comment/38863710
type: QuestionComment
comment on: http://stackoverflow.com/q/24985826
score: 0
has text: @mscdex my bad. Already edited
type: Comment

http://stackoverflow.com/comment/38848443
type: AnswerComment
has text: It seems to be having an issue on my `ko.applyBindings(new ViewModel());` line in Google.js
type: Comment
comment on: http://stackoverflow.com/a/24977143
score: 0

http://stackoverflow.com/q/25011615
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
has title: How the append and delete the value of a checkbox to an ul li using jquery
has comment: http://stackoverflow.com/comment/38892257
favorite count: 0
has body: List 1 List 2 List 3 List 4 $('.checklist li').click(function () { $(this).toggleClass("active-checklist"); }); .checklist li b { font-size: 14px; font-weight: 400; color: #555454; position: relative; top: -3px; padding-left: 5px; color:#a7a7a7; } .checklist li.active-checklist b { color: #202020; font-size:inherit; top:2px; } .checklist li,.active-checklist li { margin-bottom: 4px; } .checklist { font-family:helvetica; font-size: 14px; margin-left: 23px; cursor: pointer; list-style-type: none; display: inline-block; float: left; margin-top: 15px; padding:0; } .checklist li span { width: 16px; height: 16px; border-radius: 3px; display: inline-block; background-color: #f6f6f6; border: 1px solid #c2c2c2; } .checklist li.active-checklist span { border: 1px solid #49a1d7; } .checklist li span cite { display: none; } .checklist li.active-checklist span cite { position: relative; left: 2px; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background-color: #49a1d7; border: none; } I need to append the value of the checklist li to the list of the append-checklist once the checklist li has the class active and remove the value once active class is removed from the checklist li. Thanks in advance. Please refer to the fiddle. Demo
upvote count: 2
has answer: http://stackoverflow.com/a/25011676
tagged with: css
score: 2
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38892399
has answer: http://stackoverflow.com/a/25011718
type: Question
has answer: http://stackoverflow.com/a/25011726
accepted answer: http://stackoverflow.com/a/25011676
tagged with: javascript
possible better answer: http://stackoverflow.com/a/25011718
tagged with: jquery
answer count: 3

http://stackoverflow.com/comment/38908488
score: 0
has text: can you float the date div to left and say margin-left:30px; would that help?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25020043

http://stackoverflow.com/comment/39319087
type: AnswerComment
score: 0
type: Comment
comment on: http://stackoverflow.com/a/25232657
has text: my middle page is an image gallery i will update the code for image gallery

http://stackoverflow.com/q/24984990
upvote count: 1
favorite count: 0
answer count: 0
downvote count: 0
type: UnansweredQuestion
score: 1
type: Question
tagged with: javascript
has title: Ext JS 5 : shared viewcontroller
has body: I have a little question. Is it possible to share a ViewController ? I have a Ext.grid.Panel. This component use one viewcontroller. When I want to edit a row, my program open a Ext.window.Window with a Ext.form.Form inside. I want to use the same viewcontroller instance of my grid. I can use setController but when I close my form, I think the shared viewcontroller is destroy. Is it possible to do that ? Jean-Marc

http://stackoverflow.com/q/25013135
type: UnansweredQuestion
has body: This script works fine on Chrome. It spreads tons of errors on Firefox. Here's the code that's giving errors : var ctx = document.getElementById('canvas').getContext('2d'), img = new Image, sourceWidth = coordinates(one).w, sourceHeight = coordinates(one).h, sourceX = coordinates(one).x, sourceY = coordinates(one).y; img.src = coordinates(one).image; img.onload = function() { // draw image ctx.drawImage(img, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, width, height); And these coordinates come from the other function : // get cropped coordinates coordinates = function coordinates(self) { var imgInfo = self.imgInfo, c = self.eles.container, img = self.eles.img, imgsrc = img.attr('src'), coordinates = { x: (parseInt(img.css('left'))) * (imgInfo.aw / (imgInfo.w * imgInfo.s)), y: (parseInt(img.css('top'))) * (imgInfo.ah / (imgInfo.h * imgInfo.s)), w: (c.width() - (40*2)) * (imgInfo.aw / (imgInfo.w * imgInfo.s)), h: (c.height() - (40*2)) * (imgInfo.ah / (imgInfo.h * imgInfo.s)), image: imgsrc }; // return coodinates return coordinates; } I want the image to be resized with the slider, and centered. It's working perfectly on Chrome. What can I do ? Here's the URL to test the code: nestecha.fr/cropScript
has comment: http://stackoverflow.com/comment/38895193
answer count: 0
has comment: http://stackoverflow.com/comment/38895317
has comment: http://stackoverflow.com/comment/38895131
type: Question
has title: Javascript Resizing - IndexSizeError: Index or size is negative or greater than the allowed amount
tagged with: javascript
tagged with: jquery
score: 0
has comment: http://stackoverflow.com/comment/38895408
tagged with: http://stackoverflow.com/tag/html
has comment: http://stackoverflow.com/comment/38895194

http://stackoverflow.com/q/25021631
has body: Im working on a page that should display like this http://jsfiddle.net/grahamwalsh/6RnXM/ When i debug it in microsoft visual studious i get Uncaught ReferenceError: _ is not defined I looked at other questions similar to this and added to my html file and now i get Uncaught TypeError: Cannot read property 'nodeType' of null which seems to be referencing my knockout script here is my full code Voting (html) Voting Selected Card Voting (Css) .profile { width: 50px; height: 80px; color: black; background-color: silver; border: 1px solid black; float: left; line-height: 80px; text-align: center; margin: 2px; } .highlight { background: yellow !important; border:1px solid #000; color: black; } Voting (js) function Card(number) { this.active = ko.observable(false); this.name = ko.observable(number); } var model = function () { var cards = [1, 2, 3, 5, 8, 13, 20, 40, 100]; for (var i = 0 ; i < cards.length ; i++) cards[i] = new Card(cards[i]); var items = ko.observableArray(cards) var selectedItems = ko.computed(function () { return _.filter(items(), function (item) { return item.active(); }); }) var clicked = function (item) { items().forEach(function (item) { item.active(false) }); item.active(!this.active()); }; var save = function () { alert("sending items \n" + ko.toJSON(selectedItems())); } return { items: items, selectedItems: selectedItems, save: save, clicked: clicked } }
tagged with: knockout.js
type: Question
answer count: 1
tagged with: javascript
score: 0
tagged with: http://stackoverflow.com/tag/html
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25021791
has title: "_" not defined microsoft visual studio

http://stackoverflow.com/comment/38937903
type: Comment
has text: @user3796431: i think you haven't reat the question yet. he want to do it using has
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25035856

http://stackoverflow.com/comment/38730834
has text: I see you are setting the value to "1" will this be the same as setting to true?
score: 0
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/24925540

dictionary
tags question: http://stackoverflow.com/q/25036054
tag name: dictionary
tags question: http://stackoverflow.com/q/24973830
tags question: http://stackoverflow.com/q/24909200
type: Tag
tags question: http://stackoverflow.com/q/24992867
tags question: http://stackoverflow.com/q/25049389

http://stackoverflow.com/comment/38872793
score: 0
type: Comment
type: QuestionComment
has text: I would filter the data and remove those items that you don't want to draw before passing it to D3.
comment on: http://stackoverflow.com/q/25001354

http://stackoverflow.com/q/25042868
score: 0
has comment: http://stackoverflow.com/comment/38951060
has answer: http://stackoverflow.com/a/25043155
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38951199
accepted answer: http://stackoverflow.com/a/25043155
type: AnsweredQuestion
tagged with: http://stackoverflow.com/tag/html
has body: I have two sets of sliders on my page. One set has four sliders and another set has six sliders. These two sets can be seen when you toggle between 4cos and 6cos on the top left side of my page. I want to calculate the total value of each set of sliders independently and display the total as an alert when I click the Validate button on my page. I am unable to explain properly. Please ask me if you have questions. Here is the jsfiddle http://jsfiddle.net/ApnUm/5. Here is my code. HTML &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;link rel="stylesheet" href="style.css" /&gt; &lt;link rel="stylesheet" href="jquery.nouislider.css"/&gt; &lt;!-- &lt;link rel="stylesheet" href="att.framework.css"/&gt; --&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="jquery.nouislider.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="cos_buttonsDiv"&gt; &lt;div class="cos4Button btn_bgColor"&gt;4 CoS&lt;/div&gt; &lt;div class="cos6Button"&gt;6 CoS&lt;/div&gt; &lt;div class="ConfigureCos4Header"&gt; &lt;div&gt;CoS1 is dedicated to Real Time traffic.&lt;/div&gt; &lt;div&gt;Please select a value from 0% to 100%&lt;/div&gt; &lt;/div&gt; &lt;div class="ConfigureCos6Header"&gt; &lt;div&gt;Real Time Traffic is dedicated to CoS1.&lt;/div&gt; &lt;div&gt;The available values diff based on the CoS Package&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- 4 sliders Div--&gt; &lt;div class="Configure4Div"&gt; &lt;div class="ConfigureCos4"&gt; &lt;div&gt;CoS 1 Real Time&lt;/div&gt; &lt;div class="example" id="cos4_darkBlue"&gt; &lt;div class="slider-connect" id="cos4_slider1"&gt; &lt;/div&gt; &lt;div id="cos4_field1"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="plusMinusDiv"&gt; &lt;div class="minusButton"&gt;&lt;span style="line-height:25px;font-size:33px;padding-left:11px;"&gt;-&lt;/span&gt;&lt;/div&gt; &lt;div class="plusButton"&gt;&lt;span class="icon-plus" style="line-height:28px;font-size:1…
type: Question
has title: How to calculate the total value the sliders
answer count: 1

http://stackoverflow.com/comment/38970662
type: QuestionComment
type: Comment
comment on: http://stackoverflow.com/q/25053226
score: 0
has text: i have also set

http://stackoverflow.com/q/25041446
tagged with: angularjs
tagged with: angular-resource
tagged with: angular-http
answer count: 0
type: UnansweredQuestion
score: 1
has comment: http://stackoverflow.com/comment/38949123
upvote count: 1
type: Question
has body: I want to create an interceptor that only takes action for specific $resource calls. I want the $resource calls themselves to specify whether they should be intercepted, rather than creating and maintaining a big whitelist or blacklist for the interceptor to refer to. For example, using $http you can do this: $http.get('/things', { interceptMe: true } ); Then in an interceptor: app.factory('anInterceptor', function() { return { 'response': function (response) { if (response.config.interceptMe) { // take action... } } }; }); However, with $resource there is no argument to specify a config object like this. How can I accomplish this with $resource instead of $http?
has title: how to create $resource custom config params to read in an interceptor
tagged with: angular-http-interceptors
has comment: http://stackoverflow.com/comment/38951367
downvote count: 0
tagged with: javascript
favorite count: 0

http://stackoverflow.com/comment/38807110
type: AnswerComment
has text: Worked brilliantly with the MIME type. Thanks!
comment on: http://stackoverflow.com/a/24966298
type: Comment
score: 0

http://stackoverflow.com/a/24970800
score: 0
has comment: http://stackoverflow.com/comment/38815189
type: Answer
answers question: http://stackoverflow.com/q/24970730
has body: Regular expressions can include something called a positive lookbehind assertion, which is described here: Getting the text that follows after the regex match I am unable to test whether JavaScript's regexp will do that at the moment, but if so, you're done. If not, you can do a JS split() on the result of your existing regexp using "=" as the delimiter to get the result you want. Perhaps not as neat as a single regexp, but it will get the job done. Edited to add: I was pretty sure zessx would be right even before his comment. This works: var pids = []; var url = "http://www.example.com/listing.html?pid=1234&amp;pid=1235&amp;pid=1236"; var result = url.match(/pid=(\w+)/g); for (var i=0; i&lt;result.length; i++) { pids[i] = result[i].split("=")[1]; console.log(pids[i]); }

http://stackoverflow.com/comment/82242006
has text: Why not namespace your AudioContext for re-use? So, like, `window.reusableAudioContextForMyMediaPlayer`. When you instantiate a player, you look for that. If it exists, use it. Otherwise create it.
type: AnswerComment
type: Comment
comment on: http://stackoverflow.com/a/25046735
score: 0

http://stackoverflow.com/comment/38725701
comment on: http://stackoverflow.com/q/24922008
has text: I posted an answer that will hopefully be able to help people in the future, since the error it throws isn't descriptive at all and someone's bound to run into the same problem and find this through Google.
type: Comment
type: QuestionComment
score: 1

http://stackoverflow.com/comment/38742140
type: Comment
type: QuestionComment
score: 0
has text: Please show what string you are trying to turn it into
comment on: http://stackoverflow.com/q/24932034

http://stackoverflow.com/q/24982297
type: UnansweredQuestion
has body: If I have a function as follows (pseudocode) : function doSomething (input) { input.something(something); do(input, function (res) { input.send(res) } } However, I want to be able to run it from another area, and the only shared variable between the two is $scope, so I do something like this: $scope.doSomething = function (input) { doSomething(input); } Now, I can call doSomething using $scope. However, creating an extra function to do it is quite messy. Ideally, I'd like to be able to do something like this: $scope.doSomething = doSomething(input); That doesn't work though. Is there a similar shorthand you can use to create a reference to a function from another, without the need for a 'useless' function?
has answer: http://stackoverflow.com/a/24982308
type: Question
has answer: http://stackoverflow.com/a/24982314
tagged with: javascript
score: 0
answer count: 2
has title: Shorthand to call function from scope
tagged with: angularjs

http://stackoverflow.com/comment/38881084
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25005618
has text: Yes, if you don't need to get any additional data from the server why not bind your lists and just show/filter the contents using JS?

http://stackoverflow.com/q/24956173
answer count: 1
tagged with: javascript
tagged with: jquery
has answer: http://stackoverflow.com/a/24966350
favorite count: 0
tagged with: angularjs
has title: specifying jquery as angularjs's dependency generates error in requirejs
score: 2
downvote count: 0
tagged with: requirejs
has body: I am experimenting and trying to use the angular.element (jQuery wrapper) inside angular's config() function. However, in the main.js file, as soon as I add the deps under angular, it generates the $injector:modulerr error (where the 1st comment is) Script tag is placed right before in my html file &lt;script src="js/vendor/require.min.js" data-main="js/own/main.js"&gt;&lt;/script&gt; main.js file require.config({ baseUrl: "js/vendor/", paths: { "jquery": "jquery-2.1.1.min", "angular": "angular.1.2.9.min" }, shim: { "angular": { deps: ["jquery"], // As soon as I add this, it generates a $injector:modulerr error exports: "angular" } } }); require(["angular"], function(angular){ angular .module("app", []) // ng-app="app" already defined in &lt;body&gt; .controller("appctrl", function($scope){ // ng-controller="appctrl" already defined in &lt;body&gt; $scope.sample = 1; // this works fine if I don't add deps under angular in require.config }); });
type: Question
type: AnsweredQuestion
accepted answer: http://stackoverflow.com/a/24966350
upvote count: 2

http://stackoverflow.com/q/24968034
score: 0
tagged with: api
has title: how to detect log out from fb using JS SDK without refreshing the page
has answer: http://stackoverflow.com/a/26780401
answer count: 1
tagged with: facebook-javascript-sdk
has body: Hi friends, I'm developing a website in which Facebook Javascript API is used to send message to our friends. When the user is logged out of fb,then it shows an error when popping up js API dialog box which is "Refused to display 'https://www.facebook.com/login.php?api_key=0&amp;skip_api_login=1&amp;display=dialo…cale%3Den_US%26name%3DAnything%26to%3D1791715188%26from_login%3D1&amp;rcount=1' in a frame because it set 'X-Frame-Options' to 'DENY'." Currenty,I'm using FB.getLoginStatus to detect whether the user is logged out or not. But this will work for only first time,I can't dynamically check it(That means when I logged out of fb account and coming back to the same window and trying to send next message without refresh,it shows the above error.). Here How Can I dynamically detect that the user is currently logged out. Is there any way to checking FB.getLoginStatus dynamically without page refresh. I'm showing my code below. $(document).ready(function(){ window.fbAsyncInit = function() { FB.init({appId: '**************', xfbml: true, cookie: true,status:true,oauth:true}); /*FB.Event.subscribe('auth.login', function() { //window.location.reload(); });*/ FB.Event.subscribe('auth.logout', function(response) { alert('logged out!'); }); }; function facebook_send_message(to,name) { //function called when a button is clicked FB.getLoginStatus(function(response) { if (response.status === 'connected') { console.log('how to check'); var uid = response.authResponse.userID; var accessToken = response.authResponse.accessToken; send_message(to,name); } else if (response.status === 'not_authorized') { console.log('not_authorized'); // the user is logged in to Facebook, // but has not authenticated your app } else { console.log('hi'); FB.login(function(response) { if (response.authResponse) { send_message(to,name); //getUserInfo(); // Get User Information. } else { console.log('Authorization failed.'); } },{scope: 'email'}); } }); } send_message(to,name); will send message if user…
type: UnansweredQuestion
type: Question
tagged with: javascript
tagged with: jquery

http://stackoverflow.com/a/25003688
has body: This is how I use trigger, and it works for me: $("body").bind('someEvent', function (e, arg1, arg2) { alert('arg1: ' + arg1); alert('arg2: ' + arg2); }); $("body").trigger('someEvent', ['arg1_text', 'arg2_text']);
answers question: http://stackoverflow.com/q/25003472
score: 0
type: Answer

http://stackoverflow.com/q/24926862
has body: I am working on creating cylinder using canvas and I have coded for to fill the cylinder (animate) based on the percentage. When I enter value in the textbox it start fill in back wards (Fill). But it has to fill (Green) in front direction direction how the top of the cylinder look like. If we change the cy value can direction of fill will change. Any Suggestion / solution Here is the Draw Cylinder code function draw() { ctx.clearRect(0, 0, canvasWidth, canvasHeight); // draw grey main cylinder drawCylinder(cx, cy, width, height, height / 8, '#b1b1b1', '#000'); // draw green progression cylinder var currHeight = someValue * height / 100; var newCenterY = cy - currHeight / 2 + height / 2; //Here is where green fill starts drawCylinder(cx, newCenterY, width, currHeight, height / 4, '#81ae45', null); // draw (fill and stroke) the top of the progression cylinder drawCylinderTop(cx, newCenterY, width, 100, height / 4, '#9a9a9a', null); // stroke the top of the main cylinder } Here is my code for draw cylinder function drawCylinder(x, y, w, h, vRadius, fillStyle, strokeStyle) { var w2 = w / 2; var h2 = h / 2; var ytop = -h2; var cpYtop = -h2 - vRadius; var ybottom = h2; var cpYbottom = h2 + vRadius; ctx.save(); ctx.translate(x, y); ctx.beginPath(); ctx.moveTo(-w2, ytop); ctx.bezierCurveTo(-w2, cpYtop, w2, cpYtop, w2, ytop); ctx.lineTo(w2, ybottom); ctx.bezierCurveTo(w2, cpYbottom, -w2, cpYbottom, -w2, ybottom); ctx.closePath(); performDraw(fillStyle); ctx.restore(); } If i try to change the bezierCurveTo in to static value still it was not changing. I don't have reputation to put exact output image what I want. Here is the updated fiddle link. I have modified the below line of code var newCenterY = cy + currHeight / 2 + height / 2; Previously it was var newCenterY = cy - currHeight / 2 + height / 2; I am struggling to change the direction of fill color help needed. Please do the needful. Fiddle Link Thanks in advance M
has comment: http://stackoverflow.com/comment/38735360
score: 0
has comment: http://stackoverflow.com/comment/38735592
tagged with: canvas
tagged with: html5-canvas
answer count: 1
has title: Change the fill color in front direction
has comment: http://stackoverflow.com/comment/38735850
has comment: http://stackoverflow.com/comment/38735057
has answer: http://stackoverflow.com/a/24996576
accepted answer: http://stackoverflow.com/a/24996576
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38736243
type: Question
has comment: http://stackoverflow.com/comment/38733957
has comment: http://stackoverflow.com/comment/38774376
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38734145
has comment: http://stackoverflow.com/comment/38735193

http://stackoverflow.com/q/25002676
has comment: http://stackoverflow.com/comment/38875854
downvote count: 0
tagged with: javascript
has body: I am writing an app that will send POST/GET requests from a remote client to a server. As a way to test and also educate myself I was trying to make these requests by writing a simple html file that resides on my desktop with a form that would POST to a server side php file. I also tried using ajax style requests or XMLHttprequests independent of and connected to a form but I received an error in the console: Cross Origin Request Blocked For all attempts form or no form. I have read that this is because I am making the request from FILE:// and this is not allowed by browsers unless CORS is enabled in some way. I have also read that using a webserver to host the file might fix the problem but I don't understand what is meant by webserver (separate or same domain? lamp, xammp, mamp?) and I am not interested in overriding security (allowing cors with headers) if I am eventually going to have to find a secure way when it goes live anyway. As I said I am really just trying to test and I would like my html files to communicate with the server-side php from another machine instead of just putting all files together in the same domain/folder. Is there a way to do this using html/javascript or Websockets or anything html5 has to offer that might be useful? code examples are welcome but if anyone could help me grasp this concept better it would be greatly appreciated. I am a noob XD I am open to a better approach entirely if one exists, the only constraint I have is that everything on the UI/Client end is going to be written in html/javascript but I can utilize either or both intel XDK api and Cordova api as well. Please help and thank you.
favorite count: 0
has answer: http://stackoverflow.com/a/25026879
has answer: http://stackoverflow.com/a/25020729
tagged with: http://stackoverflow.com/tag/html
tagged with: xmlhttprequest
answer count: 4
has answer: http://stackoverflow.com/a/25002908
has answer: http://stackoverflow.com/a/25002942
score: 2
upvote count: 2
type: UnansweredQuestion
tagged with: php
tagged with: intel-xdk
type: Question
has title: How to test GET/POST or better way?

http://stackoverflow.com/comment/38850095
type: Comment
has text: @Vishnu: At a page or data refresh your selection will get removed anyways if unless that is not cached, so what I would suggest if you want to stay on the selection you need to store the element id on the refresh in a localStorage of the browser and on refresh check the localStorage if it is their, if not then give a default selection
comment on: http://stackoverflow.com/a/24969643
score: 0
type: AnswerComment

http://stackoverflow.com/q/25012659
downvote count: 1
type: Question
has comment: http://stackoverflow.com/comment/38895046
tagged with: google-maps
has comment: http://stackoverflow.com/comment/38894727
accepted answer: http://stackoverflow.com/a/25013226
tagged with: javascript
score: -1
upvote count: 0
answer count: 1
has body: i have used google maps v3 and markerwithlabel as js: var marker = new MarkerWithLabel({ position: latlng, map: map, title: p[2], labelText: '&lt;div class="roundrect_apt"&gt;'+j+'&lt;/div&gt;&lt;div class="line_apt"&gt;&lt;/div&gt;&lt;div class="downline_apt"&gt;&lt;/div&gt;', labelStyle: {top: "0px", opacity: 0.75}, labelVisible: true, infowindow:newinfowindow }); style: .roundrect_apt{ width:28px; height:28px; border-radius:5px; background:#06F; box-shadow:1px 1px 1px #666; border:3px solid #009; text-align: center; color:#fff } .line_apt { width:5px; height:15px; background:linear-gradient(to right,grey,white); moz-linear-gradient(right,grey,white); -o-linear-gradient(right,grey,white); webkit-linear-gradient(left,grey,white); margin-left:14px; } .downline_apt{ width:18px; height:5px; background:#06F; border-top-left-radius:4px; border-top-right-radius:4px; margin-left:7px; box-shadow:1px 1px 1px #666; } and drawn a drag-gable circle. I am trying to show marker in that circle bound which working improperly. Markers are shown even if they are out of bounds. please help
has comment: http://stackoverflow.com/comment/38894991
favorite count: 0
has title: google marker inbound not working with proper results
has answer: http://stackoverflow.com/a/25013226
type: AnsweredQuestion

http://stackoverflow.com/comment/38988640
has text: missing a second double quote `$(this).attr("id"));`
score: 0
type: Comment
type: AnswerComment
comment on: http://stackoverflow.com/a/25062556

http://stackoverflow.com/comment/38931120
type: QuestionComment
has text: As the date I want only the date not whole date with the time stamp. I want the time stamp removed.
comment on: http://stackoverflow.com/q/25031365
score: 0
type: Comment

http://stackoverflow.com/comment/38945762
type: QuestionComment
comment on: http://stackoverflow.com/q/25008009
has text: Right now, no one has any idea what the actual issue is by reading your title. Updating it will draw more attention and you will get a solution faster. I edited it myself but I don't really know google chart
score: 0
type: Comment

http://stackoverflow.com/a/39659073
type: Answer
downvote count: 0
score: 1
answers question: http://stackoverflow.com/q/25026399
has body: In my case the problem was with the type of the button. ReactDOM gets lost if you use a type="button" in a &lt;button&gt;. I removed the type="button" and added a event.preventDefault() on my onClick handler and it worked for me.
upvote count: 1

http://stackoverflow.com/q/24921501
has comment: http://stackoverflow.com/comment/38723425
type: UnansweredQuestion
tagged with: http://stackoverflow.com/tag/html
tagged with: events
has comment: http://stackoverflow.com/comment/38723276
has body: If you have a select: option A option B option C And you focus the select and then use the arrows to change the selected option, Firefox 30 will not trigger the "change" event on that select. This is how FF chose to implement the "change" event and they said it won't be fixed (it seems that this is what the standard says). To try to get around this problem we can register the handler for both "change" and "keyup" events so we get the event even when the user uses the keyboard: sel.addEventListener("change", handle_change); sel.addEventListener("keyup", handle_change); Except now we run into another bug http://jsfiddle.net/xLCNX/ that will appear when the user uses both the mouse and the keyboard to select options (use mouse to select option B, use keyboard to select option C, use again mouse to select option B - no change event will be triggered for this last action). To solve this problem what you need to do is to put this in the event handler: sel.value = sel.value; Code from fiddle: HTML: with the mouse(!) select option B. Event change is triggered. keyboard(!) press down arrow to select option C. Event keyup is triggered. with the mouse(!) select option B again. No event is triggered Because we have selected the same option that was previously selected (B), there is no change so FF will not trigger a change event. When we select option C with the keyboard, only the displayed option and the select.value changed to option C. Somehow, internally, FF kept the original value, option B. So when we selected back option B FF decides that nothing changed. The problem is the inconsistency between what FF knows is the current value and the other two values: the displayed value and the select.value value. option A option B option C JS: var handle_change = function() { log.innerHTML += " option " + sel.value + " "; //uncomment this to fix the bug //sel.value = sel.value; }; var sel = document.getElementById("sel"); var log = document.getElementById("log"); sel.addEventListen…
has comment: http://stackoverflow.com/comment/38723257
has comment: http://stackoverflow.com/comment/38723362
type: Question
has answer: http://stackoverflow.com/a/24921502
has comment: http://stackoverflow.com/comment/38723464
score: 1
has title: Javascript: "change" event not triggered when using the keyboard on a html select element in Firefox
tagged with: javascript
has comment: http://stackoverflow.com/comment/38723321
upvote count: 2
has comment: http://stackoverflow.com/comment/38723198
tagged with: onchange
tagged with: firefox
answer count: 1
downvote count: 1
has comment: http://stackoverflow.com/comment/38723472
favorite count: 0

http://stackoverflow.com/q/24915200
tagged with: wordpress
type: Question
tagged with: quicksand
tagged with: javascript
tagged with: jquery
score: 0
answer count: 1
type: UnansweredQuestion
has title: Hide Multiple Image data-id on load and Revealing them when Clicking a button
has answer: http://stackoverflow.com/a/24915736
tagged with: php
has body: I currently have an image gallery with a filtering capability (Jquery Quicksand) which is in Wordpress. Each image in the gallery possesses a data-id (eg data-id="id-148"). I'd like to ask help on how to code on jQuery. I hope to have a multiple set of data-ids initially removed (or hidden) when the website loads then when I click on certain buttons (a href) with specific Class, these data-ids will then be showed. Let's say onLoad of the website, the images with data ids: 148, 149, 150 will be hidden then onClick of a button with a particular class class="show" then data-ids 148, 149, 150 will show. When I click class="All" the data-ids mentioned above will be hidden again. The image is located in a list-item as such: &lt;li class="one-third column" data-id="id-148" data-type="Apples"&gt; Hope to have some help. Thank you so much.

http://stackoverflow.com/a/24953637
has body: you can try to give change function to your form using $('.form :input').change(function(e){ $('#log').prepend(' Form changed ' + $(e.target).attr('id') + ' ') }); Demo1 Demo2
score: 2
downvote count: 0
answers question: http://stackoverflow.com/q/24953582
type: Answer
upvote count: 2

http://stackoverflow.com/comment/38946589
type: QuestionComment
has text: Thank you again for that. I guess if I can find a node package then this should be doable. I'm currently using Jcrop for the front end part of it, so I don't see any reason to stop using it.
comment on: http://stackoverflow.com/q/25038885
score: 0
type: Comment

http://stackoverflow.com/comment/38741512
type: QuestionComment
score: 0
has text: @pawel Sorry my bad, it used to be IE-specific. Unknown support for Safari would reason enough not to use it though.
type: Comment
comment on: http://stackoverflow.com/q/24931462

http://stackoverflow.com/comment/38947190
score: 0
type: QuestionComment
type: Comment
has text: http://stackoverflow.com/questions/23962117/load-content-every-time-bottom-of-page-is-reached/23962161#23962161
comment on: http://stackoverflow.com/q/25040861

http://stackoverflow.com/comment/38989724
has text: @Ryhnn that's contradictory - the latter is also a good approach, but it's not the one you agreed with in the first few words ;-). As it happens in jQuery-based code I prefer that latter approach because it preserves the jQuery semantic that `this` refers to the element receiving the event and not the enclosing object.
score: 0
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25063222

http://stackoverflow.com/q/24937786
has body: I am trying to toggle an image and toggle a Div' visibility at the same time, this is what I have so far. When I click on the image to activate the Toggle it is submitting the form, which isn't ideal... Recurring: Please select the frequency: Please Select 10
has answer: http://stackoverflow.com/a/24938147
accepted answer: http://stackoverflow.com/a/24938147
tagged with: http://stackoverflow.com/tag/html
tagged with: css
type: AnsweredQuestion
has title: Javascript toggling image and div
has comment: http://stackoverflow.com/comment/38753512
tagged with: toggle
type: Question
tagged with: togglebutton
tagged with: javascript
score: 0
answer count: 1

http://stackoverflow.com/q/24914177
downvote count: 3
linked to: http://stackoverflow.com/q/2480699
accepted answer: http://stackoverflow.com/a/24914199
upvote count: 0
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/24914199
has comment: http://stackoverflow.com/comment/38709423
has body: I have run the following code in several browser console and I had the same result everytime : &gt;&gt;&gt; (17.06 * 100) === 1706 false &gt;&gt;&gt; (6.06 * 100) === 606 true This is not logic. Where does the problem come from ?
favorite count: 0
duplicate of: http://stackoverflow.com/q/2480699
has title: Wrong result for a multiplication
tagged with: multiplication
score: -3
type: Question
type: AnsweredQuestion

http://stackoverflow.com/q/25019761
upvote count: 1
has comment: http://stackoverflow.com/comment/38920031
has answer: http://stackoverflow.com/a/25019808
tagged with: lookbehind
score: -1
type: Question
has title: JavaScript regex with positive lookbehind emulation
tagged with: javascript
has comment: http://stackoverflow.com/comment/38930256
answer count: 1
tagged with: regex
favorite count: 0
type: UnansweredQuestion
downvote count: 2
has body: I am trying to create a regex that will extract the bold portion from a Flickr URL. I want the string between www.flickr.com/photos/ and /. https://www.flickr.com/photos/annaheimkreiter/14785981533/in/explore-2014-07-28 ^^^^^^^^^^^^^^^ I have looked at various answers here and have not been able to adapt them to this aim.

http://stackoverflow.com/a/24913251
score: 0
answers question: http://stackoverflow.com/q/24909909
type: Answer
has comment: http://stackoverflow.com/comment/38715463
has body: This should give you a good start with what you're trying to accomplish. *There is probably a better way to code this, but the illustrator documentation doesn't seem to be too helpful in figuring out how to instantiate or compare colors. var layer = app.activeDocument.activeLayer; var testColor = new RGBColor(); // initial default colour testColor.red = 255; // rest of the values default to 0 var greyColor = new CMYKColor(); // initial default grey greyColor.black = 75; // rest of the values default to 0 for (var i=0; i&lt;layer.pathItems.length; i++) { var item = layer.pathItems[i]; if (item.fillColor.red === testColor.red &amp;&amp; item.fillColor.blue === testColor.blue &amp;&amp; item.fillColor.green === testColor.green) { item.fillColor = greyColor; } }
has comment: http://stackoverflow.com/comment/38714697

import
type: Tag
tag name: import
tags question: http://stackoverflow.com/q/25038377

http://stackoverflow.com/comment/38979124
score: 0
comment on: http://stackoverflow.com/a/25051546
has text: There is no need for a return statement since the return value is irrelevant. All that is of interest is what value is assigned to *this* within the function **when it's called** since that is the object on which the *count* property will be resolved and which an attempt will be made to increment using the `++` operator. If *this* is set to *counter* using `counter.inc()` then *counter.count* is incremented. If *this* isn't set, as in `func()`, its *this* isn't set so it defaults to the global object and so the `++` operator increments `window.count`.
type: AnswerComment
type: Comment

http://stackoverflow.com/comment/38811377
score: 0
type: Comment
has text: Yes, I like that. Now I just need my Q2 result, to get a link in my home page to open a specific answer on the faq page, let's say question/answer 2 shown by code in your 'reference' link.
comment on: http://stackoverflow.com/a/24968159
type: AnswerComment

kendo-grid
tags question: http://stackoverflow.com/q/25055051
tags question: http://stackoverflow.com/q/24997246
tags question: http://stackoverflow.com/q/25031442
tags question: http://stackoverflow.com/q/24982708
tags question: http://stackoverflow.com/q/25060935
tag name: kendo-grid
tags question: http://stackoverflow.com/q/25067474
tags question: http://stackoverflow.com/q/25020074
tags question: http://stackoverflow.com/q/24972259
tags question: http://stackoverflow.com/q/25014788
tags question: http://stackoverflow.com/q/24955384
type: Tag
tags question: http://stackoverflow.com/q/24931390
tags question: http://stackoverflow.com/q/24941068
tags question: http://stackoverflow.com/q/25031116

http://stackoverflow.com/comment/38874699
has text: By Jove he's done it!! I'm eternally indebted to you :) I've accepted your answer and as soon as I reach fifteen (still a real noob on here - obvious right! lol) I'll mark your answer up. Many thanks!
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25002219
type: Comment

http://stackoverflow.com/a/24973347
upvote count: 3
has comment: http://stackoverflow.com/comment/38820229
type: AcceptedAnswer
has comment: http://stackoverflow.com/comment/38820332
has body: You can achieve this with some ways. I will show one with Web Storage: js $(document).ready(function(){ var isClose = localStorage.getItem("isClose"); if(isClose == "false"){ $(".box").hide(); } $(".close-open").click(function(){ $(".box").toggle( function(){ localStorage.setItem("isClose", $(this).is(':visible')); }); }); }); fiddle The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year.
type: Answer
accepted answer of: http://stackoverflow.com/q/24973159
downvote count: 0
answers question: http://stackoverflow.com/q/24973159
has comment: http://stackoverflow.com/comment/38820550
score: 3
has comment: http://stackoverflow.com/comment/38820296

http://stackoverflow.com/a/24938955
score: 1
upvote count: 1
downvote count: 0
answers question: http://stackoverflow.com/q/24937295
accepted answer of: http://stackoverflow.com/q/24937295
type: AcceptedAnswer
has body: As you said it's a js.erb file so you can use ruby statements inside it so simply check for your variable and use js inside its block something like: &lt;% if @size == 1 %&gt; $("#some_id_of_button").fadeout(); &lt;% end %&gt;
type: Answer

http://stackoverflow.com/comment/38753354
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24937572
has text: Nice article on this one http://www.2ality.com/2014/01/eval.html?m=1
score: 0

http://stackoverflow.com/comment/38850114
comment on: http://stackoverflow.com/q/24982093
has text: Sid: I don't know PHP. Here is the page which I need to auto login to: https://portal.dorad.co.il/#/Login unfortunatlly it's not in english. The first field is the username, the second field is the password and the button is the login
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38867673
score: 1
type: AnswerComment
type: Comment
has text: That is true. I'm just letting you know that this doesn't answer OP's question as-written.
comment on: http://stackoverflow.com/a/24998702

http://stackoverflow.com/a/25062247
has body: That's exactly what Object.freeze() is for. From MDN: The Object.freeze() method freezes an object: that is, prevents new properties from being added to it; prevents existing properties from being removed; and prevents existing properties, or their enumerability, configurability, or writability, from being changed. In essence the object is made effectively immutable. The method returns the object being frozen. Note: Object.freeze() is not supported in IE v8 and below.
type: Answer
answers question: http://stackoverflow.com/q/25062209
downvote count: 0
has comment: http://stackoverflow.com/comment/38987696
has comment: http://stackoverflow.com/comment/38987599
score: 1
has comment: http://stackoverflow.com/comment/38987787
has comment: http://stackoverflow.com/comment/38987657
upvote count: 1
has comment: http://stackoverflow.com/comment/38987613
has comment: http://stackoverflow.com/comment/38987622

http://stackoverflow.com/a/24943179
answers question: http://stackoverflow.com/q/24942911
has body: Based on my experience, you can do communicate client to client using Channels. This will only work if they're on the same Network, same subnet and have multicast enabled.
type: Answer
upvote count: 2
downvote count: 1
has comment: http://stackoverflow.com/comment/38766103
score: 1

http://stackoverflow.com/a/25034730
accepted answer of: http://stackoverflow.com/q/25034680
answers question: http://stackoverflow.com/q/25034680
type: AcceptedAnswer
downvote count: 0
type: Answer
upvote count: 3
has body: Use word boundaries, (\b\d\b) Replacement string: 0$1 DEMO &gt; "3-3-7-3-9-8-10-5".replace(/(\b\d\b)/g, "0$1") '03-03-07-03-09-08-10-05' Explanation: ( starting point of first Capturing group. \b Matches between a word character and a non word character. \d Matches a single digit. \b Matches between a word character and a non word character. ) End of first Capturing group.
score: 3

http://stackoverflow.com/comment/38772713
comment on: http://stackoverflow.com/a/24947770
type: Comment
score: 1
has text: @Sethe23, angularjs will eval the ng-init expression. single quote is javascript syntax to assign value.
type: AnswerComment

http://stackoverflow.com/comment/38885096
type: AnswerComment
score: 0
type: Comment
has text: thanks for the answer, the text box which i will be validating is created dynamically which means the text may or may not exist. so after finding the text box existence only will have to do the validation and alert the user if the value does not match.
comment on: http://stackoverflow.com/a/25007796

http://stackoverflow.com/q/25046470
tagged with: web-audio-api
favorite count: 0
type: Question
accepted answer: http://stackoverflow.com/a/35564886
has answer: http://stackoverflow.com/a/65047804
score: 22
has title: Failed to construct 'AudioContext': number of hardware contexts reached maximum
answer count: 5
has answer: http://stackoverflow.com/a/46135705
upvote count: 22
downvote count: 0
tagged with: javascript
has answer: http://stackoverflow.com/a/25046735
has answer: http://stackoverflow.com/a/35564886
has answer: http://stackoverflow.com/a/47614167
has body: Is there a way to remove an AudioContext after I've created it? var analyzers = []; var contexts = []; try { for(var i = 0; i&lt;20; i++) { contexts[i] = new AudioContext(); analyzers[i] = contexts[i].createAnalyser(); } }catch(e) { console.log(e); // too many contexts created -- how do I remove them? } I've tried this, but it doesn't let me create new contexts after the fact: analyzers.forEach(function(analyzer){analyzer.disconnect(analyzer.context.destination)}) I am using Chrome 36 on Ubuntu Linux 14.04.
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/25046735

cryptography
tag name: cryptography
type: Tag
tags question: http://stackoverflow.com/q/24914616
tags question: http://stackoverflow.com/q/24941475

http://stackoverflow.com/a/25046411
upvote count: 1
has comment: http://stackoverflow.com/comment/38958283
has comment: http://stackoverflow.com/comment/38958323
type: AcceptedAnswer
downvote count: 0
answers question: http://stackoverflow.com/q/25046072
type: Answer
accepted answer of: http://stackoverflow.com/q/25046072
has body: Your code only is grabbing the title attribute of the first .timeago element. [jQuery's attr()][1] method "[gets] the value of an attribute for the first element in the set of matched elements or [sets] one or more attributes for every matched element" (docs). Use jQuery's .each method if you want to perform an action on each selected element in a set: $(".timeago").each(function() { var dateString = $(this).attr('title'); var dateConvert = new Date(dateString); $(this).attr('title', dateConvert.toISOString()); });
score: 1

http://stackoverflow.com/a/24926157
has body: You are indeed correctly that selects are (annoyingly) operating system dependent, for understandable (yet still annoying) reasons. The above solution requires that you still define a size, however. There is no reason to alter a simple select without some tricks. If you really want to make sure your selects are styled in another matter, it may be worthwhile looking into Chosen, a jQuery plugin for select boxes. What they do is change the selects into divs and spans that are styled to look like a select. For example: Choose a Country... The plugin is then used to add functionality and style it to look better. Regardless, what you have now is probably the most you'll be able to accomplish without a plugin like Chosen (unless you choose to build it yourself).
has comment: http://stackoverflow.com/comment/38731635
type: Answer
score: 1
has comment: http://stackoverflow.com/comment/38756919
upvote count: 1
answers question: http://stackoverflow.com/q/24926054
has comment: http://stackoverflow.com/comment/38732305
has comment: http://stackoverflow.com/comment/38731466
has comment: http://stackoverflow.com/comment/38731683
downvote count: 0

http://stackoverflow.com/q/24911704
has comment: http://stackoverflow.com/comment/38704442
has comment: http://stackoverflow.com/comment/38704084
type: Question
tagged with: mongodb
tagged with: javascript
tagged with: express
upvote count: 1
answer count: 1
has title: outsource XXX.db.bson_serializer.ObjectID.createFromHexString(id) to a function?
accepted answer: http://stackoverflow.com/a/24912127
has body: I went through this express tutorial. I was wondering if it is possible to outsource the following call to a separate function, as it is very very long? employee_collection.db.bson_serializer.ObjectID.createFromHexString(id) This is the whole file where the statement is called: var Db = require('mongodb').Db; var Connection = require('mongodb').Connection; var Server = require('mongodb').Server; var BSON = require('mongodb').BSON; var ObjectID = require('mongodb').ObjectID; EmployeeProvider = function(host, port) { this.db = new Db( 'node-mongo-employee', new Server(host, port, {}), {safe: true} ); this.db.open(function(){}); }; ... // find an employee by id EmployeeProvider.prototype.findById = function(id, callback) { this.getCollection( function(error, employee_collection) { if( error ) callback(error) else { employee_collection.findOne( {_id: employee_collection.db.bson_serializer.ObjectID.createFromHexString(id)}, function(error, result) { if( error ) callback(error) else callback(null, result) } ); } } ); }; ... exports.EmployeeProvider = EmployeeProvider; It's the controller of an express application. It's shortened, but should give you an idea of what it does. You can find the whole application on Github. I tried getid = function( employee_collection, id ) { return employee_collection.db.bson_serializer.ObjectID.createFromHexString(id); }; and called the function with {_id: getid(employee_collection, id), but I'm getting a very long ENOENT error with that one.
favorite count: 0
has answer: http://stackoverflow.com/a/24912127
tagged with: node.js
type: AnsweredQuestion
downvote count: 0
score: 1

http://stackoverflow.com/comment/38830043
has text: Similar question in different language: http://stackoverflow.com/questions/23573393/how-to-manage-server-side-processes-using-mysql/23577751#23577751
comment on: http://stackoverflow.com/q/24978528
type: QuestionComment
type: Comment
score: 0

http://stackoverflow.com/a/66939862
answers question: http://stackoverflow.com/q/25060924
has body: These days there is an option to set the log level on the global firebase object: import firebase from 'firebase/app'; firebase.setLogLevel('silent')
score: 4
upvote count: 4
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25060924
type: Answer

http://stackoverflow.com/q/24935404
type: Question
upvote count: 4
tagged with: validation
answer count: 1
has answer: http://stackoverflow.com/a/24936481
tagged with: javascript
tagged with: jquery
tagged with: jqbootstrapvalidation
favorite count: 0
accepted answer: http://stackoverflow.com/a/24936481
downvote count: 1
type: AnsweredQuestion
score: 3
has body: I have a form that its fields expand in different tabs. I am using bootsrap framework and bootstrapValidator to validate forms. But the problem is that when I am processing fields in first tab form fields at this tab validate normally. If all fields are correct and I press submit, form gets submited no matter if all other fields are not valid.Why is that? Personal Data This are your billing data First name: Middle name: Last name: Adress: Email: Phone no: Mobile: No of doctors: User details Please provide with username and password First name: Last name: Username: Email address: Password: Password confirmation: Practice Details Please provide details of your practice If you don't provide we will use your client details. Name: Address: Postal code: Phone no: City: and bootstrapValidator js $("#register-form").bootstrapValidator({ fields:{ "client-first_name":{ validators:{ notEmpty:{ message:"This field is required" } } }, "client-last_name":{ validators:{ notEmpty:{ message:"This field is required" } } }, "client-phone_no":{ validators:{ notEmpty:{ message:"This field is required" } } }, "client-adress":{ validators:{ notEmpty:{ message:"This field is required" } } }, "client-mobile_no":{ validators:{ notEmpty:{ message:"This field is required" } } }, "client-no_of_doctors":{ validators:{ notEmpty:{ message:"This field is required" } } }, "client-email": { validators: { remote:{ url:"url_to_check_availability", message: "This email already exists", type:"GET" }, notEmpty:{ message: "This field is required" } } }, "user_data-username": { validators: { remote: { url: "url_to_check_availability", message: "This username already exists", type: "GET" }, notEmpty: { message: "This field is required" } } }, "user_data-password1":{ validators:{ notEmpty:{ message:"This field is required" } } }, "user_data-password2":{ validators:{ identical:{ field:"user_data-password1", message:"Passwords do not match" } } }, "practice_data-logo":{ validators:{ } } } }).on('success.form.bv…
has title: Multi tab forms and bootstrapValidator
tagged with: forms

http://stackoverflow.com/q/25061939
has comment: http://stackoverflow.com/comment/38987003
score: 2
tagged with: .net-1.1
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
has body: I'm wondering. Is there any way to upload picture to the server with using javascript(jquery)? And save picture path(name) into database? I'm running Windows platform server in asp .net 1.1. (I'm remaking 10years old web page) There are absolutely no chance to use php that I know well.. Thanks for all comments, I'm pretty desperate..
has answer: http://stackoverflow.com/a/25062295
has title: Uploading picture to the server using javascript
has answer: http://stackoverflow.com/a/25062258
has comment: http://stackoverflow.com/comment/38987780
tagged with: asp.net
favorite count: 0
has comment: http://stackoverflow.com/comment/38987770
upvote count: 2
type: UnansweredQuestion

http://stackoverflow.com/comment/39037042
comment on: http://stackoverflow.com/a/25077556
type: AnswerComment
score: 0
type: Comment
has text: I did manage to get a little further on Sebastian's plugin idea. I managed to get the plugin to create the startType property for each series but it is still coming up undefined within the ChangeChartType function. See this fiddle: http://jsfiddle.net/usq62/1/

http://stackoverflow.com/comment/38977404
type: Comment
score: 1
comment on: http://stackoverflow.com/q/25056493
has text: You can use a [custom time format](http://bl.ocks.org/mbostock/4149176).
type: QuestionComment

http://stackoverflow.com/comment/38962382
has text: You don't need to be logged in for sessions to work, so yes this works for someone who is not logged in. That said I use a different session variable to determine if someone is logged in, and if they aren't logged in they can't access this page anyway.
comment on: http://stackoverflow.com/a/24922812
score: 0
type: AnswerComment
type: Comment

http://stackoverflow.com/q/24930386
answer count: 1
downvote count: 0
tagged with: jquery
tagged with: file-upload
favorite count: 0
type: UnansweredQuestion
has body: I'm using jQuery fileupload plugin, which works quite well when uploading files by clicking the file input and choosing via the browser's dialog. However when using drag &amp; drop, it seems to submit an empty file input ------WebKitFormBoundaryCA4VuYwsPr7h4ItR Content-Disposition: form-data; name="attachment"; filename="" Content-Type: application/octet-stream although the data object inside the fileupload's add callback does have a file right before calling data.submit() files: Array[1] 0: File lastModifiedDate: Tue Mar 18 2014 13:29:07 GMT+0100 (CET) name: "17_1395143728_0.png" size: 13542 tempID: 1 type: "image/png" webkitRelativePath: "" __proto__: File length: 1 Does anyone have an idea why this happens? Edit: the code: $(document).bind('drop.fileUpload', function (e) { if(jQuery(e.target).attr('id') !== 'dropZone'){ return; } var fileInput = jQuery('#attachment'); var files = e.originalEvent.dataTransfer.files; if (fileInput.length &amp;&amp; files.length) { jQuery('#dropZone').hide(); fileInput.fileupload('add', {files: files}); e.preventDefault(); } }); jQuery('.js_toggleFileupload').fileupload({ autoUpload: true, forceIframeTransport: true, progressInterval: 50, url: '/xhr', add: function (e, data) { console.debug(data); // this is where the data object has files var jqXHR = data.submit().done(function (e, data) { // this is where an empty file input is submitted //stuff happens here } } });
upvote count: 3
has title: jQuery fileupload with drag&drop submits empty file input
has comment: http://stackoverflow.com/comment/38739291
type: Question
score: 3
has answer: http://stackoverflow.com/a/24996078
tagged with: javascript

http://stackoverflow.com/comment/38941643
comment on: http://stackoverflow.com/a/25037133
type: Comment
type: AnswerComment
has text: Aha! Now we are getting closer. "*prepended to it's core*" what do I need to prepend and why if the id is unique?
score: 0

http://stackoverflow.com/comment/38729980
has text: thanks it's corrected
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24915252
score: 0

http://stackoverflow.com/q/24925907
score: 1
has body: Code: var getImageFromUrl = function(url, callback) { var img = new Image(); img.onError = function() { alert('Cannot load image: "'+url+'"'); }; img.onload = function() { callback(img); }; img.src = url; } getImageFromUrl(somurl, Nextline); LINE1-//should come here after callback(img) I wanted that after img.onload function the compiler will run code in line1
upvote count: 1
has title: Can callback function can be next line of code
has comment: http://stackoverflow.com/comment/38731014
type: Question
has comment: http://stackoverflow.com/comment/38731142
tagged with: function
tagged with: javascript
answer count: 1
downvote count: 0
has answer: http://stackoverflow.com/a/24926105
tagged with: jquery
favorite count: 0
type: UnansweredQuestion
tagged with: onload

http://stackoverflow.com/comment/38940755
comment on: http://stackoverflow.com/q/25037454
has text: Why don't you pass a parameter to your javascript function, to determine in it, which input to enable? Then you would need the function only once.
score: 0
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/38979662
score: 0
type: Comment
type: QuestionComment
has text: Please re-word your question title, maybe it will stop the downvotes.
comment on: http://stackoverflow.com/q/25058134

http://stackoverflow.com/q/25063135
type: UnansweredQuestion
upvote count: 1
answer count: 0
score: 1
type: Question
has title: Angularjs: highlight selected range in datepicker hover
tagged with: javascript
has comment: http://stackoverflow.com/comment/60738323
downvote count: 0
has body: I'm trying to simulate a similiar effect as Kayak does in his datepicker. When you select a Depart date and then go to return date, see that the date range is highlighted when you hover a single date. For this, i'm using a customized version of an angular datepicker and have tried things like asigning the date i'm hovering to ng-mouseover directeve and then a condition in the ng-class directive like (hover-date > depart-date), but this just add the class to the hovered date and not to the complete range (the thing that does right is not adding the class when you hovered dates before the depart-date). Hope i'm being clear, tell me if not.
favorite count: 0
tagged with: angularjs

http://stackoverflow.com/comment/38947902
type: AnswerComment
score: 0
type: Comment
has text: @DLP You can access in both regex to the text you want using the content of capturing group. In the links provided you can check the Match Information to see the group content. By the way, in the second link I show you how to use the 2nd group to replace the content. To use the content of capturing group you have to you `\n` where `n` is the number for the group. It is `\1` in the first regex and `\2` in the second to get the content you want
comment on: http://stackoverflow.com/a/25040111

http://stackoverflow.com/q/24958038
upvote count: 2
has answer: http://stackoverflow.com/a/24981858
has title: Scroll div onload to bottom, as well as when updated with new data - angularjs
score: 2
type: AnsweredQuestion
possible better answer: http://stackoverflow.com/a/24958368
type: Question
answer count: 2
downvote count: 0
tagged with: javascript
tagged with: jquery
favorite count: 0
tagged with: http://stackoverflow.com/tag/html
accepted answer: http://stackoverflow.com/a/24981858
has answer: http://stackoverflow.com/a/24958368
has body: I'd like to essentially re-create the behavior of the iPhone's "Messages" app, in webapp form using Angularjs (or any other js honestly). I have a div that contains all my messages, then each message is a nicely controlled element as well. When a user loads the message directive, I'd like the div container to basically load at the bottom, then when a new message enters into the container I want the div to auto-scroll to the bottom. So far the best thing I can think to do is: window.setInterval(function() { var elem = document.getElementById('data'); elem.scrollTop = elem.scrollHeight; }, 4000); I'm using Angular so anything baked in would be nice, but everything I try/find seems slightly hacky and can't quite duplicate the same behavior as the "Messages" app. EDIT: I've also tried $scope.$watch('messages',function(){ console.log('messages changed') var elem = document.getElementById('messageDiv'); elem.scrollTop = elem.scrollHeight; }); The frustrating thing here, is that this doesn't work on load, additionally, if I execute the function in Chrome's developer console, it scrolls automatically to the bottom!
tagged with: angularjs

http://stackoverflow.com/comment/38900587
type: Comment
type: QuestionComment
score: 0
comment on: http://stackoverflow.com/q/25016021
has text: Are you looking for a [radar chart](http://bl.ocks.org/nbremer/6506614)?

http://stackoverflow.com/comment/38777617
comment on: http://stackoverflow.com/q/24949929
score: 0
type: Comment
type: QuestionComment
has text: [textStatus:parseerror][thrownError: SyntaxError:Syntax error]

http://stackoverflow.com/q/24938525
has answer: http://stackoverflow.com/a/24939482
has answer: http://stackoverflow.com/a/24939066
favorite count: 0
tagged with: angularjs
accepted answer: http://stackoverflow.com/a/24939482
has comment: http://stackoverflow.com/comment/38756210
has body: I get my data from the server and show it in a select drop down. Is there a way to not show a specific proj? For example, if (proj.Id != currentProject.Id) The drop down basically shows all the projects, and I want to show all the projects except the current one. Is this possible with the ? Or do I need to use ng-repeat?
has comment: http://stackoverflow.com/comment/38754950
upvote count: 1
linked to: http://stackoverflow.com/q/14733136
type: AnsweredQuestion
has title: not show specific resource in select drop down in angular
tagged with: javascript
type: Question
answer count: 2
has comment: http://stackoverflow.com/comment/38755750
downvote count: 0
possible better answer: http://stackoverflow.com/a/24939066
score: 1

http://stackoverflow.com/comment/38833641
comment on: http://stackoverflow.com/q/24925435
has text: You seem to be offended. Sorry for that. Am still looking for the answer. and if I don't find any alternative, developing it myself is plan B.
score: 0
type: QuestionComment
type: Comment

http://stackoverflow.com/q/25004895
has body: I have 2 JSON arrays, both of which can contain nested arrays: var serverArr = [ { "id": 1, "text": "Item 1" }, { "id": 2, "text": "Item 2" }, { "id": 3, "text": "Item 3", "children": [{ "id": 20, "text": "Item 20" }, { "id": 21, "text": "Item 21" }] }, { "id": 4, "text": "Item 4" } ]; var userArr = [ { "id": 1, "text": "Item 1" }, { "id": 3, "text": "Item 3", "children": [{ "id": 20, "text": "Item 20" }, { "id": 25, "text": "Item 25" }] }, { "id": 5, "text": "Item 5" } ]; What I need to do is combine them into 1 array, only taking the matching values. So the result should look like: [{ "id": 1, "text": "Item 1" }, { "id": 3, "text": "Item 3", "children": [{ "id": 20, "text": "Item 20" }]}]; I'm using the results with the jsTree plugin, so the format has to be like this unfortunately. How can I get the end result from those 2 arrays?
score: 0
has comment: http://stackoverflow.com/comment/38880180
answer count: 1
has comment: http://stackoverflow.com/comment/38880155
type: UnansweredQuestion
has answer: http://stackoverflow.com/a/25005536
has title: Joining 2 JSON arrays, only taking the matches
tagged with: http://stackoverflow.com/tag/json
linked to: http://stackoverflow.com/q/8672383
type: Question
has comment: http://stackoverflow.com/comment/38880230
tagged with: arrays
tagged with: javascript

http://stackoverflow.com/comment/38855922
comment on: http://stackoverflow.com/q/24992005
type: Comment
type: QuestionComment
has text: Object can generally communicate with each other using events. Angular has emitter/listener methods available on the `scope` and `rootScope` which can be used. As in `$on`, `$emit`, `$brodcast`. See http://stackoverflow.com/questions/14502006/scope-emit-and-on-angularjs for difference between `$emit` and `$broadcast`
score: 0

http://stackoverflow.com/comment/38979135
score: 1
has text: What if you put `debugger` keyword in your script and run it with debugger active? Will it stop there and show you the source?
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/25056395

http://stackoverflow.com/comment/38727056
type: QuestionComment
has text: i have three images an image in the top with details and two other in the bottom !!when i click on one of the two images in the botton it take the place of the image in the top with details and the image with detail get the place of the picture in the bottom :) i hope you understand me
score: 0
comment on: http://stackoverflow.com/q/24923652
type: Comment

http://stackoverflow.com/comment/38968223
type: AnswerComment
has text: @VenomVendor I know that, but obviously OP doesn't. Answers should be more than just a piece of code.
type: Comment
comment on: http://stackoverflow.com/a/25051832
score: 3

http://stackoverflow.com/q/24911860
tagged with: php
downvote count: 1
has comment: http://stackoverflow.com/comment/38704558
type: AnsweredQuestion
has comment: http://stackoverflow.com/comment/38705491
score: 1
has answer: http://stackoverflow.com/a/24912260
has answer: http://stackoverflow.com/a/24912702
has comment: http://stackoverflow.com/comment/38704770
type: Question
has comment: http://stackoverflow.com/comment/38704854
linked to: http://stackoverflow.com/q/203198
tagged with: javascript
tagged with: jquery
possible better answer: http://stackoverflow.com/a/24912407
has comment: http://stackoverflow.com/comment/38705376
has comment: http://stackoverflow.com/comment/38705297
favorite count: 0
has answer: http://stackoverflow.com/a/24912407
answer count: 3
has title: Element not reacting to JQuery Click
accepted answer: http://stackoverflow.com/a/24912702
tagged with: http://stackoverflow.com/tag/html
has body: I have added Elements using Jquery inside PHP after loading them from the database. Each button has two classes, one controlling the GUI and another controlling the Click for particular button. The code is as under echo " "; Now if I check the classes from Inspect Element perspective of the browser, it shows 2 classes. But when I click on it and get class of element using this code $('.b_ui').click(function() { cls = $(this).attr('class'); alert('no. '+cls); } It shows only first class (GUI) and not the other which I want to use for handling click. Any help ?
upvote count: 2

http://stackoverflow.com/comment/38735144
score: 0
type: Comment
type: QuestionComment
has text: What do you mean when you say that the page is not loaded correctly?
comment on: http://stackoverflow.com/q/24928133

http://stackoverflow.com/comment/38758590
score: 0
type: Comment
comment on: http://stackoverflow.com/a/24939276
has text: ok, i'm working through your solution now and I had a question. If .innerHTML() or .html() only grabs "the first element in the set of matched elements" according to the jQuery API, so my question is since my text is not within an another HTML element like a , or but rather just floating within the #userOptions id then how will .innerHTML know to grab only the length of the text. Because inside of the #userOptions there is also an SVG and a UL, does that make sense? Thanks.
type: AnswerComment

http://stackoverflow.com/q/24993675
has title: Highcharts custom axis type (Weibull paper)
tagged with: javascript
has comment: http://stackoverflow.com/comment/38858229
tagged with: weibull
has answer: http://stackoverflow.com/a/24993864
has body: I need to draw a chart with custom axis type. Y axis should look like this: http://weibull.com/hotwire/issue8/rb8_7.gif The equation of Y axis is: http://weibull.com/hotwire/issue8/rb8_3.gif Any idea how to do this?
answer count: 1
tagged with: highcharts
tagged with: axes
type: UnansweredQuestion
score: 0
type: Question

http://stackoverflow.com/q/25026663
has comment: http://stackoverflow.com/comment/38921295
has comment: http://stackoverflow.com/comment/38921050
downvote count: 0
score: 1
has comment: http://stackoverflow.com/comment/38921240
has comment: http://stackoverflow.com/comment/38921018
tagged with: post
type: Question
has comment: http://stackoverflow.com/comment/38921357
has comment: http://stackoverflow.com/comment/38921168
has answer: http://stackoverflow.com/a/25026947
has comment: http://stackoverflow.com/comment/38920962
has comment: http://stackoverflow.com/comment/38921495
tagged with: javascript
has comment: http://stackoverflow.com/comment/38921512
tagged with: jquery
tagged with: ajax
answer count: 2
has comment: http://stackoverflow.com/comment/38921127
has comment: http://stackoverflow.com/comment/38921383
upvote count: 1
has comment: http://stackoverflow.com/comment/38921002
has comment: http://stackoverflow.com/comment/38921614
has comment: http://stackoverflow.com/comment/38921397
has body: I am trying to send a some data via ajax post and on server perform some task and then return result back. here is an ex: i have done function sometask(id) { $.ajax({ type: 'POST', url: '/ajaxPost/task/', data: {title: 'test', text: 'test2'}, dataType: 'text', success: function(data) { console.log('success'); console.log(data); }, error: function () { console.log('failed'); } }); } on server side &lt;?php var_dump($_POST); exit; on html Do something expected result was data sent via ajax returned as an array. but its returning empty array. when changed type to 'GET' on ajax and on server side var_dump($_GET); the data is returned. So why does it work with get and not with post, where i have gone wrong?
has comment: http://stackoverflow.com/comment/38921533
has title: PHP Ajax works with get but not with post
favorite count: 0
has comment: http://stackoverflow.com/comment/38921031
type: UnansweredQuestion
has comment: http://stackoverflow.com/comment/38921652
has answer: http://stackoverflow.com/a/25026758
has comment: http://stackoverflow.com/comment/38921536
has comment: http://stackoverflow.com/comment/38921559
tagged with: php

http://stackoverflow.com/a/25029461
answers question: http://stackoverflow.com/q/25029180
upvote count: 8
has comment: http://stackoverflow.com/comment/62722549
type: Answer
has body: Try this: Component { id: someComponent ListModel { } } function createModel(parent) { var newModel = someComponent.createObject(parent); return newModel; }
score: 8
type: AcceptedAnswer
downvote count: 0
accepted answer of: http://stackoverflow.com/q/25029180

http://stackoverflow.com/comment/38966257
has text: @Vinay Sharma now check it
score: 0
type: AnswerComment
comment on: http://stackoverflow.com/a/25050827
type: Comment

http://stackoverflow.com/comment/38836772
type: Comment
comment on: http://stackoverflow.com/a/24982294
score: 0
type: AnswerComment
has text: Both the above answers clear out all the images not just the empty ones

http://stackoverflow.com/comment/38885856
score: 0
has text: yes bro. i tried that one. for the first time after deleting the cache its working. but for the next time its again crashing.
type: Comment
comment on: http://stackoverflow.com/q/24971526
type: QuestionComment

http://stackoverflow.com/a/24993878
score: 1
upvote count: 1
answers question: http://stackoverflow.com/q/24993830
has body: Well, you have to do something like this: Make sure the path to the file is correct.
downvote count: 0
type: Answer
has comment: http://stackoverflow.com/comment/38858493

http://stackoverflow.com/a/25023863
type: Answer
answers question: http://stackoverflow.com/q/25023794
score: 1
has body: Yes, you can load a file dynamically with php. Then whenever you want to save post the body DOM back to your server and overwrite the existing file. This is typically considered extremely poor practice though. <?php include "otherfile.txt"; ?> save.php <?php file_put_contents("otherfile.txt", $_POST['body']); ?>
downvote count: 0
upvote count: 1

http://stackoverflow.com/q/25018633
has title: How to clear BLOB created at the time of HTML5 FileReader calls
has body: I am seeing BLOBs created at the time of reading JPEG image file from local system through FilreReader using readAsDataURL API are not cleared out from memory in mobile Safari till page reload. I have tried clearing objects by setting to null and clearing all the references. var reader = new FileReader(); reader.onloadend = function(event) { var img = new Image(); img.src = this.value; .... } reader.readAsDataURL(referanceToFile); When try to submit large images browser is crashing consistently. Please share your thoughts and suggestions if anyone experienced same or similar issue. Thanks in advance
score: 1
tagged with: mobile-safari
type: Question
answer count: 1
tagged with: javascript
has answer: http://stackoverflow.com/a/26659189
linked to: http://stackoverflow.com/q/22899333
tagged with: http://stackoverflow.com/tag/html
downvote count: 0
favorite count: 0
linked to: http://stackoverflow.com/q/21206823
type: UnansweredQuestion
upvote count: 1
tagged with: filereader

http://stackoverflow.com/comment/38849612
type: Comment
comment on: http://stackoverflow.com/a/24988499
has text: (See the updated demo—double click to change the text: http://jsfiddle.net/MTtjL/2/)
score: 0
type: AnswerComment

http://stackoverflow.com/q/24983939
has comment: http://stackoverflow.com/comment/38840105
answer count: 3
has comment: http://stackoverflow.com/comment/38840394
has comment: http://stackoverflow.com/comment/38840315
has answer: http://stackoverflow.com/a/24984078
tagged with: javascript
tagged with: jquery
has comment: http://stackoverflow.com/comment/38840189
possible better answer: http://stackoverflow.com/a/24984065
has answer: http://stackoverflow.com/a/24984182
accepted answer: http://stackoverflow.com/a/24984182
has body: How can I open an section of html with an id using JS/JQuery? Lets say the html I want to trigger with JS/JQuery is A modal Content. Footer I've tried using $('#show').dialog('open'); which doesn't work. The only other consideration is, that the full code must also copy an image that the user clicks on (to activate show) I have this at the moment, the only part not working is making the above code show on the page after the user has clicked the image. $(document).ready(function() { $('.go img').css('cursor', 'pointer'); $('.go').on('click', 'img', function(e) { $(this).width(100).height(100).appendTo('#badgeselect'); $('#show').dialog('open'); }); SaveMyBadge(); return false; });
type: AnsweredQuestion
has title: How to make a html box appear on page using JavaScript/JQuery?
type: Question
has comment: http://stackoverflow.com/comment/38840218
has comment: http://stackoverflow.com/comment/38840176
score: 0
has answer: http://stackoverflow.com/a/24984065

http://stackoverflow.com/q/24924262
has comment: http://stackoverflow.com/comment/38767078
type: Question
has comment: http://stackoverflow.com/comment/38766644
has comment: http://stackoverflow.com/comment/38728176
tagged with: javascript
has comment: http://stackoverflow.com/comment/38767089
linked to: http://stackoverflow.com/q/22275590
has body: I'm trying to validate a form using Semantic UI validations and Angular JS (using partials), but I'm not getting any success. The structure follows: index.html Users Take note in the last line of script declarations. In this script I validate some data of a form that is in a partial. ui.js (function ($) { 'use strict'; $('.ui.form') .form({ email: { identifier: 'email', rules: [ { type: 'empty', prompt: 'Email cannot be blank.' } ] } }, { on: 'blur', inline: 'true' }); }(jQuery)); The 'identifier' attributes references the id attributes from the inputs of my form. add-user.html (the partial) Add new user ID Email Submit Back to home | New In this case I'm validating the 'email' input, only. Theoretically, this will make the form to be validated in the moment when I push the Submit button (Semantic UI magic). So, when I push the submit, the blank e-mail input must be colored in red. Pointing the input that is invalid. The problem is that the ui.js is executed before the entire page is rendered. This makes the .ui.form class to be not found. And then, the magic doesn't happens. This can be something with the partials rendering, or something like that. Can someone help me? And apologize my english. It's not my native lang. :)
score: 0
duplicate of: http://stackoverflow.com/q/22275590
has comment: http://stackoverflow.com/comment/38728248
has comment: http://stackoverflow.com/comment/38728111
tagged with: jquery
has comment: http://stackoverflow.com/comment/38767320
tagged with: angularjs
tagged with: semantic-ui
type: UnansweredQuestion
has title: Angular + Semantic UI Form Validations not woking
answer count: 0

http://stackoverflow.com/a/25023196
type: Answer
answers question: http://stackoverflow.com/q/25023099
has body: It would seem you just want &lt;%= sb.ToString() %&gt; in the middle of your javascript.
score: 0

http://stackoverflow.com/comment/38792822
comment on: http://stackoverflow.com/q/24958553
score: 0
has text: Why are you binding a ready event? What do you think it does?
type: Comment
type: QuestionComment

http://stackoverflow.com/comment/94560385
type: Comment
has text: I had to explicitly specify UTC timezone, or it would use my local timezone and give me the previous day: return date.toLocaleDateString("en-US", { weekday: 'short', timeZone: 'UTC' });
comment on: http://stackoverflow.com/a/45464959
score: 0
type: AnswerComment

http://stackoverflow.com/comment/38886006
has text: The `listeners` property references an Array which holds the event listener functions for the object. So when it comes time to trigger an event, he looks up the `listeners` array and invokes all the functions stored inside. So `this.listeners` is the Array, `this.listeners[i]` is getting the array member at the `i` index, and `this.listeners[i](data)` is invoking the function found at that index, and passing it the `data`.
type: Comment
type: QuestionComment
score: 1
comment on: http://stackoverflow.com/q/25008024

http://stackoverflow.com/a/25035710
downvote count: 0
upvote count: 2
type: AcceptedAnswer
answers question: http://stackoverflow.com/q/25035197
accepted answer of: http://stackoverflow.com/q/25035197
type: Answer
has body: You didn't show the full code, but it's probably happening because the auth object did not exist when you ran console.log (you're probably fetching it from an async service call, etc.). It would still appear in the console.log($scope) call because console shows the current state of a variable when you expand it. So by the time you expand the $scope variable in the console, its auth object is defined and set. Here's an example with a timeout (to simulate any async event): setTimeout(function(){ $scope.auth = {'Owner': 'Test', 'Role': 'Role'}; }, 1000); console.log($scope.auth); // undefined console.log($scope); // auth object exists when you expand it in the console See the full example here (check the console): http://plnkr.co/edit/uqJVzfYNoJ0KCRGZawdW?p=preview Also, you'll find some nice explanations related to that here: How can I change the default behavior of console.log? (*Error console in safari, no add-on*) So, the bottom line: you won't be able to "extract" that scope value simply because it's unavailable at that point. Show some more code and we'll help you figure out when it becomes available.
score: 2

http://stackoverflow.com/comment/38723763
has text: @Hanlet: Both are ajax calls but in the second case i handle the response with a separate function call..First case works fine, but in the second case the redirection does not work...
type: Comment
type: QuestionComment
comment on: http://stackoverflow.com/q/24921463
score: 0

axes
tag name: axes
type: Tag
tags question: http://stackoverflow.com/q/24993675

http://stackoverflow.com/a/25314612
answers question: http://stackoverflow.com/q/25045914
has body: i know you already checked an answer, but please consider that you can still hide the default video controls and use your custom controls to play with. if you don't want/have time to spend on it yourself you can just use some javascript lib like videojs this way you'll have really full control both over buttons and video separately in a cross-browser way. http://www.w3.org/2010/05/video/mediaevents.html http://msdn.microsoft.com/en-us/library/ie/hh924822(v=vs.85).aspx
score: 0
type: Answer

http://stackoverflow.com/comment/38891426
type: AnswerComment
score: 0
type: Comment
has text: Barmar some more piece of code is required to make hide event work. I have updated the fiddle. Please check :)
comment on: http://stackoverflow.com/a/25010864